[rules-users] Problems with OR

Giovanni Motta mottagio at gmail.com
Sat Jun 19 04:58:38 EDT 2010


Edson, this is very similar to my post, but i guess you forgot the exists
(see my post), the requirement is for the rule to fire just one time! ;-)
Regards

2010/6/18 Edson Tirelli <tirelli at post.com>

>    There is a solution that is much simpler:
>
> when
>     TblVersichKlinik( ( versicherung != null && versicherung != " " )
> || (zusatzversicherung !=null && zusatzversicherung != " ") )
> then
> ...
> end
>
>    []s
>    Edson
>
> 2010/6/18 skasab2s <skasab2s at smail.inf.fh-brs.de>
>
>>
>> Hi guys,
>>
>> many thanks for your replies! Sorry, my solution was other:
>>
>> declare EnsuranceExists
>>        value: boolean
>> end
>>
>> // ------------ Initialisation Rule(s). ---------------
>> rule "Always insert initial $ensuranceExists" salience 100
>>        when
>>
>>        then
>>                EnsuranceExists $ensuranceExists = new EnsuranceExists();
>>                $ensuranceExists.setValue(false);
>>                insert($ensuranceExists);
>> end
>>
>>
>> rule "Check ensurance" salience 95
>>        when
>>                (( TblVersichKlinik(
>>                 versicherung != null, versicherung != " "))
>>                or
>>                (TblVersichKlinik(
>>                zusatzversicherung !=null, zusatzversicherung != " ")) )
>>                 $ensuranceExists : EnsuranceExists(value == false)
>>        then
>>                $EnsuranceExists.setValue(true);
>>                update($ensuranceExists);
>> end
>>
>> // End result
>> rule "All data is valid" salience 90
>>        when
>>            ...
>>            EnsuranceExists (value == true)
>>            ...
>>
>>        then
>> This way, the  rule "Check ensurance" can be fired many times, without
>> affecting the end result.
>>
>> Once again thanks for your advices anyway.
>>
>> Many regards,
>>
>> skasab2s.
>>
>>
>> --
>> View this message in context:
>> http://drools-java-rules-engine.46999.n3.nabble.com/Problems-with-OR-tp905689p905902.html
>> Sent from the Drools - User mailing list archive at Nabble.com.
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>  Edson Tirelli
>  JBoss Drools Core Development
>  JBoss by Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100619/7de62832/attachment.html 


More information about the rules-users mailing list