[rules-users] Ruleflow "OR" Split Nodes

ringsah at comcast.net ringsah at comcast.net
Wed Nov 19 13:21:32 EST 2008


To make it easier to follow, I have included the rules as well as some images in the message body. Here are the rules:

rule "Fact A Branch"
    ruleflow-group "Fact A Branch"
    when
        FactA()
    then
        System.out.println("Fact A Branch");
end

rule "Fact B Branch"
    ruleflow-group "Fact B Branch"
    when
        FactB()
    then
        System.out.println("Fact B Branch");
end
Here is a picture of the ruleflow:

Here is a picture of the rules trace when only FactA is inserted, and the join node is type "AND" - notice the ruleflow is never completed (also, when the ruleflow is run, the Action node is never executed):



Here is a picture of the rules trace when both FactA and FactB are inserted, and the join node is type "XOR" - notice the Fact A Branch rule activation is never executed:



TIA,
-Hans
-------------- Original message -------------- 
From: ringsah at comcast.net 

I am having a problem with the ruleflow in Drools 4.0.7. I have the following simple ruleflow with a split node with a type of "OR" with two outgoing connections, each going to a different ruleflow group (image of ruleflow attached).


The problem I am having is with the join node, into which the two ruleflow groups connect back in. If I use a join node type of "AND", then it works okay unless only one branch is executed. Then the action, which simply prints "Action node" to the console, never gets executed.

If I use a join node type of "XOR", then it works okay unless both branches are executed. Then it appears that both branches are executed, because the action get executed twice. However, the rules from the ruleflow group in only one of the branches end up getting fired.

I have attached a zip file containing an extremely simple eclipse test project that illustrates the problem.

Thanks in Advance,
-Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20081119/30286694/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 31192 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20081119/30286694/attachment.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 48236 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20081119/30286694/attachment-0001.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 97249 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20081119/30286694/attachment-0002.jpe 


More information about the rules-users mailing list