Displaying a Form in a Pageflow

This topic provides an example that shows the sequence of calls a client application should make to display a form in a pageflow.

Note: The following step-by-step descriptions correspond to the numbered steps in the diagram. 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).

When a user opens a work item from the user interface:

Procedure

  1. Work item is opened by invoking a PUT call on work presentation REST service
    • /Workpresentationitem updates specified work item.
    • Pass the work id, version, payload and the WMstateOpen state to open the work item.
    • { 
       "id": "string",
        "version": "string",
        "header": {
          "name": "string",
          "description": "string",
          "itemContext": {
            "activityId": "string",
            "activityName": "string",
            "appInstance": "string",
            "appName": "string",
            "appVersion": 0,
            "appId": "string",
            "appInstanceDescription": "string",
            "processName": "string",
            "caseRef": "string"
          },
          "workType": {
            "uid": "string",
            "version": "string"
          }
        },
        "state": {
          "stringKey": "WMstateOpen",
          "description": "string"
        },
        "body": {
          "inputs": [
            {
              "name": "string",
              "simple": [
                {
                 
                }
              ],
              "structured": [
                {
                 
                }
              ]
            }
          ],
          "outputs": [
            {
              "name": "string",
              "simple": [
                {
                 
                }
              ],
              "structured": [
                {
                 
                }
              ]
            }
          ],
          "inouts": [
            {
              "name": "string",
              "simple": [
                {
                 
                }
              ],
              "structured": [
                {
                 
                }
              ]
            }
          ]
        },
        "presentation": {
          "channelId": "string",
          "channelType": "string",
          "formIdentifier": "string",
          "pageflow": {
            "moduleName": "string",
            "processName": "string",
            "version": "string"
          },
          "worktypeId": "string",
          "worktypeVersion": "string"
        }
      }
    The response of the above calls returns the updated payload and the form details associated with the work item task. If the work item is associated with a pageflow, pageflow details are returned as part of the open work item response.
  2. Based on the pageflow details returned as part of the work item response, client application invokes Pageflow POST REST API instances call to start the pageflow.
    • /Instances creates an instance in the specified process.
    • Work item data returned from the work presentation call is passed in as data to pageflow call. The module below is passed as part of the payload to the REST call that returned in the open work item call.
    • {
        "moduleName": "string",
        "processName": "string",
        "moduleVersion": "string",
        "data": "string"
      }
    • Response of the Pageflow call returns the pageflow details and the activity information paused at the Activity pageflow. The response returns the state of the pageflow.
    • {
        "instanceId": "string",
        "processId": "string",
        "moduleName": "string",
        "moduleVersion": "string",
        "processName": "string",
        "processLabel": "string",
        "state": {
          "state": "STARTING",
          "failedMessage": {
            "msgName": "START",
            "exceptionMsg": "string",
            "exceptionStack": "string",
            "msgData": "string",
            "activityData": "string"
          }
        },
        "activityInfo": {
          "activityId": "string",
          "activityName": "string",
          "activityProcessPackageId": "string",
          "activityProcessModuleName": "string",
          "activityProcessModuleVersion": "string",
          "activityPageflowName": "string",
          "activityData": "string"
        }
      }
  3. To retrieve the form details of the activity, Client application invokes work presentation GET work item pageflow call.
    • /WorkItemPageFlowis the Pageflow associated with the work item.
    • The response of this REST call returns the form details as form identifier.
    • {
        "moduleName": "string",
        "processName": "string",
        "moduleVersion": "string",
        "pageflowActivities": [
          {
            "activityName": "string",
            "activityId": "string",
            "formIdentifier": "string"
          }
        ]
      }
    • Client application uses the form identifier and renders the form using forms runtime.
  4. User interacts with the forms and enters the data in the form and when the form is closed or completed, Pageflow PUT call is called to progress the pageflow. Data returned from the form is passed in as a payload to Pageflow call.
    • /Instances updates a specified Process Instance.
    • {
      "instanceId": "string",
        "processId": "string",
        "moduleName": "string",
        "moduleVersion": "string",
        "processName": "string",
        "processLabel": "string",
        "state": {
          "state": "STARTING",
          "failedMessage": {
            "msgName": "START",
            "exceptionMsg": "string",
            "exceptionStack": "string",
            "msgData": "string",
            "activityData": "string"
          }
        },
        "activityInfo": {
          "activityId": "string",
          "activityName": "string",
          "activityProcessPackageId": "string",
          "activityProcessModuleName": "string",
          "activityProcessModuleVersion": "string",
          "activityPageflowName": "string",
          "activityData": "string"
        }
      }
  5. After the pageflow execution is complete, this information of pageflow state can be found in the state attribute of the pageflow response. Work presentation PUT call is invoked to complete the work item which passes the payload that is received from the form. It also passes the appropriate work item state depending on if the form is closed or submitted. When closing the work item, WMstateClose is passed and when submitting the form, WMstateCompleted is passed.
    • /Workpresentationitem updates the specified work item
    • { 
       "id": "string",
        "version": "string",
        "header": {
          "name": "string",
          "description": "string",
          "itemContext": {
            "activityId": "string",
            "activityName": "string",
            "appInstance": "string",
            "appName": "string",
            "appVersion": 0,
            "appId": "string",
            "appInstanceDescription": "string",
            "processName": "string",
            "caseRef": "string"
          },
          "workType": {
            "uid": "string",
            "version": "string"
          }
        },
        "state": {
          "stringKey": "WMstateCompleted",
          "description": "string"
        },
        "body": {
          "inputs": [
            {
              "name": "string",
              "simple": [
                {
                 
                }
              ],
              "structured": [
                {
                 
                }
              ]
            }
          ],
          "outputs": [
            {
              "name": "string",
              "simple": [
                {
                 
                }
              ],
              "structured": [
                {
                 
                }
              ]
            }
          ],
          "inouts": [
            {
              "name": "string",
              "simple": [
                {
                 
                }
              ],
              "structured": [
                {
                 
                }
              ]
            }
          ]
        },
        "presentation": {
          "channelId": "string",
          "channelType": "string",
          "formIdentifier": "string",
          "pageflow": {
            "moduleName": "string",
            "processName": "string",
            "version": "string"
          },
          "worktypeId": "string",
          "worktypeVersion": "string"
        }
      }