Scripts of Type Workflow
When using scripts in a workflow, you can either save the scripts within the workflow (in the Process Designer) or reference a script stored in the Admin Tool from within the workflow. Saving workflow scripts in the Admin Tool is useful if the same script is used in several places, e.g., in different activities or workflows. In addition, scripts can be tested more easily during workflow development because changes to scripts in the Admin Tool take effect immediately after saving, so you do not have to deploy the workflow.
Steps to use a workflow script:
-
Write a script of the type Workflow in the Scripts section of the Admin Tool.
-
Reference the script from the desired workflow item, e.g., a workflow activity, using the Process Designer
scriptExecutionService.execute("myscript.groovy")
Optionally, you can pass parameters to the script, e.g., the ticket:
def params = [ "myticket": workflowApi.ticket ]
scriptExecutionService.execute("myscript.groovy", params)
You can find detailed information about workflow programming in the ConSol CM Process Designer Manual.