[rules-users] Need Help

Wolfgang Laun wolfgang.laun at gmail.com
Wed Mar 25 05:19:10 EDT 2009


Your question shows that you have misunderstood the Concept of Rule, or that
you have tricked yourself into thinking that *all* action in a rules file
must be
structured in rules.

If, as a consequence of rule 1 you need to execute the consequence of some
other rule, you might write that as a function or Java method and call it
from
both rules.

Also, reconsider the if statement in the then part of your 1st rule. Isn't
it
possible to add this condition to the left hand side? Or, considering the
conditions that ought to trigger the consequence of your second rule,
isn't it possible to write them all in that rule's left hand side?

Anyway, rules are not methods or procedures, and "navigating between
rules" is not something you should envisage as a paradigm while using
rules. (There are mechanisms controlling the firing of rules, such as
salience or agenda groups, but I don't think that this is what you need
in the posted scenario.)

-W


2009/3/25 yash kapoor <yash.rocksolid at gmail.com>

> Hi All,          How can I navigate among rules like   call from rule 1 to
> rule 2
>
> rule "Memory reader_{row.rowNumber}"
>
> when
>      memory:BenchMarkRulesModel()
>  then
>
>  if(@{workload}==memory.getWorkload())
>
>          //something
>
>          else
>
>                      jump to rule Memory writer_{row.rowNumber}
>
>
> end
>
>
> rule  "Memory writer_{row.rowNumber}"
>
>        when
>
>        then
>
> end
>
>
>
> _______________________________________________
> 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/20090325/5db245ba/attachment.html 


More information about the rules-users mailing list