Prework scripts are commonly used to control process data or task state before it's assigned to the users.

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


In prework script following objects are available:

Current workitem instance.

Xml data navigator for data model.

Current workflow instance.

Initiator of workflow instance.

A boolean value that specifies the current workflow instance is in test mode.

A number value between 0 to 5 that specifies the priority of workflow instance.

A string value that specifies the initiated culture of workflow instance. (Example: "en" or "de" or "tr")

Translation dictionary that provides localized texts.

Provides methods to query relational database.

Provides methods to access organization database.

Provides methods for time based calculations and working hours calendar.

Provides methods to query non-relational database.

Allows to access domain preferences.

Allows to access defined web services.

Allows to send email messages.

Performs cryptographic and digital signature operations.

Allows to access user delegation library.

Allows to access file repository.

Allows to access document repository. 

Common operations

Auto Process Task

Automatically processes current work item, without assigning it to the users, and skips to the next step of a workflow.

Assign action
$WorkItem.SelectedAction = 'Approve';

Dynamic Deadline Date

Sets deadline date by user entered data.

Assign action
$WorkItem.DeadlineDate = $Xml.EvaluateDateTime('PaymentDate');
  • No labels