SubFlow - Sub-Flow

The SubFlow component executes the specified sub-flow.

This component's input stream is copied to the called flow's input stream.

Stream Information

InputFormatAll
Number of Inputs1
Description

The input stream must be set to the same format as the sub-flow's input stream format.

OutputFormatAll
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.

Component Properties

NameData TypeMappingDescription
Flowsubflow- The sub-flow to start.
Only flows that have the same Project Owner as the calling flow can become sub-flows.
ReturnValuestringOut Can refer the return value of sub-flow.
StreamPassThroughstreamPassThrough- Select if the input stream of this component is output or not.
true [true] - The input stream of this component is output.
false [false] - Outputs the output stream of invoked flow.
ParamcategoryIn    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.

Transaction

CommitCommits the sub-flow.
RollbackRolls back the sub-flow.

Exceptions

TypeParameterStream for error handling flowError
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.

Sub-flows and transaction control

Transactions of sub-flow depends on the Transaction property of the Start component of the parent flow.

When parent flow is transactional. (Transaction property is "Yes")

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 non-transactional. (Transaction property is "No")

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.

Changes of a flow name or flow variables of sub-flow

For sub-flow, you can use a flow both of the same project and of the other project.

Sub-flow in the same project

The changes of a flow name and flow variables are automatically detected. The properties of SubFlow are automatically updated.

Sub-flow in the other project

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.

Difference between SubFlow and FlowInvoker

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.

SubFlowFlowInvoker
TransactionAccording 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.
SessionThe 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.
RequestThe 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 nameCannot be mapped.Can set both owner and name of the flow dynamically.
Next FlowNext flow is ignored in sub-flowNext flow is executed and return the parent flow.
Execute userSame as the parent flow.Can set user name and password dynamically.
User InterfaceFlow 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.)
DebugCan 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.