FlexRule Designer > Sample Data > Data Composer
Data composer is a utility in FlexRule Designer that allows you to create and prepare a sampling data visually for different purposes. For example either in debugging and testing you might need to prepare some data.
When a project rule project is loaded, just simply go to the tools menu and select "Data Composer" like picture bellow.
Then the Data Composer form will appear.
Data Composer allows you to create a collection (Array) of objects.
Data Composer Form
Its form contains to main section
- Data list (left side)
- Object information (right side)
When a new object is created it will be listed on the left side panel. And the details of object will be listed in the right panel.
- Empty collection of object (System.Object)
- Empty collection of dynamic object that its elements can be manipulated with Data Composer
Adding New Object
By filling the type value in the right screen, you can create some simple values e.g. string, integer... Here is the list of simple types:
When for example you enter 'System.String' in the 'type' field, then you can extend the 'Value' node like the bellow picture:
Complex types are the one that are not defined by default like simple types, and you need to provide an assembly (a .dll) and select a type from a list. A complex new object needs a type and assembly, enter the type information. Please note the assembly should be referenced in your project. If it is not, go to "Project->Properties" menu and then select "References" and add your assembly. It is a good practice to keep all the assemblies local to your project folder. Once the type and assemblies are added, you can see the following screen:
Then you can simply expand the "Value" node and you see an empty type is created for you to add the properties values:
Adding new Collection of Objects
- An empty generic list called Object List. This empty list cannot be modified at design time.
- A dynamic list that you can use Data composer to add more elements to it
If you select the Dynamic List and the select the item from left side panel, then you will see the bellow picture.
If you click on the button that the red arrow shows, then a new Data composer window will be launched. Now you can create the elements of the selected list from previous Data composer screen.
When you can construct your data using Data Composer, you can send the data to Watch Window to see exactly how does that look like.
By pressing the Watch button, the Watch window will appear and shows you the value of your object: