Using Custom Data as Flow InputLast Updated: 08/18/2016 Introduced in Verision: 2.0 |
Flows can be configured to use entities of any data type that are available including custom ones. To use an entity with a custom data type, check whether the required data type is available in the respective Designer Folder, or under the folder System > Designers > Data Structure (if not, create the data needed). Once this is done, the custom data type will be available for use in all flows.
Example
Our example flow will consist of a form that will expect an input entity of the custom data type UserInfo, which can then be modified and saved. We’ll begin by checking that our custom data type exists in our Designer Folder. We’ll find it in the list of entities in our Designer Folder.
Children, or child entities, are data structures which belong to the parent – in this case, UserInfo. These child entities have their own data types and rules. For example, DateOfBirth has the data type Date, which restricts its content to representations of a date on the calendar. Married has the type Boolean, which restricts is content to either true or false. By creating custom data types, we can aggregate simple entities with simple types into more complex structures, such as our UserInfo type.
Now that we know our type exists, we can use it in our custom data flow.
Click the Type selector to choose the custom data type . . .
. . . select UserInfo and click OK.
Back in the Edit Object pop-up, leave the Is List checkbox unchecked since our flow only needs to receive one at a time. Also leave the Can Be Null checkbox unchecked since our form isn’t designed to work without a UserInfo object to populate it.
Next, map the inputs for [Form] User Info Form. This form contains text boxes for capturing age, date of birth, and marriatal status. Rather than having these text boxes show up blank, the purpose of introducing the custom data on the Start step is so the form can display an existing user’s information in those respective fields as an example.
With the form selected in the workspace, click the Show Mapping Editor link in the Properties panel.
Next, we save the flow and run it in the Debugger.
Note that in Decisions version 3.5 and above, you will need to click Test Flow to access the Debugger.
Our first feedback from our debugger is a pop-up titled Flow Unit Tests. Our flow expects a valid input of the type UserInfo, so we’ll need to provide one. Click the Userinformation selector to update the empty UserInfo object with the details it requires.
Once we’ve supplied values for the child entities that comprise a UserInfo object, our input object is ready to be sent to our flow for testing. Also provide an Entity Name for this object.
When we run our debugger now, we see a form that’s populated with details of the UserInfo object we created. We’ve successfully used our custom data type in a flow.