I have some reservations w.r.t. the proposed solution. One has to assume that "Rule 2" is there (and should continue to be so) to fire when its condition is true, irrespective of what goes on due to "Rule 1". The only way to do this is by writing
InsertedFact()
or
condition-of-rule2()
and this would make any bindings in condition-of-rule2() unusable in the rule's consequence.
If by "firing" is meant that the RHS of Rule 2 is to be executed, simply add the statements of the consequence to the ones of Rule 1. (Wrapping it in a function avoids code duplication.)
-W
Insert a new fact that causes Rule 2 to fire. That way you can decouple your logic and gain more flexibility to add more rules based on this new fact.2009/12/4 Deepak Jambhekar <deepak.jambhekar@tcs.com>
_______________________________________________Hi...In one of my requirments I need to fire a rule from another rule... i.e.whenrule "Rule 1"when
condition()
then
someaction()
then it should fire another rule Rule2
end
rule "Rule 2"
when
condition()
then
someaction()
end
Can we achieve this in Guvnor??please help....Thanks
Deepak Prabhakar Jambhekar=====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users