[rules-users] Using rules in agenda as a condition in a rule

Wolfgang Laun wolfgang.laun at gmail.com
Wed May 1 05:04:44 EDT 2013


You know that rule B hasn't fired and won't fire for a given set of facts
if you
return from fireAllRules() and there is no indication of it having fired.
Now, if
rule A would simply, on its RHS, insertLogical a fact ReadyToFireRuleA, and
you can query this from your Java code, you can execute the "real"
consequence of rule A as Java code. (There are other options.)

insertLogical needs to be called from the context of a rule.

Accessing the agenda isn't in the stable API. You'll have to inspect the
code.

-W


On 1 May 2013 10:17, oresch <olaf.resch at t-online.de> wrote:

> Thanks for your fast reply.
> @sequence: in my case this is not a problem, because rule (A) has another
> condition that will only become true if rule (B) has fired at least once.
> However, I only want to fire rule (A), if rule (b) will not fire anymore
> for
> a given set of facts.
> @use a fact: this might be another way. However, I still would like to know
> how I can access the agenda. Just to know it :).
> @truth-maintenance: this might be another way. However, I could not manage
> to session.insertlogically(obj) from my java code.
> BW, Olaf
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Using-rules-in-agenda-as-a-condition-in-a-rule-tp4023598p4023600.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130501/4b5ce76d/attachment.html 


More information about the rules-users mailing list