In this tutorial, we want to find the common cars in a two groups of a car list Model and Make of cars.
We expect to receive the bellow list:
- Ford Pickup
- Ford T
- Ford Taurus
- Hyundai Santa Fe
Input and Output
In an IRD we can define as many as inputs and outputs as required. Then we connect different data sources to inputs and the network/graph of operators navigate them to the output results.
In this example, we are going to have one input (list of cars) and two outputs (command and all unique cars).
There are many different data operators pre-built into IRD. i.e. Group, Filter, Select, Minus, Union, Intersect… They can be used as many as required. All operators must be connected to a source of information.
For the first step of this task we need to group the cars into two by “Group” value. So let’s select Group operator from toolbox and add it to our model:
There are two types of associations between any node in an IRD:
Which they pass data/information to the next nodes either as it is or further process them before passing. As mentioned, all operator nodes, must have a source. If the source of a node comes from another node, it is an Information association. Otherwise it is a Knowledge association. Knowledge allows the result of a node (operator) is passed to other nodes as an known information which you will see in the next section.
In IRD you can have as many as operators that you need to navigate to the output nodes. In this example, the result of the group, has two list based on “Group” value. Let’s select ‘Make’ and ‘Model’ from each:
Select node requires list of properties to select them, That is in the "Parameters" part of properties window. Once you added the select nodes, in properties window you see parameters:
Then add two following parameters value:
And you will have the below:
Once you press "OK" button. The properties window will be refreshed:
You need to repeat this for both Select nodes.
Now for common cars, we just need to find the commonalities each each select, so we use Intersect operator and connect each select node to that, which them becomes the answer to common cars.
This is part of a more complete sample called "Collections" when you install FlexRule Designer. Once you open the Collections project, then open a document called Cars-IRD.xml. You can then use the prepared logic run template to feed sample data to model and see it in action.
Once execution is finished, you will see below results using data viewer:
In the next couple of articles we will cover different aspect of modelling and executing the IRD.
- Information Requirement Diagram
- Common cars tutorial