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 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 along with the payload and the state WMstateOpen to open the 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. Client uses the form details and renders the form using the forms runtime loaded in the client. 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. 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