An exit from rule execution is possible by throwing an exception. You
may catch this in a try/catch surrounding the fireAllRules call.
Another way would be to call
drools.stop()
on the RHS and start rule processing with fireUntilHalt(), and in this
case you will also have to provide a low-priority rule
rule TheEnd
salience (Integer.MIN_VALUE)
when
then
drools.stop();
end
-W
2011/2/16 Sathya Prakash <[email protected]>:
> Hi,
> How to stop rule execution in technical rule,
> Example
> rule "Error Check"
> salience 100
>
> when
> error condition check
> then
> System.Out.Println("Response has errors");
> XXXXXXXXXXXXXXXXXXXXXXXX to exit from rule execution
> end
>
> rule "Rule-01"
> salience 99
> when
> repsonse.getxx()
> then
> end.
> if first rule then part executed means the response is error hence we should
> not execute second.
> Is there any way to exit rule execution.
>
> Regards,
> Sathya Prakash.
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users