Designer:Data composer

From FlexRule Wiki
Revision as of 02:25, 23 June 2015 by Arash (talk | contribs) (Adding New Object)
Jump to: navigation, search

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.

Introduction

When a project rule project is loaded, just simply go to the tools menu and select "Data Composer" like picture bellow.

Datacomposer-menu.png

Then the Data Composer form will appear.

Dc.png

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.

Dc-toolbar-load.png This button allows you to browse for a previously saved data (using Data Composer) and reload it for use or modification.

Dc-toolbar-clear.png Clears list of added objects

Dc-toolbar-add.png Allows adding a new object of specific type

Dc-toolbar-add-collection.png Allows adding collections:

  • Empty collection of object (System.Object)
  • Empty collection of dynamic object that its elements can be manipulated with Data Composer

Dc-toolbar-add-duplicate.png Creates a duplicate of selected object in the list

Dc-toolbar-add-delete.png Deletes a selected object from the list

Dc-toolbar-add-up.png Changing order of objects in the list, moving up.

Dc-toolbar-add-down.png Changing order of objects in the list, moving down.

Dc-toolbar-add-save.png Saves the prepared data for a file that can be used later on.

Adding New Object

To add a new object, you can simply click on Dc-toolbar-add.png and an empty item will be added to the list.

Dc-AddObject.png

Simple Types

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:

  1. System.String
  2. System.Int
  3. System.Double
  4. System.Long
  5. System.Boolean

When for example you enter 'System.String' in the 'type' field, then you can extend the 'Value' node like the bellow picture:

Dc-AddObject-SimpleValue.png

Complex Types

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:

Dc-AddObject-fill.png

Then you can simply expand the "Value" node and you see an empty type is created for you to add the properties values:

Dc-AddObject-Value.png

Adding new Collection of Objects