Some simple examples of leveraging the API here -
I am doing this to familiarize myself with things, before trying out Visual Builder CS integration with process.
Here is a process instance in OIC -
Now to the REST API -
1.GET /ic/api/process/v1/processes
Retrieves process instance list.
2. Add comments to the process -
POST /ic/api/process/v1/processes/{processId}/comments
As you can see from the first call, my process id is 30001.
I validate in the worklist app -
3. Retrieve a Process Instance
GET /ic/api/process/v1/processes/{processId}
4. Retrieve the Task List
GET /ic/api/process/v1/tasks
5. Get Task
Note the payload returned -
"actionList": [
{
"length": 0,
"title": "CREATE_TODO",
"actionType": "System",
"actionId": "CREATE_TODO"
},
{
"length": 0,
"title": "VIEW_PROCESS_HISTORY",
"actionType": "System",
"actionId": "VIEW_PROCESS_HISTORY"
},
{
"length": 0,
"title": "SKIP_CURRENT_ASSIGNMENT",
"actionType": "System",
"actionId": "SKIP_CURRENT_ASSIGNMENT"
},
{
"length": 0,
"title": "VIEW_TASK",
"actionType": "System",
"actionId": "VIEW_TASK"
},
{
"length": 0,
"title": "VIEW_TASK_HISTORY",
"actionType": "System",
"actionId": "VIEW_TASK_HISTORY"
},
{
"length": 0,
"title": "START_TASK",
"actionType": "System",
"actionId": "START_TASK"
},
{
"length": 0,
"title": "SUSPEND_TIMERS",
"actionType": "System",
"actionId": "SUSPEND_TIMERS"
},
{
"length": 0,
"title": "UPDATE_TASK_PAYLOAD",
"actionType": "System",
"actionId": "UPDATE_TASK_PAYLOAD"
},
{
"length": 0,
"title": "ACQUIRE",
"actionType": "System",
"actionId": "ACQUIRE"
},
{
"length": 0,
"title": "ESCALATE",
"actionType": "System",
"actionId": "ESCALATE"
},
{
"length": 0,
"title": "WITHDRAW",
"actionType": "System",
"actionId": "WITHDRAW"
},
{
"length": 0,
"title": "OVERRIDE_ROUTING_SLIP",
"actionType": "System",
"actionId": "OVERRIDE_ROUTING_SLIP"
},
{
"length": 0,
"title": "VIEW_SUB_TASKS",
"actionType": "System",
"actionId": "VIEW_SUB_TASKS"
},
{
"length": 0,
"title": "CUSTOM",
"actionType": "System",
"actionId": "CUSTOM"
},
{
"length": 0,
"title": "UPDATE",
"actionType": "System",
"actionId": "UPDATE"
},
{
"length": 0,
"title": "UPDATE_ATTACHMENT",
"actionType": "System",
"actionId": "UPDATE_ATTACHMENT"
},
{
"length": 0,
"title": "UPDATE_COMMENT",
"actionType": "System",
"actionId": "UPDATE_COMMENT"
},
{
"length": 0,
"title": "INFO_REQUEST",
"actionType": "System",
"actionId": "INFO_REQUEST"
},
{
"length": 0,
"title": "REASSIGN",
"actionType": "System",
"actionId": "REASSIGN"
},
{
"length": 0,
"title": "SUSPEND",
"actionType": "System",
"actionId": "SUSPEND"
},
{
"length": 0,
"title": "DECOMPOSE_TASK",
"actionType": "System",
"actionId": "DECOMPOSE_TASK"
},
{
"length": 0,
"title": "DELEGATE",
"actionType": "System",
"actionId": "DELEGATE"
},
{
"length": 0,
"title": "REJECT",
"actionType": "Custom",
"actionId": "REJECT"
},
{
"length": 0,
"title": "APPROVE",
"actionType": "Custom",
"actionId": "APPROVE"
}
]
6. Update a Task
PUT /ic/api/process/v1/tasks/{id}
Here I will approve the task we have been looking at -
7. Create a Process Instance -
As you can see, I have 2 Start events - Message and Form
Start Message -
POST /ic/api/process/v1/processes
Start Message Payload is as follows -
REST Request Payload -
The request payload will Require the process name, I need to call the following REST API to retrieve that
ic/api/process/v1/process-definitions
The value I need is processDefId -
"processDefId": "oracleinternalpcs~NewOrgApprovalApp!1.0~NewOrderApprovalProcess",
I also need the Service Name -
"serviceName": "NewOrderApprovalProcess.service"
Here is the payload -
I am doing this to familiarize myself with things, before trying out Visual Builder CS integration with process.
Here is a process instance in OIC -
Now to the REST API -
1.GET /ic/api/process/v1/processes
Retrieves process instance list.
2. Add comments to the process -
POST /ic/api/process/v1/processes/{processId}/comments
As you can see from the first call, my process id is 30001.
I validate in the worklist app -
3. Retrieve a Process Instance
GET /ic/api/process/v1/processes/{processId}
4. Retrieve the Task List
GET /ic/api/process/v1/tasks
5. Get Task
GET /ic/api/process/v1/tasks/200023
Note the payload returned -
"actionList": [
{
"length": 0,
"title": "CREATE_TODO",
"actionType": "System",
"actionId": "CREATE_TODO"
},
{
"length": 0,
"title": "VIEW_PROCESS_HISTORY",
"actionType": "System",
"actionId": "VIEW_PROCESS_HISTORY"
},
{
"length": 0,
"title": "SKIP_CURRENT_ASSIGNMENT",
"actionType": "System",
"actionId": "SKIP_CURRENT_ASSIGNMENT"
},
{
"length": 0,
"title": "VIEW_TASK",
"actionType": "System",
"actionId": "VIEW_TASK"
},
{
"length": 0,
"title": "VIEW_TASK_HISTORY",
"actionType": "System",
"actionId": "VIEW_TASK_HISTORY"
},
{
"length": 0,
"title": "START_TASK",
"actionType": "System",
"actionId": "START_TASK"
},
{
"length": 0,
"title": "SUSPEND_TIMERS",
"actionType": "System",
"actionId": "SUSPEND_TIMERS"
},
{
"length": 0,
"title": "UPDATE_TASK_PAYLOAD",
"actionType": "System",
"actionId": "UPDATE_TASK_PAYLOAD"
},
{
"length": 0,
"title": "ACQUIRE",
"actionType": "System",
"actionId": "ACQUIRE"
},
{
"length": 0,
"title": "ESCALATE",
"actionType": "System",
"actionId": "ESCALATE"
},
{
"length": 0,
"title": "WITHDRAW",
"actionType": "System",
"actionId": "WITHDRAW"
},
{
"length": 0,
"title": "OVERRIDE_ROUTING_SLIP",
"actionType": "System",
"actionId": "OVERRIDE_ROUTING_SLIP"
},
{
"length": 0,
"title": "VIEW_SUB_TASKS",
"actionType": "System",
"actionId": "VIEW_SUB_TASKS"
},
{
"length": 0,
"title": "CUSTOM",
"actionType": "System",
"actionId": "CUSTOM"
},
{
"length": 0,
"title": "UPDATE",
"actionType": "System",
"actionId": "UPDATE"
},
{
"length": 0,
"title": "UPDATE_ATTACHMENT",
"actionType": "System",
"actionId": "UPDATE_ATTACHMENT"
},
{
"length": 0,
"title": "UPDATE_COMMENT",
"actionType": "System",
"actionId": "UPDATE_COMMENT"
},
{
"length": 0,
"title": "INFO_REQUEST",
"actionType": "System",
"actionId": "INFO_REQUEST"
},
{
"length": 0,
"title": "REASSIGN",
"actionType": "System",
"actionId": "REASSIGN"
},
{
"length": 0,
"title": "SUSPEND",
"actionType": "System",
"actionId": "SUSPEND"
},
{
"length": 0,
"title": "DECOMPOSE_TASK",
"actionType": "System",
"actionId": "DECOMPOSE_TASK"
},
{
"length": 0,
"title": "DELEGATE",
"actionType": "System",
"actionId": "DELEGATE"
},
{
"length": 0,
"title": "REJECT",
"actionType": "Custom",
"actionId": "REJECT"
},
{
"length": 0,
"title": "APPROVE",
"actionType": "Custom",
"actionId": "APPROVE"
}
]
6. Update a Task
PUT /ic/api/process/v1/tasks/{id}
Here I will approve the task we have been looking at -
7. Create a Process Instance -
As you can see, I have 2 Start events - Message and Form
Start Message -
POST /ic/api/process/v1/processes
Start Message Payload is as follows -
REST Request Payload -
The request payload will Require the process name, I need to call the following REST API to retrieve that
ic/api/process/v1/process-definitions
The value I need is processDefId -
"processDefId": "oracleinternalpcs~NewOrgApprovalApp!1.0~NewOrderApprovalProcess",
I also need the Service Name -
"serviceName": "NewOrderApprovalProcess.service"
Here is the payload -