Displaying a Work Item Form

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

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.

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

    Procedure
  1. A work item is opened by invoking a PUT call on work presentation REST service.
    Pass the work id, version along with the payload, and the state WMstateOpen to open the work item.
    /Workpresentationitem updates and opens the specified work item.
    Payload for the PUT calls is similar to the one shown below:
    { 
     "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"
      }
    }

    Response of the above calls returns the updated payload and also the form details associated with the work item task

  2. The client uses the form details and renders the form using the forms runtime loaded in the client. The user interacts with the form by entering details and when the form is submitted or closed, the work form returns the updated data to the client.
  3. The client invokes work presentation PUT call again passing the payload received from the form and passing 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.
    WMstateClosed
    WMstateCompleted