0
votes

I'm running Drools 6.0.0.Beta2 on Tomcat 7. I keep running into a problem where all my rules execute fine once on the initial payload, and only the first rule executes on subsequent payloads, even if the payloads are identical to the first. It has been suggested to me that the problem is in a condition of one of the rules, but I don't understand what it would be seeing as the rules execute perfectly on the first payload. The rules are in separate rule-flows and there are a lot of the second type of rule that simply use different values for the parameters on the Measurement.

Here's an example of the first two rules:

 rule "encounter type values"
 ruleflow-group "encounter-types"
   when
      $f: Foo()
      $b: Bar() from $f.getBars()
      $s: Foo.Something(type == Foo.Something.TYPE_1 ||  type == Foo.Something.TYPE_2 || type == Foo.Something.TYPE_3, value> 0.0) from $b.getSomethings()
   then
      FlyingMonkey m = new FlyingMonkey($f, $s.getDate(), $s.getType, $s.getValue());
      insert(m);
   end

rule "do math for type and date"
ruleflow-group "yay-math"
   when
      $m: FlyingMonkey(value!=null || score!=null, type=="TYPE1", age>-30, age<30)
   then
      Measurement fact = new Measurement($m, 1, 2, 3, 4, 5, 6);
      insert(fact);
   end

Does anyone know any reasons why this is happening? Is it a bug in the software versions I'm using or is it more likely something in my rules that inexplicably breaks them the second time around?

EDIT: The rules I am using worked in Drools version 5.0.1 perfectly well.

1
How are you feeding your session? How many sessions do you have? When are you invoking insert() and fireAllRules()? Are you using jbpm? Are you manually changing the active ruleflow-group?Esteban Aliverti
I am feeding my session using $.ajax on a client with the post command and a JSON formatted string. I'm new to drools so I can't say for certain how many sessions I have, although I believe it's only one. The commands I send are insert, start-process, fire-all-rules, and query, in that order. I'm not sure what you mean by am I using jbpm. I have the ruleflow set up in a rf file, which is how it was when it was given to me.jschabs

1 Answers

1
votes

It appears this is actually a bug in Drools 5.5.Final and onward. It's been reported here: https://issues.jboss.org/browse/DROOLS-141

Another user had the same problem and documented his progress here: http://drools.46999.n3.nabble.com/Ruleflow-not-working-with-stateless-session-in-drools-server-5-5-0-Final-td4021624.html