End Batch

Verb: endBatch

Available from: <Standard>

Ends a batch of instances, unlocking other executions from accessing the execution started by the Start Batch command.

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.




The End Batch command ends the batch execution, after the Start Batch command executes all instances.

defVar --name mappedWorkflow --type Workflow
defVar --name a --type Numeric --value 0
defVar --name workflow --type Workflow
defVar --name workflowInstance --type WorkflowInstance
defVar --name instancesBatch --type WorkflowBatch
defVar --name instanceToExecute --type WorkflowInstance
defVar --name executedInstances --type Boolean
defVar --name instancesQuantity --type List --innertype WorkflowInstance
// Download the following file to run the command.
loadWorkflow --isfromfile  --file "bpmnTestVar.bpmn" --process "Id_f12b1ed6-0ecd-4bf7-b245-9bf31b63e900" --automapvariables  workflow=value
mapWorkflowActivities --workflow ${workflow} --mappings "Task_inc=beginSubroutine" mappedWorkflow=value
createBatch --description "Batch containing Workflow instances" --workflow ${workflow} --key initialBatch --comment "Creates a batch to store Workflow instances" instancesBatch=value
while --left "${a}" --operator "Less_Than" --right 5
	incrementVar --number ${a}
	createWorkflowInstance --workflow ${workflow} --businessstatus "In Progress" --businessstatusreason "Developing Script" --defaultvalues "a=${a}" --batch ${instancesBatch} workflowInstance=value
listWorkflowInstances --workflow ${workflow} --status "New" --batchkey loteInicial instancesQuantity=value
beginBatch --batch ${instancesBatch} --timeout 00:00:40
	// Starts the execution of the batch.
	foreach --collection "${instancesBatch}" --variable "${instanceToExecute}"
		executeWorkflow --instance ${instanceToExecute} executedInstances=Success
// Ends the execution of the batch.
logMessage --message "Instances Quantity: ${instancesQuantity.Count}\r\nInstance Executed: ${executedInstances}" --type "Info"
beginSub --name beginSubroutine
	logMessage --message Executed --type "Info"
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.

See Also

  • Cancel Workflow Instance
  • Create Batch
  • Create Workflow Instance
  • Execute Workflow Instance
  • 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