Give us feedback
rulesengine
Reactive icon

Rules Engine

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded on 1 May (2 weeks ago) by 
0.0
 (0 ratings)
rulesengine

Rules Engine

Documentation
1.0.1

Operators currently supported by this component

= equality operator

>= greater than or equal to

<= less than or equal to

<> NOT equal to

like This is used for string comparison and behavior is similar to 'contains'


For using this component

  1. Data representation should be well formatted JSON (One of the dependencies of this component is ardoJSON. You can utilize the same component for your data conversion/ representation. Alternatively, you can use any other JSON serializer, either one available out-of-box or another forge/ integration component available in your environment)

  2. Left operand of the equation (an attribute from the data JSON - use JSON path expression)

  3. The operator of choice as listed above in BOLD

  4. Right operand of the equation is the literal value to be evaluated against


For example

Given the following Data as JSON

{

  "title": "The Lord of the Rings: The Fellowship of the Ring",

  "ReleaseDate": "2001-12-19T00:00:00",

  "director": { "firstName": "Peter", "lastName": "Jackson" },

  "SCORE": 8.8,

  "actors": [ 

{ "name": "Elijah Wood", "plays": "Frodo Baggins"}, 

{ "name": "Sean Astin", "plays": "Samwise 'Sam' Gamgee"},

{ "name": "Sean Bean", "plays": "Boromir"},

{ "name": "Cate Blanchett", "plays": "Galadriel"},

{ "name": "Ian Holm", "plays": "Bilbo Baggins"}

  ],

  "keywords": [ "ring", "hobbit", "doom", "middle earth", "quest", "epic" , "bravery"]


}


Checks that can be performed using this component are

1. String contains check - title like Lord, actors[0].name like Wood, keywords[1] = hobbit

2. Number value check - SCORE >= 8.8, 

3. Date Check - ReleaseDate < 2001-12-21

4. You can also check the attributes inside of an array by providing the JSON path to the attribute and specifying the condition to evaluate

5. In additional, you can specify if all array elements should satisfy the given rule condition by setting the Exit on True flag to FALSE/ OFF. On the other hand, turning this flag to TRUE/ ON, the array check exits the array iterator on the first positive match for the given rule condition  

6. You can also perform aggregate checks for min, max, count, sum and average functions on a given (number type) array attribute. However, the aggregate functions are only available for evaluation on the server side only. For usage, check the demo page


Note: Rule persistence feature is implemented on the server side demo page i.e. if you need to create a rule repository and perform "Check All" then you need to create the rules using the server side demo page. Once defined on the server side, these rules are also made available for client side execution


1.0.0

Operators currently supported by this component

= equality operator

>= greater than or equal to

<= less than or equal to

<> NOT equal to

like This is used for string comparison and behavior is similar to 'contains'


For using this component

  1. Data representation should be well formatted JSON (One of the dependencies of this component is ardoJSON. You can utilize the same component for your data conversion/ representation. Alternatively, you can use any other JSON serializer, either one available out-of-box or another forge/ integration component available in your environment)

  2. Left operand of the equation (an attribute from the data JSON - use JSON path expression)

  3. The operator of choice as listed above in BOLD

  4. Right operand of the equation is the literal value to be evaluated against


For example

Given the following Data as JSON

{

  "title": "The Lord of the Rings: The Fellowship of the Ring",

  "ReleaseDate": "2001-12-19T00:00:00",

  "director": { "firstName": "Peter", "lastName": "Jackson" },

  "SCORE": 8.8,

  "actors": [ 

{ "name": "Elijah Wood", "plays": "Frodo Baggins"}, 

{ "name": "Sean Astin", "plays": "Samwise 'Sam' Gamgee"},

{ "name": "Sean Bean", "plays": "Boromir"},

{ "name": "Cate Blanchett", "plays": "Galadriel"},

{ "name": "Ian Holm", "plays": "Bilbo Baggins"}

  ],

  "keywords": [ "ring", "hobbit", "doom", "middle earth", "quest", "epic" , "bravery"]


}


Checks that can be performed using this component are

1. String contains check - title like Lord, actors[0].name like Wood, keywords[1] = hobbit

2. Number value check - SCORE >= 8.8, 

3. Date Check - ReleaseDate < 2001-12-21