Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Postwork scripts are commonly used to perform tasks after the task is completed. This script may be useful for updating databases or generating documents by the user entered data.

Because the task is already completed, some operations (for example; , trying to set an action on a current work item) are invalid at this stage, and an error is thrown.

Postwork script defined area is reached from a related task. When you click on the "Postwork script" button on the task, the postwork script page will open.

Example:

Image Removed

In postwork script The following objects are available :in the postwork script;

$WorkItem
Current workitem instance.

$Xml
Xml XML data navigator for data model.

Insert excerpt
EMK:_InstanceScriptingObjectsEMK:
_InstanceScriptingObjects
nopaneltrue

Insert excerpt
EMK:_GlobalScriptingObjectsEMK:
_GlobalScriptingObjects
nopaneltrue

...

Updating data model by action

Assigns the completion date to the Data Model if the user selects the "Approve" action.

Code Block
languagejs
titleAssign action
if ( $WorkItem.SelectedAction == 'Approve' ) {
   $Xml.SetValue("ApprovedAt", $WorkItem.End );
}

...