Difference between revisions of "Designer:Data composer"

From FlexRule Wiki
Jump to: navigation, search
(Adding New Object)
m
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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.
+
{{Breadcrumb|[[Designer:Help|{{FRD}}]] > Sample Data > [[Designer:Data_composer|Data Composer]]}}
 +
 
 +
Data composer is a utility in {{FRD}} that allows you to create and prepare sampling data visually for different purposes. For example, either in debugging or testing you might need to prepare some data.
  
 
===Introduction===
 
===Introduction===
When a project rule project is loaded, just simply go to the tools menu and select "Data Composer" like picture bellow.
+
When a project rule project is loaded, simply go to the tools menu and select "Data Composer" as shown below.
  
 
[[File:datacomposer-menu.png]]
 
[[File:datacomposer-menu.png]]
Line 10: Line 12:
 
[[File:dc.png]]
 
[[File:dc.png]]
  
Data Composer allows you to create a collection (Array) of objects.  
+
Data Composer allows you to create a collection (Array) of objects.
 +
 
 +
With Data Composer you can
 +
* Prepare some data (Simple and complex)
 +
* Associated them with a [[Parameter]] name
 +
* Manage pre-defined data for different scenarios (i.e., Test, Debugging, etc.)
  
 
===Data Composer Form===
 
===Data Composer Form===
Its form contains to main section
+
Its form contains the main section
 
* Data list (left side)
 
* Data list (left side)
 
* Object information (right 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.
+
When a new object is created, it will be listed on the left-hand side panel. The details of the object will be listed in the right-hand side panel.
 
 
[[File: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.
 
  
[[File:dc-toolbar-clear.png]] Clears list of added objects
+
[[File:dc-toolbar-load.png]] This button allows you to browse for previously saved data (using Data Composer) and reload it for use or modification.
  
[[File:dc-toolbar-add.png]] Allows adding a new object of specific type
+
[[File:dc-toolbar-clear.png]] Clears the list of added objects
  
[[File:dc-toolbar-add-collection.png]] Allows adding collections:
+
[[File:dc-toolbar-add.png]] Allows adding a new object of a specific type
* Empty collection of object (System.Object)
 
* Empty collection of dynamic object that its elements can be manipulated with Data Composer
 
  
[[File:dc-toolbar-add-duplicate.png]] Creates a duplicate of selected object in the list
+
[[File:dc-toolbar-add-duplicate.png]] Creates a duplicate of the selected object in the list
  
 
[[File:dc-toolbar-add-delete.png]] Deletes a selected object from the list
 
[[File:dc-toolbar-add-delete.png]] Deletes a selected object from the list
  
[[File:dc-toolbar-add-up.png]] Changing order of objects in the list, moving up.
+
[[File:dc-toolbar-add-up.png]] Changing the order of objects in the list, moving up
  
[[File:dc-toolbar-add-down.png]] Changing order of objects in the list, moving down.
+
[[File:dc-toolbar-add-down.png]] Changing the order of objects in the list, moving down
  
 
[[File:dc-toolbar-add-save.png]] Saves the prepared data for a file that can be used later on.
 
[[File:dc-toolbar-add-save.png]] Saves the prepared data for a file that can be used later on.
 +
 +
[[File:dc-toolbar-watch.png]] Evaluates, loads, then shows the constructed objects to the Watch window
  
 
===Adding New Object===
 
===Adding New Object===
To add a new object, you can simply click on [[File:dc-toolbar-add.png]] and an empty item will be added to the list.
+
To add a new object, you can simply click [[File:dc-toolbar-add.png]] and an empty item will be added to the list.
 +
 
 
[[File:dc-AddObject.png]]
 
[[File:dc-AddObject.png]]
  
 
====Simple Types====
 
====Simple Types====
By filling the type value in the right screen, you can create some simple values e.g. string, integer...
+
By filling in the type value on the right screen, you can create some simple values (e.g., string, integer, etc.)
 
Here is the list of simple types:
 
Here is the list of simple types:
 
#System.String
 
#System.String
Line 51: Line 57:
 
#System.Long
 
#System.Long
 
#System.Boolean
 
#System.Boolean
 +
# etc...
  
When for example you enter 'System.String' in the 'type' field, then you can extend the 'Value' node like the bellow picture:
+
For example, when you enter 'System.String' in the 'type' field, then you can extend the 'Value' node as shown below:
  
 
[[File:dc-AddObject-SimpleValue.png]]
 
[[File:dc-AddObject-SimpleValue.png]]
  
 
====Complex Types====
 
====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.
+
Complex types are the ones 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.
+
A complex new object needs a type and assembly (enter the type information). Please note that the assembly should be referenced in your project. If it is not, go to the "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:
+
Once the type and assemblies are added, you will see the following screen:
  
 
[[File:dc-AddObject-fill.png]]
 
[[File: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:
+
Then you can simply expand the "Value" node. An empty type is then created for you to add the properties values:
  
 
[[File:dc-AddObject-Value.png]]
 
[[File:dc-AddObject-Value.png]]
 +
 +
====JSON====
 +
You can provide JSON values for the parameters.
 +
 +
[[file:Data Composer-JSONValues.png]]
 +
 +
Once that is added, then you can create your JSON using the editor:
 +
 +
[[file:Data Composer-JSONValues-text.png]]
  
 
===Adding new Collection of Objects===
 
===Adding new Collection of Objects===
 +
When you select [[File:dc-toolbar-add-collection.png]], there are two types of list available:
 +
# An empty generic list called Object List. This empty list cannot be modified at design time.
 +
# A dynamic list that you can use [[Designer:Data composer|Data composer]] to add more elements to it
 +
 +
If you select the Dynamic List and the select the item from left-hand side panel, then you will see the image shown below.
 +
 +
[[File:dc-AddObject-DynamicList.png]]
 +
 +
If you click on the button that the red arrow shows, then a new [[Designer:Data composer|Data composer]] window will be launched. Now you can create the elements of the selected list from the previous [[Designer:Data composer|Data composer]] screen.
 +
 +
===Watch Data===
 +
When you can construct your data using Data Composer, you can send the data to a Watch Window to see exactly how it looks.
 +
 +
[[File:dc-WatchWindow-menu.png]]
 +
 +
By pressing the Watch button, the Watch window will appear and show you the value of your object:
 +
 +
[[File:dc-WatchWindow.png]]

Latest revision as of 09:11, 11 August 2017

FlexRule Designer > Sample Data > Data Composer


Data composer is a utility in FlexRule Designer that allows you to create and prepare sampling data visually for different purposes. For example, either in debugging or testing you might need to prepare some data.

Introduction

When a project rule project is loaded, simply go to the tools menu and select "Data Composer" as shown below.

Datacomposer-menu.png

Then the Data Composer form will appear.

Dc.png

Data Composer allows you to create a collection (Array) of objects.

With Data Composer you can

  • Prepare some data (Simple and complex)
  • Associated them with a Parameter name
  • Manage pre-defined data for different scenarios (i.e., Test, Debugging, etc.)

Data Composer Form

Its form contains the main section

  • Data list (left side)
  • Object information (right side)

When a new object is created, it will be listed on the left-hand side panel. The details of the object will be listed in the right-hand side panel.

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

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

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

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

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

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

Dc-toolbar-add-down.png Changing the 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.

Dc-toolbar-watch.png Evaluates, loads, then shows the constructed objects to the Watch window

Adding New Object

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

Dc-AddObject.png

Simple Types

By filling in the type value on the right screen, you can create some simple values (e.g., string, integer, etc.) Here is the list of simple types:

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

For example, when you enter 'System.String' in the 'type' field, then you can extend the 'Value' node as shown below:

Dc-AddObject-SimpleValue.png

Complex Types

Complex types are the ones 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 that the assembly should be referenced in your project. If it is not, go to the "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 will see the following screen:

Dc-AddObject-fill.png

Then you can simply expand the "Value" node. An empty type is then created for you to add the properties values:

Dc-AddObject-Value.png

JSON

You can provide JSON values for the parameters.

Data Composer-JSONValues.png

Once that is added, then you can create your JSON using the editor:

Data Composer-JSONValues-text.png

Adding new Collection of Objects

When you select Dc-toolbar-add-collection.png, there are two types of list available:

  1. An empty generic list called Object List. This empty list cannot be modified at design time.
  2. 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-hand side panel, then you will see the image shown below.

Dc-AddObject-DynamicList.png

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 the previous Data composer screen.

Watch Data

When you can construct your data using Data Composer, you can send the data to a Watch Window to see exactly how it looks.

Dc-WatchWindow-menu.png

By pressing the Watch button, the Watch window will appear and show you the value of your object:

Dc-WatchWindow.png