Accessing Work Items from a Wizard

For developers, it is important to determine the Node Name of the current Work Item, Task Name, Task ID, and assigned transitions for Work Item in Docupace Start. And also to verify if the Work Item is opened from a Docupace Start widget or not.

Initial problem was that when opening an existing work item with the Docupace Start widget, it loads the data from the work item and fields were not editable.

  • When creating a new work item with the Docupace Start, all values are editable.

Figure 1: Created Work Item

  • In specific cases, the work item should not be edited.

Example. When opening a work item that is in the workflow task “Pending Advisor Review”, it is set as editable. But when opening it from the task “FA Final Review” in the workflow, then fields are locked down. It is done by detecting the opened task in the widget code or on the widget page configuration.

Node name, Task ID, and assigned transitions for this Work Item

Normally, if the work item is assigned to a user, transitions are displayed on the work item's Task screen opened from Monitor (see Figure 2).

Figure 2: The Work Item list with Task names

To execute the transitions, in the work item's Task screen click on the menu bar buttons (see Figure 3).

Figure 3: Work Item’s transition buttons

To execute the transactions with the Docupace Start, they should be triggered. Then the developer needs to know the Task ID (not the Work Item), and the tasks connected to this work item.

When Docupace Start creates a new Work Item or loads an existing Work Item, it populates:

id – task Id

workflowName (e.g. "ePACS")

taskName (e.g. "Pending Advisor Review")

nodeName (e.g. "Advisor Review")

assignedTo

url (e.g. "https://www.preprod.docupaceinc.com/rbcwm_dev/rest/v1/workflows/ePACS/mytasks/2462544 ")

transitions[] – Transitions available for this task

name (e.g. "Reject")

displayName (e.g. "Withdraw")

uri (e.g. "https://www.preprod.docupaceinc.com/rbcwm_dev/rest/v1/workflows/ePACS/mytasks/2462544/transitions/Reject ")

For example, there are added the following parts of Connect/DSP which deal with opening a Work Item or creating a Work Item.

/launchInterface?interfaceKey=CLIENTDSP&spTransactionGUID=

Finds the oldest Work Item in this Starting Point transaction and opens it.

/launchInterface?interfaceKey=CLIENTDSP&workItemId=

Opens specific Work Item.

page with pageType="loadNextWorkitem"

Special page which loads next Work Item in this Starting Point transaction.

page with pageType="createOrUpdateWorkItem"

Page creates a new Work Item or updates an existing one.

page with pageType="createWorkItem"

Page creates a new Work Item.

Docupace Start provides a method which would load all tasks of the current work item: $scope.api.taskService.getWorkItemTasks() 

Docupace Start clears the $scope.wizardState.$workItem when Docupace Start is re-initialized ($scope.initializeWizardState() or action button "Restart Wizard").

Here we get parameters, as seen in this example:

  • “Task ID” (99891),

  • Task assigned to “FAS”,

  • Node name “Advisor Review5”,

  • Task name (queue) “FA Final Review”,

  • Workflow ID “21003”,

  • Workflow name “ePACS” etc.

Task has two Transitions: “Complete” and “Remove” with URLs.