列出批处理
动词:listBatches
可从以下位置获取: <Standard>
列示先前由 创建工作流程实例 命令创建的一组实例。
1. 工作流程是一个过程流控制引擎。 工作流程表示 BPMN 文件内的一个流程。
2. 实例表示应处理的项。 变量负责接收工作流程执行的数据,将每个任务指定到各自对应的流程。
语法
listBatches --workflow(Workflow) [--startdate(DateTime)] [--enddate(DateTime)] [--status(Nullable<BatchStatuses>)] [--businessstatus(String)] (List<WorkflowBatch>)=value
输入
| 脚本 | 设计器 | 必需的 | AcceptedTypes | Description |
|---|---|---|---|---|
| --workflow | 工作流程 | 必需的 | Workflow | 将在其中列出实例组的“工作流程”类型变量。此变量是使用装入工作流程命令的工作流程参数生成的。 |
| --startdate | 开始日期 | 可选 | 日期时间 | 将要从此列出的实例组的开始日期。 |
| --enddate | 结束日期 | 可选 | 日期时间 | 将要从此列出的实例组的结束日期。 |
| -- 状态 | 状态 | 可选 | BatchStatuses | 要列出的实例组的系统状态。 选项: |
| --businessstatus | 业务状态 | 可选 | 文本 | 有关实例组的进度的新状态。此参数用于在流程内部进行指导,而不干扰脚本的操作。 |
输出
| 脚本 | 设计器 | AcceptedTypes | Description |
|---|---|---|---|
| 值 | 批处理列表 | 列表<Workflow Batch> | 返回已获取的实例组。仅列出实例组的信息计数。 要使此参数完全填充,需要使用获取批处理命令。 |
示例
使用该命令显示已成功执行的批处理数。
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 executedBatch --type List --innertype WorkflowBatch
// 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
foreach --collection "${instancesBatch}" --variable "${instanceToExecute}"
executeWorkflow --instance ${instanceToExecute} executedInstances=Success
endFor
endBatch
listBatches --workflow ${workflow} --status "Done" --comment "Displays the number of batches that were executed in the script" executedBatch=value
logMessage --message "Instances Number: ${instancesQuantity.Count}\r\nExecuted Instances: ${executedInstances}\r\nExecuted Batches Quantity: ${executedBatch.Count}" --type "Info"
beginSub --name beginSubroutine
logMessage --message Executed --type "Info"
return
endSub
下载文件
要运行样本脚本,需要下载该文件,并在装入工作流程命令的文件参数中显示其路径。