结束批处理

动词:endBatch

可从以下位置获取: <Standard>

结束一批实例,将其他执行从访问由 启动批处理 命令启动的执行中解锁。

1. 工作流程是一个过程流控制引擎。 工作流程表示 BPMN 文件内的一个流程。
2. 实例表示应处理的项。 变量负责接收工作流程执行的数据,将每个任务指定到各自对应的流程。

语法

endBatch

示例

使用启动批处理命令执行所有实例后,然后使用结束批处理命令结束批处理执行。

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
endWhile
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
	endFor
endBatch
// 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"
	return
endSub
下载文件
要运行样本脚本,需要下载该文件,并在装入工作流程命令的文件参数中显示其路径。

另请参阅

  • 取消工作流程实例
  • 创建批处理
  • 创建工作流程实例
  • 执行工作流程实例
  • 获取批处理
  • 获取下一个工作流程实例
  • 列出批处理
  • 列出工作流程实例
  • 装入工作流程
  • 装入工作流程实例
  • 映射工作流程活动
  • 迁移工作流程版本
  • 重新启动工作流程实例
  • 启动批处理
  • 暂挂工作流程
  • 更新批处理
  • 更新工作流程实例