We have a scenario to be implemented in Decision Table to exit from executing the remaining rules if certain rule successfully executes the action part of the rule. Suppose I have 50 rules and 5th rule is something which says insurance claim is invalid then we set claim as invalid to the object, then there is no need to execute remaining rules. How could this can be achieved. Please suggest
0
votes
1 Answers
0
votes
You can
- retract the fact under evaluation, after setting
invalidto true, on that rule's RHS, - throw an exception (ugly, ugly),
- run the session using
fireUntilHaltand call methodhalton the session on that rule's RHS - here you'll need a very low salience rule (added in a .drl file) to callhaltin case the fact passes all decision table rules.