Skip to content

Postwork Script

Postwork scripts execute after a task's completion, enabling operations such as database updates or document generation based on user-provided data. Since the task is already completed, certain actions (e.g., modifying the current work item's action) are invalid and will raise errors.

Access the postwork script editor by clicking the "Postwork script" button on the task's configuration page.

Common Operations

Updating the Data Model Based on Task Action

This example updates the data model with an approval date if the user selects the "Approve" action:

Assign Action Script:

1
2
3
if ($WorkItem.SelectedAction == 'Approve') {
    $Xml.SetValue("ApprovedAt", $WorkItem.End);
}