I'd assume you need two rules:-
rule test123a
when
$c : Cheese()
$ct : CheeseType(cheese = $c)
then
$ct.setPrice("cheap");
update($ct);
end
rule test123b
when
$c : Cheese( type = "myType" )
CheeseType(cheese = $c, price = "cheap" )
then
...
end
Java dialect doesn't support object graphs - I think MVEL does but I'm
unfamilair with the syntax.
You could also replace the two patterns (one for Cheese and the other
CheeseType) with an eval but you'll loose performance.
Forgive me if I'm wrong and this is 3.0.x and not 4.0.x.
With kind regards,
Mike
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of
Tim.Nguyen(a)expeditors.com
Sent: 12 September 2007 22:11
To: rules-users(a)lists.jboss.org
Subject: [rules-users] java void in LHS
Hi all,
I would like to insert a java void to my condition(LHS). Is there anyway
to
do that? Like an example below, how can I set something to my object
before
evaluate it.
rule test123
when
cheese: Chesse()
--->>> chess.getType().setPrice("cheap");
eval (chesse.getType () == "myType")
then
.....
end
Thanks,
Tim
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users