Define a Task to run a Script

It is possible inside Bizagi to define a task as script to run:

In this case the first task of the process is to run a Script. To define a Task as Script in Bizagi select the Task click on mouse right button (this will display the context menu) select "Task Type" and the click on "Script Task".

The Script must be a Block Closure with two arguments: [:script :process | ]. The first argument is the process itself (an instance of BpmProcessInstance) and the second argument is the script itself (an instance of BpmScriptTaskInstance). The script accept variable definitions that can be stored inside the script:

[:script :process |  | tempVar |
script setVariableNamed: 'stamp' withValue: TimeStamp now.
(process transactionAmount > 1000) 
ifTrue: [process doSomething] 
ifFalse: [process doOtherThing]
].

To set the script code in Bizagi:

Last updated