How to determine the node name of the current Work Item, Task ID, and assigned transitions for this Work Item in Docupace Start?
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.
Figure 1: Opened Work Item
When creating a new work item with the Docupace Start, all values are editable.
Figure 2: Created Work Item
In specific cases, the work item should not be edited.
Example. When opening a work item from the queue “Pending Advisor Review”, it is set as editable. But when opening it from the queue “FA Final Review”, then fields are locked down. It is done by detecting the opened task in the widget code or page configuration.
Figure 3: The list of tasks with queues
How to know the node name of the current Work Item, Task ID, and assigned transitions for this Work Item in the Docupace Start?
Normally if the work item is assigned to a user, these transitions are displayed on the work item's screen opened from Monitor and the user is able to execute transitions.
Figure 4: Work Item’s transitions
If the work item is opened by Docupace Start widget, the user cannot see the form, he is entering the information in the Docupace Start screens. Apart from the standard way, in order to execute the transactions with the Docupace Start, they should be triggered. To do this, the developer needs to know the task ID (not the Work Item), and the tasks connected to this work item. To get them, open the Work Item with the DSP, and get these values from JavaScript.
When Docupace Start creates a new Work Item or loads an existing Work Item, it populates:
Work Item id in $scope.wizardState.$workItem.id.
Work Item Tasks in $scope.wizardState.$workItem.tasks[], with following attributes:
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 ")
This is added to following parts of Connect/DSP which deals with opening Work Item or creating a Work Item
/launchInterface?interfaceKey=CLIENTDSP&spTransactionGUID=
this finds oldest WI in this Starting Point Transaction and opens it)/launchInterface?interfaceKey=CLIENTDSP&workItemId=
this opens specific Work Itempage with pageType="loadNextWorkitem"
this is special page which loads next workitem in this starting point transactionpage with pageType="createOrUpdateWorkItem"
this page creates a new Work Item or updates an existing onepage with pageType="createWorkItem"
this 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.