[rules-users] Test Scenarios with Rule Flows in 5.1.1 Guvnor
Jeffrey DeLong
jdelong at redhat.com
Wed Mar 30 17:59:15 EDT 2011
Add a rule with a higher salience that starts the rule flow process
rule "StartProcess"
salience 100
when
#conditions
then
#actions
kcontext.getKnowledgeRuntime().startProcess("processname");
end
And add it to your package.
Activate is for test scenarios that test individual rules that are part of a ruleflow group. For example, you want to test your second rule independent of the rule flow process, then activate RuleFlowGroup2 (and provide a set of facts that cause the rule in RuleFlowGroup2 to execute).
Jeff
On Mar 30, 2011, at 11:53 AM, John Peterson wrote:
> Hi all,
>
> I had (hopefully) a quick question about trying to test rules in rule flows in Guvnor with Drools 5.1.1. I have a simple 4 step rule flow (Start-RuleGroup1-RuleGroup2-End) with 1 rule in each Rule group. When I set up the test scenario to fire the first rule, which will trigger the second rule, activate “RuleGroup1”, and run the scenario, it doesn’t trigger the RuleFlow and fire the rule. I’ve also tried activating “Start” instead, but neither of them trigger the RuleFlow.
>
> I know from experience that Rule Flows don’t seem to work with 5.0, but with the addition of the entry options, I thought they would with 5.1.1. Am I mistaken?
>
> Also, when I look at the Audit Log, I see the Rule Flow activated and deactivated before any of the facts are asserted:
>
> <Picture (Device Independent Bitmap) 1.jpg> BEFORE RULEFLOW GROUP ACTIVATED group:Start[size=0]
> <Picture (Device Independent Bitmap) 2.jpg> AFTER RULEFLOW GROUP ACTIVATED group:Start[size=0]
> <Picture (Device Independent Bitmap) 3.jpg> BEFORE RULEFLOW GROUP DEACTIVATED group:Start[size=0]
> <Picture (Device Independent Bitmap) 4.jpg> AFTER RULEFLOW GROUP DEACTIVATED group:Start[size=0]
> <Picture (Device Independent Bitmap) 5.jpg> OBJECT ASSERTED value:com.test.Game at 47244724 factId: 1
> <Picture (Device Independent Bitmap) 6.jpg> OBJECT ASSERTED value:com.test.Customer at 4c584c58 factId: 2
>
>
> Could this be part of the problem?
>
> Thanks!
>
> _______________________________________________
> 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/20110330/7d3afada/attachment.html
More information about the rules-users
mailing list