Tutorial: Rule elements
The first step in writing a rule is selecting which elements play a role in the when part, being the conditions that trigger the execution. The two types of elements that can be added to the conditions of a rule are:
A rule may contain more than one instance of the same type. Therefore, both entity and descriptor instances are written with an instance number. Constant values are written in bold orange.
Example app: Grocery store
In our example app we want to write two different rules:
Rule 1: Calculate shopping cart total price
For rule 1 we need to add two elements:
Rule 2: Calculate volume discount
And for rule 2 we need we must add two elements:
And we must add the constant values: