[rules-users] RE: Rules with Lookup Tables...

Steven Williams stevearoonie at gmail.com
Thu Mar 8 17:38:15 EST 2007


Hi James,

The from keyword doesn't assert the list returned from
lookupDAO.getLookupValues - it asserts each value. So I think you want:

rule ...
when
   // getting the codes from the table
  $shCode : String() from lookupDAO.getLookupValues("MILT.CUSTNO" )

   // matching the objects if the code
   $gateIN : RKEM_Move( CUSTOMER_REFERENCE_NUMBER matches "^HX.*",
                                          ACTIVITY_LOCATION matches "^US.*",
                                          SH_CODE == $shCode )
then
  // do something
end

cheers
Steve

On 3/9/07, jdepaul <jjdepaul at us.ibm.com> wrote:
>
>
> Let me clarify my intentions:  the lookupDAO.getLookupValues(..) returns
> an
> ArrayList of String values.  I need to make sure that SH_CODES attribute
> (String) of the RKEM_MOVE object  exists in that list of Strings.  Having
> trouble with this syntax:
>
>         when
>             // Get a list of Strings in ArrayList form from the DB table
>         $lookupList : List() from lookupDAO.getLookupValues( "MILT.CUSTNO"
> )
>
>                 // Now do the comparison...
>                 RKEM_Move (CUSTOMER_REFERENCE_NUMBER matches "^HX.*",
>                                         ACTIVITY_LOCATION matches "^US.*",
>                                         $lookupList contains SH_CODE) //
> <-- if SH_CODE exists in the
> $lookupList from DAO...
>         then...
>            System.out.println("Found a Match Rule - about to inovke
> Service...");
>
> end
>
>
> Please help -
>
> James
>
>
> Edson Tirelli-3 wrote:
> >
> >   I'm not sure I understood what you are trying to do
>
> --
> View this message in context:
> http://www.nabble.com/Rules-with-Lookup-Tables...-tf3329159.html#a9374192
> 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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw at objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070309/29cdcafe/attachment.html 


More information about the rules-users mailing list