Example of Processing a Work Item

This topic shows a simple example of the possible flow of processing for a work item.

Processing a Work Item

In this example:

Procedure

  1. A work item appears in an organizational entity’s work list. Its initial state is Offered.
  2. To direct it to a resource (user) within that organizational entity, use the allocateWorkItem call, specifying the ID of the work item and the GUID of the resource as input parameters. The state of the work item changes to Allocated.
  3. When the user opens the work item from their client user interface, the client application calls the openWorkItem operation, with the work item ID as an input parameter. The status of the work item changes to Opened.
  4. The client application may make provision for the user to save the work item part way through completing it. This would be particularly useful if the work item displays a form containing a large number of fields or that may take some time to complete. In such circumstances the client application can call the saveOpenWorkItem operation. This saves the data associated with the work item, but does not change its state—it remains Opened.
  5. In some applications a user may have to wait some time before finalizing a work item, for example to wait for another process to complete or for information to come in from an outside source. In that case the work item can be pended. If it is in an Opened state as in this example, that can be achieved by calling the closeWorkItem operation. If you call closeWorkItem and specify a hiddenPeriod, then that work item cannot be operated on for the specified period of time, or until the specified date and time is reached. Until then it is in the PendHidden state.
  6. When the pendHidden deadline is reached a timer expires and the work item is put in the Pended state.
  7. The user can now resume work on it. This is done by calling openWorkItem again, and returning the work item to the Opened state.
  8. When the user has finished with the work item, and indicates this by pressing a Submit button or similar in their client application’s user interface, the completeWorkItem operation is called and the state of the work item changed to Completed.