- 03 Dec 2021
- 1 Minute to read
- Print
- DarkLight
Using a Flow to Create Dynamic Objects at Runtime
- Updated on 03 Dec 2021
- 1 Minute to read
- Print
- DarkLight
Overview
Example Lab Details | |
Version | 7.8.0.6420 |
Root Folder | DynamicObjectCreation |
Modules | None |
Dependencies | Five: BuildXMLString [Flow], History Folder of Main Process Folder, Adjust Data Flow [Flow], Object [System], FetchRandomDynamicData [Flow] |
This Example Lab demonstrates how to create Dynamic Objects at Runtime through the use of a Flow.
Explanation
The following example utilizes a three Sub Flow system to dynamically create Decisions Objects at Runtime that can be then Serialized into an XML String. These serialized Objects can then be used by a third-party application for additional functionality.
The Flow achieves this by utilizing a Create Data step to create an Object List (DynamicListBuilder); this serves as the Object generated by the Flow.
The Flow then generates a Random Integer to determine which List of Employee information (Person, Document, and Employee data) is Fetched. The data for this Object is then iterated through a ForEach Step loop that assigns a Random First Name for each Object (via Adjust Data Flow).
Lastly, the DynamicListBuilder data is sent through a ForEach Step loop that casts the Object data to their respective Data Types, each one of which is sent to a separate XML Serialize step to convert them into XML values. These values are cleaned up through the use of Replace Text steps for final use with the Close String Builder steps; these steps are used to compile the XML values into a single String for final Output.