Something like this?
rule "Codes1"
when
then
Codes1List codes1 = lookupDAO.getLookup( CODES_1 ); <--
Codes1List is a subclass of List
assert( codes1 );
end
rule "Codes2"
when
then
Codes2List codes2 = lookupDAO.getLookup( CODES_2 ); <--
Codes2List is a subclass of List
assert( codes2 );
End
rule "Codes3"
when
then
Codes3List codes3 = lookupDAO.getLookup( CODES_3 ); <--
Codes3List is a subclass of List
assert( codes3 );
End
rule "doing something"
when
Customer( $custCode : customer_code )
$codes1 : Codes1List()
$codes2 : Codes2List()
$codes3 : Codes3List()
SHIPMENT_MOVE(
customer_code == $custCode,
$sc : ship_code,
$dc : deliver_code,
$pc : port_code,
( $codes1.containts($sc) || $codes2.containts($dc) ||
$codes3.containts($pc) )
)
then
// do something
End
Otherwise you'll need to explain your model to me and what you're trying
to achieve a little more.
Thanks,
Mike
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of jdepaul
Sent: 23 March 2007 13:55
To: rules-users(a)lists.jboss.org
Subject: [rules-users] RE: RE: Struggling with Rule syntax - please
help...
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...-tf340
8727.html#a9635322
Sent from the drools - user mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users