[rules-dev] Can drools comtinue testing even if one of the conditions fail ?

David Sinclair dsinclair at chariotsolutions.com
Fri May 1 11:29:29 EDT 2009


The short and sweet answer is no.

On Mon, Aug 11, 2008 at 7:22 AM, DroolUser <jyotu.p at gmail.com> wrote:

>
> Hi,
> I'm using drools for testing if the few attributes of my MO are not null.
>
> I construct the rule in the .drl file in following way :
>
> rule "name"
> when
>        condition1
>        condition2
>        condition3
>        condition4
> then
>        consequence
> end
>
> I have observed that the drool engine verifies the conditions line by line
> (in the sequence they have written). The moment condition fails, control
> comes back to the calling method.
>
> I don't want this. I want the control to execute each and every condition
> whether true or false and maintain a record of passed/failed conditions.
> Something like this  :
> rule "name"
> when
>        condition1
>                log the test result  --- This statement should get executed
> even if condition 1 fails and      control should go to condition 2
>        condition2
>                log the test result
>        condition3
>                log the test result
>        condition4
>                log the test result
> then
>        consequence
> end
>
> Is this possible in Drools ?
>
> --
> View this message in context:
> http://www.nabble.com/Can-drools-comtinue-testing-even-if-one-of-the-conditions-fail---tp18923764p18923764.html
> Sent from the drools - dev mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20090501/71675dca/attachment.html 


More information about the rules-dev mailing list