Starting a Business Service

An example is provided that shows how calls to the Work Manager Services API can be used to start and update a business service.

Starting a Business Service


The following step-by-step descriptions correspond to the numbered steps in the illustration above. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). (For an equivalent example using the Service Connector API (Java), see Starting a Business Service - Server Connector API Example (Java).

Procedure

  1. When you login into the client and click on Business Services, get business services erst API is called passing in the following filter string. For more details, refer to API explorer.
  2. When you click on Start button on Business Service, POST call of call instance is called. POST call of call instance passes the following parameters:
    • module name
    • process name
    • version 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"
        }
      }
  3. 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. 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"
            }
          ]
        }
      ]
  4. After you enter the details and click on 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"
        }