[rules-users] Binding a variable with an OR pattern

Wolfgang Laun wolfgang.laun at gmail.com
Tue Aug 13 12:17:49 EDT 2013


On 13/08/2013, Joe Ammann <joe at pyx.ch> wrote:
> On 08/13/2013 04:31 PM, Wolfgang Laun wrote:
>> Sorry, I missed that.
>>
>> rule "R7012: UpdateInstrumentsIssuerFrom700[01]"
>> agenda-group "TRANSFER_TO_LIVE"
>> salience 100
>> when
>>      sirole : SourcingInstitutionRole(sourcing_Status ==
>> SourcingStatus.IMPORTED,
>>                                       $rcd: roleCd == "7000"  || ==
>> "7001")
>>     not SourcingInstitutionRole(sourcing_Status ==
>> SourcingStatus.IMPORTED,
>>                                       roleCd == "7001" && > $rcd )
>>
> Works nicely! Just to make sure that I correctly understood it:
>
> The "roleCd == "7001" && > $rcd" part of the last pattern could also be
> written as "roleCd == "7001" && != $rcd". That && > is just to make sure
> the last pattern matches for the 7000 fact if there is a corresponding
> 7001 fact.

!= and > having the same result, as we're down to two. A
generalization to N > 2 wouldn't be so easy, though.

-W


>
> Thanks again!
>
> --
> CU, Joe
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list