Execute Workflow Instance

Verb: executeWorkflow

Executes a Workflow Instance previously created using the Create Workflow Instance command.

1. Workflow is a process flow control engine. A Workflow represents a process within a BPMN file.

Syntax

executeWorkflow --instance(WorkflowInstance) (Error)=error (Boolean)=success

Inputs

Script Designer Required AcceptedTypes Description
--instance Workflow Instance Required Workflow Instance Workflow instance that should be executed

Outputs

Script Designer AcceptedTypes Description
error Error Error If an error accurs during the command's execution, it returns an exception message, the line in which the error ocurred, the routine's and the command's names .
success Success Boolean "True" if the workflow instance was successfully executed; "False" if otherwise.

Example

The Execute Workflow Instance command executes an Workflow instance obtained by the Create Workflow Instance command and previously mapped by the Map Workflow Activities command.

defVar --name mappedWorkflow --type Workflow
defVar --name success --type Boolean
defVar --name a --type Numeric --value 1
defVar --name workflow --type Workflow
defVar --name workflowInstance --type WorkflowInstance
// Download the file to execute the command.
loadWorkflow --isfromfile  --file "bpmnTestVar.bpmn" --process "Id_f12b1ed6-0ecd-4bf7-b245-9bf31b63e900" workflow=value
mapWorkflowActivities --workflow ${workflow} --mappings "Task_inc=beginSub"
createWorkflowInstance --workflow ${workflow} --businessstatus "In Progress" --businessstatusreason "Script in Development" workflowInstance=value
// Executes an instance created by using its ID.
executeWorkflow --instance ${workflowInstance} success=success
logMessage --message "${success}\r\n" --type "Info"
beginSub --name beginSub
    incrementVar --number ${a}
endSub
Download File
To run the sample script, it is necessary to download the file and insert its path in the File parameter of the Load Workflow command.

See Also

  • Cancel Workflow Instance
  • Create Batch
  • Create Workflow Instance
  • End Batch
  • Get Batch
  • Get the Next Workflow Instance
  • List Batches
  • List Workflow Instances
  • Load Workflow
  • Load Workflow Instance
  • Map Workflow Activities
  • Migrate Workflow Version
  • Restart Workflow Instance
  • Start Batch
  • Suspend Workflow
  • Update Batch
  • Update Workflow Instance