Orchid,
I have interpreted your intention of preserving the outcome of rule1 and
rule2 for use in another rule (rule3) as what is technically known as "truth
maintenance". This is not necessarily (as Edson has put it) "not a good
thing". But, be careful with respect to the way you preserve this result and
relate it to the set of facts that produce the truth values for rule1 and
rule2.
-W
2010/1/31 Edson Tirelli <ed.tirelli(a)gmail.com>
Usually, trying to artificially control or detect the rules execution
to use as part of other "business rules" is not a good thing. In my opinion,
I think you should step back and give a new look at the problem. What is
your requirement? Rules (in forward chaining systems) react to the working
memory state, and when the state is detected, they fire new actions that
will usually change the state, possibly (re)activating new rules, and so on.
My advice to you is to try to rewrite your rules (1, 2, 3 or as many as
you need) based on the state of the working memory. There are several
reasons for the paradigm to work like that, but just as one example, if in
the future you have a new rule X that causes a change of state similar to
rules 1 and 2, your rule 3 will continue to work just fine, since it is
based on state and not "hard coded" as dependent of other rules.
This is obviously a general recommendation. We would need more details
about what kind of rules you are trying to model in order to better help
you.
Edson
2010/1/31 orchid <maya.pollack(a)gmail.com>
> Hi All,
> I have "rule1" and "rule2", very simple rules. I would like in
"rule3" to
> check one of the following:
> "rule1" AND "rule2" (i.e. if both rule1 and rule2 were fired)
> "rule1" OR "rule2" (rule1 or rule2 was fired)
>
> How can I achieve this? Does the "extends" keyword might help here?
>
> I achieved that buy defining a list, to which rule1 and rule2 in the RHS
> inserted some value. In rule3 I checked the values of that list. I would
> like to ask if there are some prettier solutions.
>
> Thanks in advance.
> Any help would be appreciated.
> --
> View this message in context:
>
http://n3.nabble.com/Checking-in-one-rule-the-result-of-another-rule-tp17...
> Sent from the Drools - User mailing list archive at
Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @
www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users