[rules-users] activation-group

Anstis, Michael (M.) manstis1 at ford.com
Thu Apr 26 06:45:17 EDT 2007


Do you have multiple Orders with a flowId == 1798?

What if you remove the activation-group (for testing) do multiple Orders
get processed (all be it, possibly, each one multiple times)?

If not it could point towards a problem with either the implementation
or understanding of activation-groups (from the manual):-

Rules that belong to the same named activation-group will only fire
exclusively. In other words, the first rule in an activation-group to
fire will cancel the other rules activations (stop them from firing).
The Activation group attribute is any string, as long as the string is
identical for all the rules you need to be in the one group.

Does this mean one rule in the activation group will fire for all
asserted facts or one in the group per asserted fact?

I've not used activation-groups so my questions aren't necessarily aimed
at you Joe.

-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Bynum, Joe
Sent: 25 April 2007 18:10
To: Rules Users List
Subject: RE: [rules-users] activation-group

I'm not making any changes to the orders at all if that's what you're
thinking.

[when]workflow in stage "{value}"=order : Order( stages contains
"{value}" )
[when]order is {value}=order: Order( id == {value} )
[when]flowid is {value}=order: Order( flowId == {value} )
[when]workflow in stage "{value}"=order: Order( stages contains
"{value}" );
[then]assign prov plan=OTISHelper.assignProvPlan(
order.getDocumentNumber(),  order.getProvPlanName() );
[then]complete task "{value}"=OTISHelper.completeProvPlanTask(
order.getDocumentNumber(),  "{value}", "JAVATEAM", "JWB_TEST" );
[when]workflow isnt in stage "{value}"=order: Order( stages excludes
"{value}" );
[when]has provplan=order : Order( provPlanName != "" )
[when]order type isnt "{value}"=order : Order( orderType != "{value}" ) 

-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Anstis,
Michael (M.)
Sent: Wednesday, April 25, 2007 10:06 AM
To: Rules Users List
Subject: RE: [rules-users] activation-group

Any chance you can post your DSL too?


-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Bynum, Joe
Sent: 25 April 2007 14:39
To: Rules Users List
Subject: RE: [rules-users] activation-group

Anyone have any idea what I'm doing wrong? 

-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Bynum, Joe
Sent: Monday, April 23, 2007 1:50 PM
To: Rules Users List
Subject: RE: [rules-users] activation-group

I've read the manual but as I stated below only the first order seems to
trigger a rule.  The other orders are completely ignored.  I would
expect one rule in the group to trigger for each order.

-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of JLL
Sent: Monday, April 23, 2007 11:38 AM
To: rules-users at lists.jboss.org
Subject: Re: [rules-users] activation-group


from documentation
3.5.3.5. activation-group

default value N/A

type : String

Rules that belong to the same named activation-group will only fire
exclusively. In other words, the first rule in an activation-group to
fire will cancel the other rules activations (stop them from firing).
The Activtion group attribute is any string, as long as the string is
identical for all the rules you need to be in the one group.

NOTE: this used to be called Xor group, but technically its not quite an
Xor, but you may hear people mention Xor group, just swap that term in
your mind with activation-group.


JLL

Bynum, Joe wrote:
> 
> All,
>  
> I'm trying to setup three rules to process orders as a test case.  The

> first two rules look for specific conditions and the third one is the 
> default rule.  I only want a single rule to fire for each order that I

> pass into the engine.  I gave all three rules the same
activation-group.
> The first two rules have a salience of 10 and the third rule has the 
> default salience value.  The problem that I'm experiencing is that 
> only one order is processed and the rest are skipped.
>  
> Here's a snippet from the rules file:
>  
> rule "837621 - Stage 5"
> 
>     activation-group "Harris"
> 
>     salience 10
> 
>     when
> 
>         flowid is 1798
> 
>         workflow in stage "5"
> 
>     then
> 
>         assign prov plan "Harris Gtwy-ChXchange-New Loop"
> 
>         complete task "FAC VER"
> 
> end
> 
> rule "828257 - New Order"
> 
>     activation-group "Harris"
> 
>     salience 10
> 
>     when
> 
>         flowid is 1798
> 
>         workflow in stage "1"
> 
>     then
> 
>         assign prov plan "Harris Gtwy-ChXchange-New Loop"
> 
> end
> 
> rule "1798 Default"
> 
>     activation-group "Harris"
> 
>     salience 0
> 
>     when
> 
>         flowid is 1798
> 
>     then
> 
>         assign prov plan "Harris Gtwy-ChXchange-New Loop"=
> 
> end
> 
> Any Ideas?
> 
>  
> 
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

--
View this message in context:
http://www.nabble.com/activation-group-tf3631850.html#a10142866
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
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

_______________________________________________
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

_______________________________________________
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