[rules-users] All the values from one list must be present in other

Wolfgang Laun wolfgang.laun at gmail.com
Mon Aug 20 06:31:37 EDT 2012


See below.

On 20/08/2012, Suvek <suvek.shah at gmail.com> wrote:
> I tried looking for similar posts but could not find any that fits the
> requirements.
> Really speaking this is a 2 part question.
>
> What I need to do is compare 2 lists and ensure that all the fields inside
> the reference list are present in passed in list.
>
> following is the simplified version of test that I want to perform...
>
> $requiredAddressTypes : List() from [ AddressType.BUSINESS,
> AddressType.FOREIGN_BUSINESS ]
> $taxpayer : Taxpayer(taxpayerType == TaxpayerType.FOREIGN_BUISINESS &&
> addresses.size > 0,
>         			$addresses : addresses)
>
> 1 - Based on the taxpayer type I need to ensure that ALL the
> requiredAddressTypes must be present, how can I achieve this?

How does AddressType relate to addresses? Are all addresses of
different types or not?


>
> 2 - is the this statement correct ? ($requiredAddressTypes : List() from [
> AddressType.BUSINESS, AddressType.FOREIGN_BUSINESS ])

No, it violates the DRL syntax. See the Drools Expert Manual for
examples of how to use "from".

But I don't think you'll need "from", unless you have oversimplified.

-W

>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/All-the-values-from-one-list-must-be-present-in-other-tp4019276.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> 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