Starting a Business Service
This topic provides an example that shows how calls to the Work Manager Services API can be used to start and update a business service.
Note: The following step-by-step description corresponds to the process shown in the diagram. The descriptions are from the perspective of the REST API. The process of performing operations using the REST API is explained with the help of an example.
- Procedure
- When you login to the client application and click Business Services, GET business services rest API is called passing in the following filter string. For more details, refer to API Explorer.
- When you click Start on Business Service, the POST call of call instance is called. POST call of call instance passes the following parameters:
module nameprocess nameversion number/Instances is the moduleName name of module/package to query on.moduleVersion version of module/package to query on
{ "moduleName": "string", "processName": "string", "moduleVersion": "string", "data": "string" }
The response returns the execution state, instance ID, activity information, and the payload.{ "instanceId": "123", "moduleName": "/SampleProcesses/Sample Tests/SampleTests.xpdl", "moduleVersion": "1.0.0.20201106103914259", "processName": "SampleBusinessService", "state": { "state": "ACTIVE", "failedMessage": null }, "activityInfo": { "activityId": "abc", "activityName": "UserTask", "activityPageflowName": "StartEvent", "activityData": "{\"body\":{}}", "activityProcessModuleName": "/SampleProcesses/Sample Tests/SampleTests.xpdl", "activityProcessModuleVersion": "1.0.0.20201106103914259" } }
- If Business Service has a form associated with it, Work presentation
WorkitemPageFlow GET rest API is called by passing the module name, version, and process name that is returned in the earlier call.
/WorkItemPageFlow is the Pageflow associated with the work item.processName: the name of the Process Template to query on.moduleVersion: the version of the Package to query on.The response returns form details for the activities of the process associated with the process name that is passed as part of the request. Form identifier points to the form that represents the user task activity in the business service. The form is rendered by the client for the user to enter the following details:
[ { "moduleName": "/SampleProcesses/Sample Tests/SampleTests.xpdl", "processName": "SampleBusinessService", "moduleVersion": "1.0.0.20201106103914259", "pageflowActivities": [ { "activityName": "UserTask", "activityId": "_r_2wp49sEeq3q_CEUhibZA", "formIdentifier": "com.example.sampleprocesses_1.0.0.20201106103914259/wp/openspaceGWTPull_DefaultChannel/.default/SanityTests/GetandViewDataStartEvent/UserTask/UserTask.gwt.json" } ] } ]
- After you enter the details and click the submit button of the form, PUT call of instance is called. The data received from the Form is updated and the data is submitted back to the server.
/Instances Updates a specified Process Instance.
{ "instanceId": "123", "moduleName": "/SampleProcesses/Sample Tests/SampleTests.xpdl", "moduleVersion": "1.0.0.20201106103914259", "processName": "SampleBusinessService", "state": { "state": "ACTIVE", "failedMessage": null }, "activityInfo": { "activityId": "abc", "activityName": "UserTask", "activityPageflowName": "StartEvent", "activityData": "{\"body\":{}}", "activityProcessModuleName": "/SampleProcesses/Sample Tests/SampleTests.xpdl", "activityProcessModuleVersion": "1.0.0.20201106103914259" }
Subtopics