Tutorial: Rule conditions
After having added elements to a rule, the next step is to define conditions. Conditions determine when a rule is triggered for execution. Conditions come in three forms:
Association condition
Association conditions follow the same structure as statements: Subject (noun) relationship (verb) and object (noun). The only difference is that the sentence representing an association condition is written in singular and contains entity instances instead of entity types.
Attribution condition
Attribution conditions also follow the same structure as statements: Subject (noun) relationship (verb) and object (noun). Such conditions contain entity instances but only specify the type of attribute or descriptor that is attributed to it.
Equation condition
Equation conditions always follow the same structure:
The values that act as inputs (operands) of equations can be:
The following equation signs can be used: is equal to, is not equal to, is greater than, is greater than or equal to, is less than, and is less or equal to.
Example app: Grocery store
In our example app we want to write two different rules:
Rule 1: Calculate shopping cart total price
In order to implement rule 1, we need the following association condition to trigger the execution of this rule:
Rule 2: Calculate volume discount
For the realization of rule 2, we need the following association condition:
And rule 2 should be triggered by the following equation condition: