Sub Dialog Data Flow

Last Updated: 07/13/2018 Introduced in Version: 4.0

This tutorial demonstrates how to create and use Sub Dialog Data Flow in Decisions. Sub Dialog Data Flow was introduced in Decisions 4.0. Sub Dialog Data Flow works in the similar manner as Data Flow on the Form, except in Sub Dialog Data Flow we can use Forms for user interactions. These Forms will show up in a Sub Dialog window.

Example:

In this example we are going to demonstrate how to create and use Sub Dialog Data Flow.

For this example we integrated Decisions with Northwind database Customers table and added Access Pattern to Customers table by Country field.

 

 

We start in Designer Folder with clicking Create Flow on Folder Actions Panel.

 

In the resulting window we Name the Flow and pick Sub Dialog Data Flow behavior (specific Flow Behavior that can be used for Sub Dialog Data Flow on the Form). Then, we click Create to proceed to the Flow Designer.

 

In the Flow Designer we can see a Start Step and two End Steps: Change Data and Cancel. If our Flow executes on Change Data End Step, our Flow will act as Data Flow and output/change Data on the Form it was called from. If our Flow executes on Cancel End Step, we should not output any Data back to the calling Form.

 

 

Next, we select Start Step, click Add New Flow Input Data, and define Country String. This variable will be coming from the calling Form and serve as a search criteria in this Sub Dialog Data Flow.

 

 

Then, we add Access Customers By Country (Access Pattern for Customers table) from Integrations > My Integrations > Database > Northwind (Database) > dbo.Customers (Table) category.

 

2017-01-09_140234

 

Next, we select Get Customers By Country step on the work-space and click Edit Input Mapping.

 

2017-01-09_140416

 

In the Mapping Editor we connect Country Flow Input Data to Country field. For Country Match Type we select Constant Equals. When finished, we click Ok to save and close Mapping Editor.

 

2017-01-09_140747

 

Back in the Flow Designer we connect Failed outcome from the Get Customers By Country to the Cancel End Step in the Flow. On Done outcome we add Show Form step from Favorite Steps category.

 

2017-01-09_141236

 

In the resulting window we Name our Form and click Create to proceed to the Form Designer.

 

2017-01-09_141326

 

We design this Form as following… We use one constant ‘Customers In’ Label and one Dynamic [Country] Label (from Flow Data > Country (value)). Also, we have Done Button control for user to be able to submit this Form. The list of available Customers we display with Dynamic Data Grid control from List category. We pick Northwind_dboCustomers Type for the grid and this Data Grid Mode is set to be SingleSelect to output single Customer. When finished, we Save the Form and close Form Designer.

 

2017-01-09_141656

 

Back in the Flow Designer we call the Mapping Editor for our Pick Customer Form.

 

2017-01-09_141931

 

In the Mapping Editor we map Customers_Result outcome from Get Customers By Country to Customers Dynamic Data Grid control on the Form. We click Ok to save and close Mapping Editor.

 

2017-01-09_142059

 

Back in the Flow Designer we connect Done outcome from our Pick Customer Form Step to the Change Data End Step. Select Change Data End Step on the work-space and click Add New Output Data. In the Add Data pop-up window we name our Data and select Type as our Northwind Customer Table. We click on Pick from flow data link and pick selectedCustomer output from Dynamic Data Grid control. Click Ok to save and continue.

 

2017-01-09_142906

 

This completes our Sub Dialog Data Flow. We can save the Flow and close Flow Designer.

 

2017-01-09_143025

 

Next, we are going to build a simple Flow with a Form to demonstrate how to use Sub Dialog Data Flow.

In the Designer Folder we click Create Flow on the Folder Actions Panel.

createMainFlow

 

Then, we Name the Flow and click Create to proceed to the Flow Designer.

 

2017-01-09_143211

 

Our Main Flow will only have a Form.

In the Flow Designer we add Show Form Step from Favorite Steps category.

 

2017-01-09_143312

 

Then, we Name the Form and click Create to proceed to the Form Designer.

 

2017-01-09_143410

 

In the Form Designer we add Label and TextBox (for user input). Then, from Sub Dialog Data category, we add Sub Data Flow Button. This control allows to run Sub Dialog Data Flows.

 

2017-01-09_143959

 

Next, we are going to configure our Sub Data Flow Button control.  First, we provide Text to be displayed on the Button control (Pick Customer).

Then, using Flow ID picker we pick a Sub Dialog Flow that we created previously in this tutorial.

 

2017-01-09_144116

 

After we pick our Flow, we need to Edit Flow Inputs because our Sub Dialog Data Flow has Country Flow Input Data.

 

2017-01-09_144302

 

In the Edit Flow Inputs window we pick Form Component InputType, and Country Text Box from FormDataName drop-down. Click Ok to save and close this window.

 

2017-01-09_144458

 

Next, we are going to use Label components to display information that our Sub Dialog Data Flow returns to us. We pick Label component, then check Text from Data Name check-box in Common Properties. In Data Name we click pick from data link. Then, we expand Flow: selectedCustomer output and pick desirable property (ContactName).

 

2017-01-09_144751

 

In similar manner, using Label components we display other fields from selectedCustomer Sub Dialog Data Flow output. This completes our Form design. We can Save Form and close Form Designer.

 

2017-01-09_145234

 

Back in the Flow Designer we connect Done outcome from our Form Step to the End Step in the Flow. This completes our Flow. We can click Debug Flow on the top panel of the Flow Designer to test our Flow.

 

2017-01-09_145422

 

Our Form opens in the Debugger. We enter Country in the Text Box (USA) and click Pick Customer.

 

2017-01-09_150658

 

Our Sub Dialog Flow triggers and opens a Form in a new sub-dialog window. It displays all Customers from USA based on our input on the Main Form. We pick a Customer and click Done.

 

2017-01-09_150800

 

Our Sub Dialog Form closes and Labels on the Main Form are updated with the Customer information that we picked in the Sub Dialog.

 

2017-01-09_150926

 

Then, we can input different Country (Mexico) and click Pick Customer again. Sub Dialog Form opens with all customers listed in Mexico. We pick one and click Done.

 

2017-01-09_151014

 

Sub Dialog closes and Labels on the Main Form are updated with the picked in Sub Dialog Customer information. We click Done.

 

2017-01-09_151108

 

Our Flow executes to the End Step with no issues.

 

2017-01-09_151155

Additional Resources