列出批处理

动词: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
    
    下载文件

    要运行样本脚本,需要下载该文件,并在装入工作流程命令的文件参数中显示其路径。

    另请参阅

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