Processing Collections With Decision Tables - Gnorion/BizVR GitHub Wiki
Processing Collections With Decision Tables
- In traditional programming languages you process the elements of a collection using some sort of looping construct.
- In BizVR Decision Tables you don't need to construct loops.
- Suppose you want to apply the rules in a decision table to every person in a collection named PERSONS. You just enter an expression like this
{p in PERSONS}
- This defines a context in which the decision table rules can be applied
- Then each rule that references p will be applied to every p in the collection.
- Example 0 The DT sees just one instance of person and no looping occurs
- Example 1 The DT sees every person in the collection of PERSONS
- Example 2 The DT only sees those PERSONS with age < 21 (if there are any). It does nothing with persons >=21. Though we could create a separate DT to handle that case.
- Example 3 The DT sees two different subsets of PERSONS and has rules for dealing with both. This requires that BOTH subsets be non-empty
- Example 4 The DT sees two subsets either of which could be empty
- Example 2 every person over 65
- Example 3 every person over 65 with different rules for males and females
What about multiple collections