[rules-users] More than one agenda group for a rule?

Bagwell, Allen F afbagwe at sandia.gov
Tue Sep 2 15:52:23 EDT 2008


That's a great idea, Greg. Thanks for suggesting it. I think, however, I've figured out a solution for us that will work without multiple contexts or the idea of more than one agenda group to a rule.

I did end up writing my own class for a rule timer that ended up being FAR more flexible and powerful than the built-in RTworks concept of timers you could attach to rules.

Isn't OO and Java wonderful? :)

-A

-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Greg Barton
Sent: Tuesday, September 02, 2008 12:54 PM
To: Rules Users List
Subject: RE: [rules-users] More than one agenda group for a rule?

You could do the same thing by structuring your rules in a certain way.  Have an object of that defines the current context.  i.e.

class Context {
  String name;
}

The each rule matches on whether a given Context is asserted in working memory.

when
  exists Context(name == "foo")
  ...
then
...
end

This can be as flexible as you please:

when
  exists Context(name matches ".*startup.*")
  ...
then
...
end

--- On Tue, 9/2/08, Bagwell, Allen F <afbagwe at sandia.gov> wrote:

> From: Bagwell, Allen F <afbagwe at sandia.gov>
> Subject: RE: [rules-users] More than one agenda group for a rule?
> To: "Rules Users List" <rules-users at lists.jboss.org>
> Date: Tuesday, September 2, 2008, 1:20 PM Our rule engine software
> made by Talarian Corporation as part of their RTworks suite.
>
> The company was bought out by TIBCO several years ago, and the
> software is no longer supported. They essentially consigned it to the
> dust bin. And with a massive upgrade to our system, we had to find a
> rule engine alternative.
>
> The old RTworks rule engine concept of an AgendaGroup was called a
> "Context". You could assign a rule to as many contexts as you wanted.
> You just listed their names, separated by semi-colons, following the
> context keyword.
>
> There are always trade-offs when switching, but Drools has many more
> features we could only wish were present in the old software.
>
> -A
>
> ________________________________
> From: rules-users-bounces at lists.jboss.org
> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Mark Proctor
> Sent: Wednesday, August 27, 2008 2:06 PM
> To: Rules Users List
> Subject: Re: [rules-users] More than one agenda group for a rule?
>
> Bagwell, Allen F wrote:
>
> That's not so welcome news. Our old rule engine software had this
> ability. We'll find a work-around, but is this being considered in a
> later update to Drools?  My thought is that rule should be like
> method: you really should only need to write it once.
>
>
> no plans to add this, especially as ruleflow is the preferred way to
> orchestration rules so that's where our focus is these days. Which is
> your old rule engine that supported this? I don't believe jess or
> clips allow a rule to live in multiple modules - which is what
> AgendaGroups is based on.
>
> Mark
>
> -A
>
>
> -----Original Message-----
> From:
> rules-users-bounces at lists.jboss.org<mailto:rules-users-bounces at lists.j
> boss.org> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of
> Mark Proctor
> Sent: Wednesday, August 27, 2008 12:07 PM
> To: Rules Users List
> Subject: Re: [rules-users] More than one agenda group for a rule?
>
> Bagwell, Allen F wrote:
>
>
> I was wondering (hoping) that there is a way to put a rule into more
> than one agenda group?
>
> I've tried writing:
>
> rule "example"
>    agenda-group "process x stuff"
>    agenda-group "process y stuff"
>    when
>         (blah, blah, blah)
>    then
>         (blah, blah, blah)
> end
>
> But while the compiler has no problems with this it really only
> includes the rule in the last agenda-group listed.
>
>
> nope, not possible.
>
>
> Thanks,
> Allen
>
>
>
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users



_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users






More information about the rules-users mailing list