[rules-users] java void in LHS
Anstis, Michael (M.)
manstis1 at ford.com
Thu Sep 13 03:46:05 EDT 2007
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 at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of
Tim.Nguyen at expeditors.com
Sent: 12 September 2007 22:11
To: rules-users at 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 at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
More information about the rules-users
mailing list