Hi,
Thanks for the prompt response.
I just broke the information into 2 separate rules and it works great.
In 1 I modified it to check if the value of B is modified then that A value is modified
In the 2 rule I checked if A is modified then all the Bs referencing A is modified.
Removed the forAll completely.
Thanks for the help :)
-M
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of rules-users-request(a)lists.jboss.org
Sent: Thursday, June 10, 2010 4:48 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 58
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Error using forAll() in rules (Fnu Mahalakshmi)
2. Re: Error using forAll() in rules (Wolfgang Laun)
----------------------------------------------------------------------
Message: 1
Date: Thu, 10 Jun 2010 16:16:47 -0400
From: Fnu Mahalakshmi <FMahalakshmi(a)nyx.com>
Subject: [rules-users] Error using forAll() in rules
To: "'rules-users(a)lists.jboss.org'" <rules-users(a)lists.jboss.org>
Message-ID:
<994758E35590274E955FA75763C5AA5002D010C6(a)MTEXMBXP01.ad.NYX.com>
Content-Type: text/plain; charset="us-ascii"
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
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before
printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a
href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
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.
</STRONG></P><pre>