Versions Compared

Key

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

Prework script scripts are commonly used to control process data or task state before assign 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, the prework script page will open.


In the prework script following objects are available:$Xml
Xml data navigator for data model.

$WorkItem
Current workitem instance.

$Instance
Current workflow instance.

$Initiator
Initiator of workflow instance.

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

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

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

$Localization
Translation dictionary that provides localized texts.

$Database
Provides methods to query relational database.

Generic Objects

$Membership
Provides methods to access organization database.

$Calendar
Provides methods for time based calculations and working hours calendar.

$XmlRepository
Provides methods to query non-relational database.

$Domain
Allows to access domain preferences.

$Services
Allows to access defined web services.

$Messages
Allows to send email messages.

$Crypto
Performs cryptographic and digital signature operations.

$Delegation
Allows to access user delegation library.

$Files
Allows to access file repository.

$Documents
Allows to access document repository. 

$Xml
XML data navigator for data model.

Insert excerpt
_InstanceScriptingObjects
_InstanceScriptingObjects
nopaneltrue

Insert excerpt
_GlobalScriptingObjects
_GlobalScriptingObjects
nopaneltrue

Common operations

Auto Process Task

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

Code Block
languagejs
titleAssign action
$WorkItem.SelectedAction = 'Approve';

Dynamic Deadline Date

Set Sets deadline date by user-entered data.

Code Block
languagejs
titleAssign action
$WorkItem.DeadlineDate = $Xml.EvaluateEvaluateDateTime('PaymentDate');