重新启动工作流程实例
动词:restartWorkflow
重新启动当前工作流程实例的执行。
1. 工作流程是一个过程流控制引擎。 工作流程表示 BPMN 文件内的一个流程。
2. 实例表示应处理的项。 变量负责接收工作流程执行的数据,将每个任务指定到各自对应的流程。
语法
restartWorkflow --instance(WorkflowInstance) (WorkflowInstance)=value
输入
| 脚本 | 设计器 | 必需的 | AcceptedTypes | Description |
|---|---|---|---|---|
| -- 实例 | 工作流程实例 | 必需的 | 工作流程实例 | 要重新启动的当前工作流程实例。 |
输出
| 脚本 | 设计器 | AcceptedTypes | Description |
|---|---|---|---|
| 值 | 实例 | 工作流程实例 | 返回与在工作流程实例参数中指定的实例具有相同属性的实例,但重启后会更新其信息。 |
示例
使用重新启动工作流程实例命令重新启动执行工作流程实例,该实例是由创建工作流程实例命令先前创建的。
defVar --name mappedWorkflow --type Workflow
defVar --name a --type Numeric --value 0
defVar --name workflow --type Workflow
defVar --name workflowInstance --type WorkflowInstance
defVar --name restartedInstance --type WorkflowInstance
// Download the following file to run the command.
loadWorkflow --isfromfile --file "bpmnTestVar.bpmn" --process "Id_f12b1ed6-0ecd-4bf7-b245-9bf31b63e900" workflow=value
mapWorkflowActivities --workflow ${workflow} --mappings "Task_inc=beginSubroutine" mappedWorkflow=value
goSub --label beginSubroutine
// Create an instance using the Mapped Workflow ID.
createWorkflowInstance --workflow ${workflow} --businessstatus "In Progress" --businessstatusreason "Developing Script" workflowInstance=value
// Restart an instance
restartWorkflow --instance ${workflowInstance} restartedInstance=value
logMessage --message "${restartedInstance}" --type "Info"
beginSub --name beginSubroutine
while --left "${a}" --operator "Less_Than" --right 5
incrementVar --number ${a}
endWhile
endSub
下载文件
要运行样本脚本,需要下载该文件,并在装入工作流程命令的文件参数中显示其路径。
备注
仅当脚本在执行工作流程实例命令的上下文外部时,才应将此命令插入到该脚本。