The SubFlow component executes the specified sub-flow.
This component's input stream is copied to the called flow's input stream.
| Input | Format | All |
|---|---|---|
| Number of Inputs | 1 | |
| Description |
The input stream must be set to the same format as the sub-flow's input stream format. |
|
| Output | Format | All |
| Description |
When StreamPassThrough is "false", output stream is one of the invoked flow. If the invoked flow ends with End component, the input stream of this component is output regardless of the setting of PassStream.StreamPassThrough. |
| Name | Data Type | Mapping | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Flow | subflow | - |
The sub-flow to start. Only flows that have the same Project Owner as the calling flow can become sub-flows. |
||||||
| ReturnValue | string | Out | Can refer the return value of sub-flow. | ||||||
| StreamPassThrough | streamPassThrough | - |
Select if the input stream of this component is output or not.
|
||||||
| Param | category | In |
Specifies parameters of a sub-flow. When Flow is specifiedl, the public flow variables is set automatically. Put the Mapper prior to this component, you can map the values against the those variables. These variables are accessed as a stream variables. After this component, you can access these variables as a stream variables. For details of Stream variables, please refer to Stream Variables in Flow Service manual. |
| Commit | Commits the sub-flow. |
|---|---|
| Rollback | Rolls back the sub-flow. |
| Type | Parameter | Stream for error handling flow | Error Code | Description |
|---|---|---|---|---|
| Exception | None | This component's input stream | - | The sub-flow's defined input stream type is different than this component's input stream type. |
| - | The sub-flow ends with an Exception. |
Transactions of sub-flow depends on the Transaction property of the Start component of the parent flow.
The transaction of sub-flow become a part of the transaction of parent flow. The transaction property of End component in the sub-flow is ignored. When transactions of parent flow are comitted, transaction in the sub-flow also committed. Rollbacks are the same.
When parent flow is not transactional and only sub-flow is transactional, sub-flow's transaction is independent. Whether transactions are committed or rollbacked depends on the Transaction property of End comonent of sub-flow. This commit or rollback is executed at the SubFlow component's commitment.
For sub-flow, you can use a flow both of the same project and of the other project.
The changes of a flow name and flow variables are automatically detected. The properties of SubFlow are automatically updated.
When a flow name is changed of sub-flow, Flow becomes invalid. You need to set Flow again. If you want to affect the changes of flow variables or output stream, by right-clicking the menu "Update parameters" of SubFlow.
Both SubFlow component and FlowInvoker component can invoke another flow like subroutine. But there are many differences in the operations in a detailed part.
Please use an appropriate component properly according to the situation.
| SubFlow | FlowInvoker | |
|---|---|---|
| Transaction | According to the setting of Start component, sub-flow's transaction becomes a part of transactions of caller flow. |
A different another transaction at each call. A transaction of caller flow is different from transactions at each call. Caller flow waits the end of called flow. But the transaction is not terminated. |
| Session | The session under execution is all the same. The session variable is shared. |
The subsession of each owner of the executed flow is made. The session id of subsession is "<parent session ID>-<branch>". The life time of subsession is the same as parent session. If the parent session is the same, subsession executed by same user is the same and the session variables are shared during the session. The session variables and stream saved by StreamPut component cannot be shared by different users. |
| Request | The request under execution is all the same. The request variable is shared. |
Different request at each call. Request variables are initialized every time. The request ID at each call is quot;<Parent request ID>-<branch枝番>". |
| Mapping of flow name | Cannot be mapped. | Can set both owner and name of the flow dynamically. |
| Next Flow | Next flow is ignored in sub-flow | Next flow is executed and return the parent flow. |
| Execute user | Same as the parent flow. | Can set user name and password dynamically. |
| User Interface | Flow can be set by Select Flow dialog. The output stream and parameters are set automatically when setting flow. |
Sets flow name and parameter manually. (By "Replace component" of right click menu, convert from Subflow component to FlowInvoker component. Then, parameters are set automatically.) |
| Debug | Can use debugger and step into subflow. | In debugger, FlowInvoker component is retrieved as a single component. Cannot step in the invoked flow. When executed by profile mode, logs of invoked flow are output in FlowProfile.log. But it cannot be refered in the Designer. |
The flow invoked by FlowInvoker is executed in the same thread as the one of parent flow.
Therefore, the owner of flow that begins requesting and the flow executing it now can be different in flow-ctrl and the monitor tool, etc.