-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Wondering about the distinction between a Rule and a Condition .. and whether there's really any need to have these two distinct types?
Let me explain.
So, RulePilot distinguishes between the following things ...
Rule- a collection of conditions (with an optionaldefaultresult)Condition- a boolean operator (any|all|none) operating on one or more conditions or constraints (with optionalresult)Constraint- a data test expression checking ifoperator(field, value)is true or false
A rule can have one or more "conditions":
// a single condition rule
const rule1: Rule = {
conditions: { ... },
};
// another single condition rule
const rule2: Rule = {
conditions: [{ ... }],
};
// a rule with two conditions
const rule3: Rule = {
conditions: [{ ... }, { ... }],
};
// a rule with two conditions and a default result
const rule4: Rule = {
conditions: [{ ... }, { ... }],
default: "DEFAULT",
};What's not immediately clear is why you need to distinguish between a Rule and a Condition at all.
A rule with two conditions seems equivalent to an any condition with the same two original conditions in its array.
Can you clarify what motivated the distinction?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels