SubFlow

Here is the detail about SubFlow.

Create a SubFlow

Firstly, you should open the "Create Flow" dialog box, and click "New Flow" under the "Flow" tab. A SubFlow begins fron a Start Component, and can finish at any End Componeng. (The NextFlow Component can't be used in a SubFlow.)

SubFlow's transaction

About SubFlow's transaction, please refer to the SubFlow Component's "Help" document. The path is the left side menu's "More detail"'s "Flow elements" "Transaction".

Input

There are 2 datas passed from a caller Flow to a SubFlow--stream and parameter.

Stream

In a caller Flow, the stream output from the component configured before a SubFlow Component will be the SubFlow's input stream. To process the input stream from the caller Flow with the SubFlow, it's necessary to specify the output stream type for the Start Component to make it same as the type of the output stream from the component configured before the SubFlow Component in the caller Flow, and it's necessary to define a same field in the stream pane. If you don't process the input data from the caller Flow, please select "Any" for the output stream type of the Start Component.

Notice

If the output stream type of the Start Component isn't "Any", the output stream type of the component before the SubFlow Component must be as same as the one of the SubFlow's Start Component in a caller Flow. If they are different with each other, an error will happen.

Flow parameter

Flow parameter can get the value set with the caller Flow by publishing the Flow parameter of the executed Flow. If you publish the Flow variable defined by the SubFlow, you can set a value for the Flow variable published from the caller Flow, and pass it.

Pass parameter

A Flow variable should be defined and published by the SubFlow previously. If you configure a SubFlow Component for the caller Flow, and specify a Flow name with the "Executed Flow" property, the parameter information can be set for the SubFlow component automatically. After having configured a SubFlow Component for the caller Flow, if the caller Flow and the SubFlow belong to the same project, the parameter information will be updated automatically, if the caller Flow's project is different with the SubFlow's, it's necessary to update the SubFlow's information.

Click a caller Flow's SubFlow Component and open the inspector. Under the "parameter" tab, you can check the parameter name, the data type and the initial value when the Flow variable defined by the SubFlow is taken as parameter.

Related information

Set value

To pass a fixed value as parameter from the caller Flow to the SubFlow, you can click the SubFlow Component of the caller Flow to open the inspector, and set a value in the "value" field of the "parameter" tab.

You can pass a dynamic value created by a Flow as a parameter from the caller Flow to the SubFlow by using mapper. Firstly, configure a Mapper Component before the SubFlow Component in the caller Flow. Then, double click the Mapper Component to open the mapping window. At last, map the value to the parameter name field under the "parameter" of the "SubFlow Component" property of the output field in the right.

Setting priority

The setting priority is as below.

(SubFlow)                                         (caller Flow)            (caller Flow) 
Flow variable's initial value < parameter value < change by the parameter;s mapper 

In a SubFlow, a parameter is used as a Flow variable. When you can define an initial value for a Flow variable, and the value can't be passed as a parameter, the initial value will be valid. If you set a value under the "parameter" tab of the SubFlow Component in the caller Flow, the value will overwrite the initial value of the Flow variable set in the SubFlow. Moreover, if you set a replacement by mapper, the Flow variable's initial value or the value under the "parameter" tab will be overwritten.

Notice

Having set an initial value for a published Flow variable in the SubFlow, if you specify a SubFlow in the caller Flow, the Flow variable's initial value will be set as a parameter value automatically. If you set and change a parameter value in the caller Flow, the parameter won't be changed though the Flow variable value is set or changed in the SubFlow.

Output

When a SubFlow finished and returned to the caller Flow, the passed data is stream, Flow variable and return value.

Stream

The output stream of the end component of a SubFlow will be the output stream of the SubFlow Component of the caller Flow. You can use any end component to finish a SubFlow. (The NextFlow Component can't be used.) To process the output stream of a SubFlow with the caller Flow, you can use the EndResponse Component that can output the result. If you don't want to use the caller Flow to process the output data of the SubFlow, you can use an End Component that can't output result. You can use the Break Component or the Exception Component that makes error happen to process parallel or loop. (If you don't want to use the caller Flow to process the output data of the SubFlow, the output stream can be ignored.)

In a caller Flow, if the SubFlow Component's "Output directly" property is set as "Yes", the SubFlow Component's output stream will be output directly no matter whether the SubFlow outputs data or not.

Set stream and field's definition

After configuring a SubFlow Component for the caller Flow and specifying a Flow name in the "Executed Flow" property, the SubComponent's output stream type and field definition will be set automatically. After configuring a SubFlow Component for the caller Flow and defining the SubFlow's output stream, it's necessary to update the SubFlow's information.

Related information

When configure multiple end components

Multiple components will be configured when there are multiple streams output from branches. If the stream types and the field definitions of the end components are the same, the output stream of the SubFlow Components will show the defined content. If they are different with each other, the stream type will be "Any". And if the Flow doesn't finish at the End Component that can't output result, the output stream type of the SubFlow Component will be set as "Any" automatically.

Flow variable

In a SubFlow, the parameter from a caller Flow is used as a Flow variable. After running a SubFlow in a caller Flow, the value of the changed Flow variable can be referred to in the SubFlow. To refer to a stream variable in a caller Flow, you can configured a Mapper Component after a SubFlow Component. Double click the Mapper Component to open the mapping window, then you can map the data from the stream variable name field under the stream of the input field in the left.

Related information

Return value

You can check the value set in the "Return value" property of the end component of a SubFlow by using the caller Flow. To refer to the return value by the caller Flow, you can configure a Mapper Component after the SubFlow Component. After double clicking the Mapper Component to open the mapping window, you can map and output data from the return value field under the property of the input field in the left.

Memo

If the SubFlow's end component is the Exception Component, the value set in the "Error message" property of the Exception Component will be set as return value automatically, and can be referred to.

 

To the top of this page