[rules-users] RE: RE: Struggling with Rule syntax - please help...

jdepaul jjdepaul at us.ibm.com
Fri Mar 23 09:54:38 EDT 2007


Good to hear - YES, I want to use Edson's first example where he uses
List.contains() - his example, however, used just ONE list object and I need
to declare and refer to MULTIPLE list objects asserted into working memory. 
COuld you show syntax for multiple list object definitions?  

THanks in advance,
james


Anstis, Michael (M.) wrote:
> 
> 
> Edson's example you refer to used a List.contains() within a "return
> value operator" (example 3.13 in the 3.0.5 docs):-
> 
> [Edson's example]
> 
> rule "retrieving the list"
> when  
>     Customer( $custCode : customer_code )
> then
>     List codes = lookupDAO.getLookup( $custCode );
>     assert( codes );
> end
> 
> rule "doing something"
> when
>     Customer( $custCode : customer_code )
> <-- Bound column
>     $list : List()
> <-- Bound column (to a List() fact which must implement List)
>     SHIPMENT_MOVE(
> 	customer_code == $custCode,
> <-- Field constraint
> 	$sc : ship_code,
> <-- Bound column
>       $dc : deliver_code,
> <-- Bound column 
> 	$pc : port_code,
> <-- Bound column
>       ( $list.containts($sc) || $list.containts($dc) ||
> $list.containts($pc) )	<-- Return value operator
>     ) 
> then
>     // do something
> End
> 
> 

-- 
View this message in context: http://www.nabble.com/Struggling-with-Rule-syntax---please-help...-tf3408727.html#a9635322
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list