Create a Process Instance
/ic/api/process/v1/processes
Note:
- We do not support process instance creation of a synchronous process. Only async process instance creation is supported.
- If the system is overloaded, the process instance creation rest API returns only the conversationId. It does not return the processId. You can check for conversationId in the API response if you don't get the processId. You can use the conversationId to fetch the processId by using the API GET /processes/{id}, where id is the conversationId. See Retrieve a Process Instance.
Request
- application/json
-
action: string
Action - Submit, Save, Discard
-
operation: string
Operation
-
processDefId: string
processDefId
-
serviceName: string
Service Name
Response
- application/json
200 Response
object
-
conversationId:
string
-
createdBy:
string
-
createdDate:
string
-
dueDate:
string
-
expirationDate:
string
-
href:
string(uri)
-
isConversationEnabledFlag:
boolean
-
isDocsEnabledFlag:
boolean
-
levels:
integer(int32)
-
links:
array links
-
ownedBy:
string
-
priority:
integer(int32)
-
processDefId:
string
-
processDN:
string
-
processId:
string
-
processName:
string
-
processNumber:
integer(int32)
-
state:
string
-
title:
string
400 Response
500 Response
Examples
The following examples show how to create a process instance by submitting a POST request on the REST resource.
Send Request
https://example.com/ic/api/process/v1/processes
Where,
-
example.com
is the host where Oracle Integration is running.
Example: Create a New Process Instance for a Message-based Process
The following example shows how to send a request in JSON format with the POST method.
In this example, we are creating a new process instance based on the process definition version 1. Note the 1 in default~TravelReq!1~TravelApproval
.
POST Request:
https://example.com/ic/api/process/v1/processes
Request Body:
{
"processDefId":"default~TravelReq!1~TravelApproval",
"serviceName":"TravelApproval.service",
"operation":"start",
"action":"Submit",
"params":{"firstName":"John", "lastName":"Doe"}
}
Example: Create a New Process Instance from the Latest Activated Version
To create a new process instance based on the latest default activated process definition version, don't include the version number in the processDefId
.
POST Request:
https://example.com/ic/api/process/v1/processes
Request Body:
{ "processDefId":"default~TravelReq!~TravelApproval", "serviceName":"TravelApproval.service", "operation":"start", "action":"Submit", "params":{"firstName":"John", "lastName":"Doe"} }
Examples: Create a New Process Instance from a Web form (Form-based Process Start)
The following examples show how to send the request in JSON format with the POST method from a web form.
The "payload" attribute is used to populate form data. The MessageInput
request object accepts "payload" or "params". When using "payload", you do not provide arguments or parameter names. Do not use formArg
when using "payload".
Example 1: Create a new process instance from a web form and populate form data with the "payload" attribute in the request body
The "payload" attribute value is in string format, so you need to escape the quotes.
In this example, we are creating a new process instance based on the process definition version 1.
POST Request:
https://example.com/ic/api/process/v1/processes
Request Body:
{"action":"submit","operation":"start","payload":"{\"travelerDetails.name\":\"John Doe\",\"travelerDetails.age\":11,\"travelerDetails.address.line1\":\"401 Island Parkway\",\"travelerDetails.address.zip\":94065}","processDefId":"oracleinternalpcs~TravelApproval_user1!1~Process","serviceName":"Process.service"}
Example 2: Create a new process instance from a web form and pass parameters with the "params" attribute in the request body
In this example, we are creating a new process instance based on the process definition version 1.
POST Request:
https://example.com/ic/api/process/v1/processes
Request Body:
{"action":"submit","operation":"start","params":{"formArg" : {"travelerDetails": {"name" : "John Doe", "age" : 12 , "address" : {"line1" : "401 Island Parkway", "zip" : 94065}}}},"processDefId":"oracleinternalpcs~TravelApproval_user1!1~Process","serviceName":"Process.service"}
Example 3: Create a new process instance from a web form and pass query parameters in the request
In this example, the processDefId
, serviceName
, operation
, action
parameters are sent as query parameters in the request.
We are creating a new process instance based on the process definition version 1.
POST Request:
https://example.com /ic/api/process/v1/processes?processDefId=default~TravelApplication!1~TravelProcess&serviceName=Process.service&operation=start&action=Submit
Request Body:
{"formArg" : {"travelerDetails": {"name" : "John Doe", "age" : 12 , "address" : {"line1" : "401 Island Parkway ", "zip" : 94065}}}}
Example of Response Header
Status Code: 200 OK
Example of Response Body
{ "levels": 0, "links": [ { "href": "http://example.com:7001/ic/api/process/v1/processes/20017", "length": 0, "rel": "self" }, { "href": "http://example.com:7001/ic/api/process/v1/processes/20017/audit", "length": 0, "rel": "audit" } ], "title": "Instance #20017 of Travel Approval", "processId": "20017", "processDefId": "default/TravelReq!1/TravelApproval", "processName": "TravelApproval", "priority": 0, "state": "OPEN", "owner": "TravelReq.ProcessOwner", "creator": "jsmith" }
Example of Response Body Containing conversationId and Without the processId
{ "levels": 0, "links": [ { "href": "https:// example.com/ic/api/process/v1/processes/urn:62b97a6d-6151-11eb-bdcb-02001701ffed", "length": 0, "rel": "self" }, { "href": "https://exmaple.com/ic/api/process/v1/processes/urn:62b97a6d-6151-11eb-bdcb-02001701ffed/audit", "length": 0, "rel": "audit" } ], "processDefId": "default/TravelReq!1/TravelApproval", "processName": "TravelApproval", "conversationId": "urn:62b97a6d-6151-11eb-bdcb-02001701ffed" }