no, that would not be a rule then, that would be procedural code.

But you can achieve what you want in a better loose coupled way.

Basically, you have 2 rules:

rule1:
when Something(....)
then assert(new ControlFact());

rule2:
when
 Something()
 c: ControlFact()
then
 ... do it here...
retract(c);

This assumes there is only one Something() in working memory, if not, you
will need to either repeat the conditions in the second rule, OR, wrap
Something() inside the "control fact" object which the second rule responds
to.

The "ControlFact" is a little object you create and name appropriately to
express your intent. This is a better design as there could in future be
more rules that can "fire" the second rule in effect, so there is no tight
coupling.



On 1/3/07, Nirmal.R <[EMAIL PROTECTED]> wrote:


Hi,

   Can i do the following

   > execute a particular (2nd)rule directly when an Object satisfies the
1st rule, is it possible?
   > If possible can pass the object from 1st rule to 2nd rule directly


thank you
Nirmal
--
View this message in context:
http://www.nabble.com/Executing-rules-from-another-rule-tf2912939.html#a8139134
Sent from the drools - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to