Restart Workflow Instance
Verb: restartWorkflow
Restart the execution of the current Workflow instance.
1. Workflow is a process flow control engine. A Workflow represents a process within a BPMN file.
2. Instance represents the item that should be processed. It is the variable responsible for receiving data for the Workflow execution, assigning each task to its respective process.
Syntax
restartWorkflow --instance(WorkflowInstance) (WorkflowInstance)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--instance | Workflow Instance | Required | Workflow Instance | Current Workflow instance to be restarted. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Instance | Workflow Instance | Returns an instance with the same attributes as the one informed in the Workflow Instance parameter, however, with its updated information after the restart. |
Example
The Restart Workflow Instance command restarts the execution of the Workflow instance, previously created by the Create Workflow Instance command.
defVar --name mappedWorkflow --type Workflow
defVar --name a --type Numeric --value 0
defVar --name workflow --type Workflow
defVar --name workflowInstance --type WorkflowInstance
defVar --name restartedInstance --type WorkflowInstance
// Download the following file to run the command.
loadWorkflow --isfromfile --file "bpmnTestVar.bpmn" --process "Id_f12b1ed6-0ecd-4bf7-b245-9bf31b63e900" workflow=value
mapWorkflowActivities --workflow ${workflow} --mappings "Task_inc=beginSubroutine" mappedWorkflow=value
goSub --label beginSubroutine
// Create an instance using the Mapped Workflow ID.
createWorkflowInstance --workflow ${workflow} --businessstatus "In Progress" --businessstatusreason "Developing Script" workflowInstance=value
// Restart an instance
restartWorkflow --instance ${workflowInstance} restartedInstance=value
logMessage --message "${restartedInstance}" --type "Info"
beginSub --name beginSubroutine
while --left "${a}" --operator "Less_Than" --right 5
incrementVar --number ${a}
endWhile
endSub
Download File
To run the sample script, it is necessary to download the file and inform its path in the File parameter of the Load Workflow command.
Remarks
This command should be inserted into the script only if it is outside the context of the Execute Workflow Instance command.