Invoke

Invoke

REST Endpoints and Data Conversion

REST Endpoints and Data Conversion

REST Endpoints

You can expose a process as a REST service through a URL that uses the following format:
https://mySPIwebAdress:portNumber/active-bpel/services/REST/<process_name>?var=value
You can use one of the following verbs to invoke a process:
  • GET
  • POST
  • PATCH
  • PUT
  • DELETE
Use JSON when you send a request with a POST verb.
For example, the following snippet shows a JSON request that is used with a POST verb:
{ "param_A" : "abc", // NOTE: string, no $t "param_B" : 123, // NOTE: typed as a number "param_C" : true // NOTE: typed as bool }
The request returns the following response:
{ "field_A" : "abc", "field_B" : 123, "field_C" : true }
Use query parameters when you send a request with the GET verb.
For example, the following snippet shows the same request with a GET verb:
GET/rt/ProcessName?param_A=abc&param_B=123&param_C=true

Simple Array Handling

You can place a JSON payload that contains an array of simple types in a process object. For example, in a process, you can define an input field named
orders
of type
ObjectList
. In the
orders
input field, you can reference a process object named
OrderNumber
that contains a single field.
The following snippet shows the JSON array that can be sent:
{ "orders" : ["O-213", "O-425"] }
Process Designer transforms this internally into:
{ "orders" : [{OrderNumber : "O-213"}, {OrderNumber : "O-425"}] }
When an output field is serialized to JSON, Process Designer transforms the objects into an array of simple types.

0 COMMENTS

We’d like to hear from you!