Flow Execution
Last updated
Last updated
This component is used to execute another flow called sub flow. The parameters and data generated while a flow is being executed are passed to the sub flow. The use case of the sub flow is like this.
Load the data from the source table, validate each record, and synchronize to the target table.
The 1st step is loading data from the source table. And the 2nd step performs validation per record. The 3rd step executes query per record too. The data from the 1st step is a list and the 2nd step validates every single element in the list. This means a loop processing. But Flow does not provide loop function. Flow provides sub flow feature instead.
The 1st step will be executed in a main flow. The 2nd step and the 3rd step are executed in a sub flow. The single element of the list can be passed one by one to the sub flow through this component.
Attribute | Description |
---|---|
This example demonstrates the multi-level flow execution. In this example, the main flow will load employee data from the source database, filter the employee data, and synchronize to the target database.
The synchronization process filters out employees based on their department and does not synchronize them to the target database.
Main Flow
Sub Flow
The Load Employees component retrieves the employee data and store the data into ResultArray.
The Execute Flow component executes sub flow asynchronously as many times as the number of the ResultArray The number of executions is stored into LoopCount.
The Wait component checks whether the executions of the sub flow are complete until the timeout. The number of the executions comes from the output of Execute Flow component ??? LoopCount.
The Check Department component verifies if the employee belongs to the Marketing department or not. It executes a query to retrieve data from the dept_emp table using the emp_no and dept_no parameters. The result set is then stored in the CheckResultArray variable. However, the default name of the result set (ResultArray) conflicts with the input parameter of the flow (employee info). To prevent this conflict, the default name of the result set is changed.
If the result does not exist, it proceeds to Synchronize Employee.
The Synchronize Employee component executes an insert ignore query using employee information.
Attribute | Description |
---|---|
Input | Output |
---|---|
Input | Output |
---|---|
Input | Output |
---|---|
Input | Output |
---|---|
Input | Output |
---|---|
Input | Output |
---|---|
InvocationResult
Invocation result
LoopCount
The total number of the transactions that sub flow has been executed.
DataStructureId
Data structure id for future mapping
(*) FlowExecution component does not generate any output which can be mapped to any data structure. The data for Data structure come from Data Structurre Parameter of input properties.
Main flow
Sub flow
Flow Id
Sub flow id
Synchronous
Execute the sub flow synchronously or asynchronously?
Synchronous
Asynchronous
Loop
Execute the flow per record or with entire records once?
Invoke Parameter
Parameter passed to the flow.
Parameter name does not need to be enclosed by #.
If Loop = yes and InvokeParameter is list, each element in the list is passed as InvokeParameter.
Parameter name can be hierarchical ??? parent_parameter.child_parameter
Exclude Parameters
If exists, the parameters specified here are not passed to the sub flow.
DataStructure Parameter
Parameter name which contains data linked to Data Structure Id for future mapping