Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

在这个例子中,我们有2个流程,第一个流程“Workflow Process 1”包含一个Subflow,可以调用第二个流程“Workflow Process 2”。

Image Added

图1:工作流程过程1和子流程到工作流程过程2

工作流程过程1有一个名为“firstStatus”的声明工作流程变量。

Image Added

图2:工作流程2

工作流程过程2有一个名为“secondStatus”的声明工作流程变量。

子流程属性

标题

描述

Id

要调用的流程 

Execution

同步: 调用并创建子流实例,并等待子流程完成,然后再继续到工作流程过程中的下一个节点。
异步: 调用子流程并继续到流程中的下一个节点,无需等待

Subflow Parameters / Actual Parameters

子流程中的工作流程变量将与当前工作流程过程中的现有工作流程变量进行映射。子流参数实际参数中的条目数应该相同。

Id:工作流变量ID 
模式:

  • In: 仅在调用子流程过程时,将当前工作流程变量的值传递给子流程变量。
  • Out: 只有在完成子流程时,才将子流工作流程变量的值传递给当前工作流程的变量。
  • In and Out: 上述的组合

示例:

在上面的截图中,子流程将同步执行。参数设置为“ In and Out”。

让我们按照时间顺序浏览整个流程:

  1. 流程开始“工作流程过程1”
  2. “活动1”开始了。
  3. 以“firstStatus”设置为“a”完成的“活动1”。
  4. 子流程已启动。由于参数设置为“ In and Out”,现在将子流程的值“a”设置为“secondStatus”。
  5. “活动3”从“secondStatus”开始,初始化为“a”。
  6. 以“secondStatus”设置为“ab”完成“活动3”。
  7. “活动4”以“secondStatus”开始初始化为“ab”开始。
  8. “活动4”以“secondStatus”设置为“abc”完成。
  9. 子流程现在已经结束了。由于参数设置为“In and Out ”,所以值“abc”现在返回到父进程的“firstStatus”。“活动2”以“firstStatus”设置为“abc”开始。

In this example, we have 2 processes, with the first process "Workflow Process 1" containing a Subflow calling the second process "Workflow Process 2".

Image Removed
Figure 1: Workflow Process 1 with Subflow to Workflow Process 2

Workflow Process 1 has one declared workflow variable named "firstStatus".

Image Removed

Figure 2: Workflow Process 2

Workflow Process 2 has one declared workflow variable named "secondStatus".

Subflow Properties

...

Title

...

Description

...

Id

...

Process to be called

...

Execution

...

Synchronous: calls and creates the subflow instance and waits for the subflow process to finish before continuing to the next node in the workflow process
Asynchronous: calls the subflow process and continues to the next node in the process, without waiting

...

Subflow Parameters / Actual Parameters

...

  • In: pass the value from the current workflow process's variable to the subflow process's variable only upon calling up the subflow process.
  • Out: pass the value from the subflow workflow process's variable to the current workflow process's variable only upon completion of the subflow process.
  • In and Out: a combination of the above

Example:

In the screenshot above, the subflow process will be executed synchronously. Parameter is set to "In and Out".

Let's walk through the entire process flow chronologically:

  1. Start of process "Workflow Process 1"
  2. "Activity 1" started.
  3. "Activity 1" completed with "firstStatus" set to "a".
  4. Subflow process started. As the parameter is set to "In and Out", the value "a" is now set to "secondStatus" of the subflow process.
  5. "Activity 3" started with "secondStatus" initialized to "a".
  6. "Activity 3" completed with "secondStatus" set to "ab".
  7. "Activity 4" started with "secondStatus" initialized to "ab".
  8. "Activity 4" completed with "secondStatus" set to "abc".
  9. The subflow process has now come to an end. As the parameter is set to "In and Out", the value "abc" is now returned to "firstStatus" of the parent process. "Activity 2" started with "firstStatus" set to "abc".