Alternate Access Patterns For User Defined Data Types

Last Updated: 07/26/2016 Introduced in Verision: 2.0

This tutorial demonstrates how to use Alternate Access Pattern for User Defined Data Types.

Note: Alternate Access Pattern can be used only if User Defined Data Type is Database Stored.

Alternate Access Pattern is basically a query that has input fields defined at the time of Access Pattern creation. After Access Pattern is created, System generates a step that can be used in the Flow. This step will require input data for the fields it is configured to query against. Finally, it has a list of query types that we can pick from depending on our needs.

 

Example:

In this example we will create a simple User Defined Structure, then we will create several entities of this defined type. Finally, we are going to create an Access Pattern for this Defined Structure and test it in the Flow.

We begin in the Designer Folder with clicking Datatypes/Database > User Defined Types > Defined Data Structure [Advanced] on the Folder Actions Panel.

createDefinedDataType

In the resulting Add Defined Data Structure window we Name our Structure. Then, we pick Database Stored Storage Type.

storrageOptionDB

Next, we Add Data Members to our Structure.

addFields

When all Data Members added, we can click Ok to save our Defined Structure.

fieldsAdded

Our Designer Folder System generates a Defined Structure instance and Configuration Extension for the Defined Structure. We navigate to the Configuration Extension Folder for our Defined Data Structure.

navigateToTheConfiguration

In the Configuration Extension Folder we click Add Access Pattern on the Folder Actions Panel.

addAccessPattern

In the resulting window we provide our Access with Name and select which fields do we want to query against (these fields will be an inputs to the generated step). Click Ok, when finished.

configureAccess

Then, we return back to the Designer Folder and click Create Flow on the Folder Action Panel.

createFlow

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

nameFlow

 

This Flow will serve to create new instances of Employee and store them in the Database. First, we add Show Form step from the Favorite Steps category.

addForm

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

nameForm

Our Form design is laid out to grab user’s inputs for each Data Member in our Defined Structure using Textboxes. When we finished designing our Form, we can save it and close Form Designer.

addEmployeeFormDesign

Next to our Form step in the Flow we add Create Employee step from Integrations > All Integrations > Defined Data Structures > Employee category.

addCreateEmployee

Then, we add another Show Form step from the Favorite Steps category.

addSecondForm

Name the Form and click Create to proceed. This Form is designed as following… It informs user that Employee was added and has two Outcomes: Add another Employee or Done. When finished designing this Form, we save it and close Form Designer.

employeeAddedFormDesign

Back in the Flow Designer we connect steps in our Flow as on the following figure. Then, we select Create Employee step on the workspace to configure data inputs.

connectSteps

In the Step Information Layer we click Show Mapping Editor.

showMappingForCreateEmp

In the Mapping Editor we select Build Data Mapping type for Item To Create.

buildDataMappingType

Then, we connect outputs from the first Form to the corresponding fields in our Object. For the ID field in the Item we select Text Merge.Plain Mapping type and click Show Editor.

showTextEditorCreateEmp

In the Text Editor we simply drag First Name and Last Name to the editor workspace. Click Ok to save and continue.

textEditorIDCreateEmp

Then, for the Short Description we use Email Address from the first Form and for the Long Description we use Constant text. Save and close Mapping Editor.

mappingCreateEmpCompleted

This completes our Flow. We save it and close Flow Designer. Back in our Designer Folder we locate a thumbnail for our Flow, and Run Flow from thumbnail Action menu.

runFlow

With this Flow we add several Employees

addEmp

Next, we create another Flow, where we will use Additional Access to get Employee by Email Address. Click Create Flow button on the Folder Actions Panel.

createSecondFlow

In the resulting window we Name the Flow and click Create to proceed.

nameSecondFlow

 

In the Flow Designer we add Show Form step from the Favorite Steps category. This Form will serve for user interaction to grab the Email Address input.

addFirstForm

 

We Name the Form and click Create to proceed to the Form Designer.

createFirstForm

The Form design is simple. We use Textbox component from the Data category in the Toolbox for user input, and Button component from Actions category for an Outcome. When finished we save Form and close Form Designer.

firstFormDesgn

Back in the Flow Designer we add GetEmployeeByEmailAddress step from Integrations > All Integrations > Defined Data Structures > Employee category.

addGetEmployeeByEmail

On the Done outcome from GetEmployeeByEmailAddress we add another Show Form step.

addSecondFormDisplay

This Form will display the results of GetEmployeeByEmailAddress step. We add Button component for Outcome and Data Grid component from List category. Data Grid component configured as following… In the Input Data we provide Name and pick Type of Employee (our defined data structure). Then, save the Form and close Form Designer.

secondFormDisplayDesign

Next, we connect steps in our Flow and select GetEmployeeByEmailAddress step on the workspace to configure it.

connectStepsMain

For the EmailAddress Input we use Select Value Mapping type and pick EmailAddress output from the First Form.

mappingForAccessStep

Mention, that we can configure Query Type for this step. In this example we use Equals query type because we need to get employees with the provided email address.

queryType

Next, we select our second Form on the workspace and configure it in the following manner… For Employee Data Grid component we use Select Value Mapping type and pick Results from GetEmployeeByEmailAddress step.

mappingForDisplayForm

This completes our Flow configuration. We click Debug Flow link on the top panel of the Flow Designer to test our Flow.

Note that in Decisions version 3.5 and above, you’ll need to click Test Flow to access the Debugger.

3.5 Test Flow Shot

debugFlow

The First Form opens in the Debugger. We enter Email Address and click Show Employee button on the Form.

enterEmailAddress

Then, the second Form opens and our Employee is displayed on the Data Grid component. Click Done.

resultDebugged

Our Flow executes with no issues.

debuggedFlow

Additional Resources