启动批处理
动词:beginBatch
可从以下位置获取: <Standard>
启动一组实例,阻止其他执行访问已启动的执行,直到它被 结束批处理 命令终止为止。
1. 工作流程是一个过程流控制引擎。 工作流程表示 BPMN 文件内的一个流程。
2. 实例表示应处理的项。 变量负责接收工作流程执行的数据,将每个任务指定到各自对应的流程。
语法
beginBatch --batch(WorkflowBatch) [--variables(String)] [--timeout(TimeSpan)]
输入
| 脚本 | 设计器 | 必需的 | AcceptedTypes | Description |
|---|---|---|---|---|
| --batch | Batch | 必需的 | 工作流程批处理 | 先前由创建批处理命令创建的实例批处理。 |
| --variables | 变量 | 可选 | 文本 | 映射执行上下文中的变量及其值。1. 先前可在 IBM RPA 控制中心上创建这些变量。 但是,如果连接到本地数据库,那么可以从数据库本身获取变量,也可以使用 IBM RPA Studio指定的值创建变量。 2。该值必须存储在 IBM RPA Studio 变量中。 |
| --timeout | 超时 | 可选 | 时间范围、数字、文本 | 等待运行实例组的最长时间。如果在类型为超时值的参数中未定义任何值,那么执行将使用设置超时值命令定义的上下文时间。 如果脚本未使用此命令,那么缺省时间为 5 秒。 |
示例
使用启动批处理命令启动执行一批实例。 最后,将针对批处理的每个实例显示“已执行”消息,以及批处理具有的实例数。
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
下载文件
要运行样本脚本,需要下载该文件,并在装入工作流程命令的文件参数中显示其路径。