Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

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

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

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

Example:

In postwork script following objects are available:

$WorkItem
Current workitem instance.

$Xml
Xml data navigator for data model.

Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'EMK:_InstanceScriptingObjects'.

Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'EMK:_GlobalScriptingObjects'.

Common operations

Updating data model by action

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

Assign action
if ( $WorkItem.SelectedAction == 'Approve' ) {
   $Xml.SetValue("ApprovedAt", $WorkItem.End );
}
  • No labels