获取批处理

动词:getBatch

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

获取先前由 创建批处理 命令生成的实例组。

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

语法

getBatch --workflow(Workflow) --key(String) (WorkflowBatch)=Batch (Boolean)=anypending (Boolean)=success

输入

脚本 设计器 必需的 AcceptedTypes Description
--workflow 工作流程 必需的 Workflow 将从其中获取实例组的“工作流程”类型的变量。
此变量是使用装入工作流程命令的工作流程参数生成的。
-- 键 密钥 必需的 文本工作流程批处理 要获取的当前实例组的唯一标识。
当前租户内部不能存在两个相同的标识。

输出

脚本 设计器 AcceptedTypes Description
Batch Batch 工作流程批处理 返回从属于特定工作流程命令获取的实例组。
将获取已填充的实例组,以及有关此实例组的变量值和常规信息。
anypending 暂挂 BOOLEAN 如果已识别到实例并将其存储到组中,那么返回“True”;否则,返回“False”。
成功 成功 BOOLEAN 如果命令成功,那么返回“True”;否则,返回“False”。

示例

使用获取批处理命令获取创建批处理命令先前创建的实例组。

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
defVar --name obtainedBatch --type WorkflowBatch
defVar --name hasInstance --type Boolean
defVar --name getSuccess --type Boolean
// 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
beginBatch --batch ${instancesBatch} --timeout 00:00:40
	foreach --collection "${instancesBatch}" --variable "${instanceToExecute}"
		executeWorkflow --instance ${instanceToExecute} executedInstances=Success
	endFor
endBatch
// Get the group of instances created earlier.
getBatch --workflow ${instancesBatch.Workflow} --key initialBatch obtainedBatch=Batch hasInstance=anypending getSuccess=success
logMessage --message "\r\nBatch Name: ${obtainedBatch}\r\nHas Instances: ${hasInstance}\r\nManaged to Get the Batch: ${getSuccess}" --type "Info"
beginSub --name beginSubroutine
	logMessage --message Executed --type "Info"
	return
endSub
下载文件

另请参阅

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