Your description of what you think you have to do does not agree with much
of the code you show.
- The rule name says that is depends on A.name == "bob", which isn't in the
condition.
- The RHS setA( $a.getName() ) is obviusly in error because B.a is an A, not
a String.
- Why should B be modified, if the change only concerns A.name.
It is sufficient to change A.name. All Bs referencing that one A will
continue to reference the modfied A.
-W
2010/6/10 Fnu Mahalakshmi <FMahalakshmi(a)nyx.com>
Hi,
I have a list of items which I want to modify if condition turns true. I
tried forall but its not working::
A{
String Name
}
B{
A a,
}
Rule “ modify B if A name = ‘bob’”
*when*
*forall*($a : A()
$b : B( a == $a)
)
*then*
modify($b){
seta($a.getName())};
I have many B objects pointing to same A object and when name of A is
modified I want the rule to fire and all B to also be modified.
What is wrong above???
I tried this too:
*when*
*forall*($a : A()
B( a == $a)
)
*then*
modify($b){ // but then I cannot do this step.which is
required
seta($a.getName())};
Any Idea???
Thank you
M
------------------------------
*Please consider the environment before printing this email.*
*Visit our website at
http://www.nyse.com
*****************************************************************************
Note: The information contained in this message and any attachment to it is
privileged, confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by replying to
the message, and please delete it from your system. Thank you. NYSE
Euronext. *
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users