Flow isn't behaving as I'd expect

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Flow isn't behaving as I'd expect

Jamie
I'm having some issues with the interaction between Flow, ruleflow-groups and AgendaFilters.  I've tried it with 5.1.1, 5.2.0 using .rf files and 5.2.0 using .bpmn files, all with the same results, so I'm sure I'm just misunderstanding something.

I have a flow that looks like this:
Fraud Analysis Flow

Rules 011 and 051 are in ruleflow-group customerAnalysis and rule 018 is in ruleflow-group customerActivityFilterAndLookup. I added some debugging via event listeners and if I don't use an agenda filter, I see the following output:  

        Executing test Rule018TestCase001
        Rules engine initialized
        Invoking rules for rule name Rule 018 - Good AVS Buyer
        Created activation for [Rule 018 - Good AVS Buyer]
        Created activation for [Rule 011 - Bad Zip 9 Address]
        Created activation for [Rule 051 - Suspicious Buyer Email]
        Triggered node [Order Analysis]
        Triggered node [Start Fraud Analysis Flow]
        Triggered node [Customer Analysis]
        About to fire [Rule 051 - Suspicious Buyer Email]
        ====> Rule 051 fired for order: 000000022
        About to fire [Rule 011 - Bad Zip 9 Address]
        ====> Rule 011 fired for order: 000000022
        Triggered node [Customer Activity Filter And Lookup]
        About to fire [Rule 018 - Good AVS Buyer]
        Created activation for [Rule 051 - Suspicious Buyer Email]
        Created activation for [Rule 011 - Bad Zip 9 Address]
        ====> Rule 018 fired for order: 210105
        Triggered node [Customer Activity Analysis]
        Triggered node [Suspect Reason Code Review]
        Triggered node [End Fraud Analysis Flow]
        Rules executed successfully

The results are roughly what I'd expect, but I have some questions:

        - Why do the activations get created for these 3 rules before any flows have started?
        - Why does the [Order Analysis] node get triggered before the [Start Fraud Analysis Flow] node?
        - Why are activations created again for 011 and 051 just prior to 018 firing?
       
If I introduce an AgendaFilter that only allows a rule with a specific name to fire, things get stranger to me.  If I only allow rule 018, I get the following output:

        Executing test Rule018TestCase001
        Invoking rules for rule name Rule 018 - Good AVS Buyer
        Created activation for [Rule 018 - Good AVS Buyer]
        Created activation for [Rule 011 - Bad Zip 9 Address]
        Created activation for [Rule 051 - Suspicious Buyer Email]
        Triggered node [Order Analysis]
        Triggered node [Start Fraud Analysis Flow]
        Triggered node [Customer Analysis]
        Rejecting firing of [Rule 051 - Suspicious Buyer Email] because name doesn't match.
        Cancelled activation for [Rule 051 - Suspicious Buyer Email] because FILTER
        Rejecting firing of [Rule 011 - Bad Zip 9 Address] because name doesn't match.
        Cancelled activation for [Rule 011 - Bad Zip 9 Address] because FILTER
        Rules executed successfully

Ruleflow customerActivityFilterAndLookup doesn't even get triggered, nor do any nodes after that. Why not?
Reply | Threaded
Open this post in threaded view
|

Re: Flow isn't behaving as I'd expect

Jamie
Bump...

I really need some help with this issue - can anyone answer even some of my questions?  If my problem or my questions aren't clear, let me know and I'll try to clarify.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Flow isn't behaving as I'd expect

Tihomir Surdilovic
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Flow isn't behaving as I'd expect

Jamie
Fair enough - I'll try to work out a simplified test case that demonstrates the behavior.

In the meantime, can someone answer a very basic rules/flow question for me?  In my simple, linear test flow, if I cancel any activation, why don't any of the remaining nodes in the flow get triggered?  
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Flow isn't behaving as I'd expect

Jamie
I've found the answer to my problem - it's behaving as designed, but the design is less than intuitive.  Apparently others agree.  Here's a thread involving Michal Bali and Mark Proctor which discusses the issue:

executing-ruleflow-with-AgendaFilter-td60084.html

And here's a feature request that's been filed and deferred for several releases now:

https://issues.jboss.org/browse/JBRULES-2179 

Hopefully it will get addressed soon.  In the meantime, I'm going to have to cook up some other way of 'turning off' a rule.
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Flow isn't behaving as I'd expect

Rob Fisher
Was curious if this had been resolved through subsequent versions?  I too am trying to incorporate a custom AgendaFilter (using rule metadata attributes to control the firing of rules).  I would also prefer to run my rules through a ruleflow.  However, with the AgendaFilter, my rules are not firing.  Without, they are.  I'm currently working with 5.2 Final.  If not, any recommendations on other ways to control firing of rules, while keeping the use of the ruleflow?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Flow isn't behaving as I'd expect

Jamie
I don't think it has.  The history of the Jira ticket referenced above shows it getting pushed along from one release to the next.

I did come up with an alternative that works, although it's a bit clunkier.  Check this thread out - hopefully it'll help you - http://drools.46999.n3.nabble.com/Exclude-certain-rules-td3517185.html#a3519038
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Flow isn't behaving as I'd expect

salaboy
In reply to this post by Rob Fisher
The ruleflow-group will control the rules to not fire until the
ruleTask is reached in your process, but all the evaluations will be
done as soon as the information goes inside the
workingmemory/ksession.

Cheers

On Thu, Dec 29, 2011 at 12:40 PM, Rob Fisher
<[hidden email]> wrote:

> Was curious if this had been resolved through subsequent versions?  I too am
> trying to incorporate a custom AgendaFilter (using rule metadata attributes
> to control the firing of rules).  I would also prefer to run my rules
> through a ruleflow.  However, with the AgendaFilter, my rules are not
> firing.  Without, they are.  I'm currently working with 5.2 Final.  If not,
> any recommendations on other ways to control firing of rules, while keeping
> the use of the ruleflow?
>
> Thanks!
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Flow-isn-t-behaving-as-I-d-expect-tp3200994p3619092.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users



--
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users