Greetings,
we are a team of developers working with Drools 6.2.0 so far, we plan to upgrade to version 7.7.0 but unfortunately we have encountered the following problem:
we are working with BPMN 2.0 and for each task within the BPMN we set a Ruleflow-Group to fire certain rules – the rules of each task are dependent on the previous task‘s rules. I. e. the rules of a following task are only fired if the preceding task‘s rules have successfully provided the objects the following task‘s rules depend upon.
We ran our rule engine with Drools 7.7.0, but it does not work properly. – The produced results differ greatly from those produced by Drools 6.2.0. In 7.7.0, the rule order doesn‘t adhere to the order specified in the BPMN – it seems that the rules are fired in reverse or LIFO (last in, first out). Have we missed something that needs adjustment for the rules or Ruleflow-Group order to work properly (as specified in the BPMN)?
Note: for each individual rule, we DO NOT use "salience" or "auto-focus"
We use the following versions:
Drools 7.7.0 Final
kie-api 7.7.0 Final
jbpm-bpmn2 7.7.0 Final
Spring 4.1.4 Release
Java JDK 1.8.0_151
Example picture in the attachment:
Step A and Step A1 are in ruleflow-group "A"
Step B and Step B1 are in ruleflow-group "B"
Step C and Step C1 are in ruleflow-group "C"
output Drools 7.7.0
In BPMN the order is correct A -> B -> C
08:47:42,228 INFO [stdout] (default task-5) startProcess
08:47:42,234 INFO [stdout] (default task-5) BPMN --> A
08:47:42,235 INFO [stdout] (default task-5) BPMN --> B
08:47:42,235 INFO [stdout] (default task-5) BPMN --> C
08:47:42,236 INFO [stdout] (default task-5) endProcess
After that the rules are fired but NOT in the right order (LIFO):
08:47:42,237 INFO [stdout] (default task-5) null --> Step C1
08:47:42,238 INFO [stdout] (default task-5) Step C1 --> Step C
08:47:42,239 INFO [stdout] (default task-5) Step C --> Step B1
08:47:42,240 INFO [stdout] (default task-5) Step B1 --> Step B
08:47:42,240 INFO [stdout] (default task-5) Step B --> Step A
08:47:42,241 INFO [stdout] (default task-5) Step A --> Step A1
output Drools 6.2.0
Here are BPMN and the rules fired together
09:04:55,747 INFO [stdout] (default task-3) startProcess
09:04:55,788 INFO [stdout] (default task-3) BPMN --> A
09:04:55,793 INFO [stdout] (default task-3) endProcess
09:04:55,797 INFO [stdout] (default task-3) null --> Step A
09:04:55,800 INFO [stdout] (default task-3) Step A --> Step A1
09:04:55,806 INFO [stdout] (default task-3) BPMN --> B
09:04:55,808 INFO [stdout] (default task-3) Step A1 --> Step B
09:04:55,809 INFO [stdout] (default task-3) Step B --> Step B1
09:04:55,811 INFO [stdout] (default task-3) BPMN --> C
09:04:55,812 INFO [stdout] (default task-3) Step B1 --> Step C
09:04:55,813 INFO [stdout] (default task-3) Step C --> Step C1
Thanks for your support!
--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage+unsubscribe@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/735f3ea6-9e16-43f3-9566-5780ee308a9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Nicolas,
Thanks for your support!
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage+unsubscribe@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/70ce9c48-8522-4b62-a69d-639d09d33ed5%40googlegroups.com.
import org.kie.api.io.ResourceType;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.internal.KnowledgeBase;
import org.kie.internal.builder.KnowledgeBuilder;
import org.kie.internal.builder.KnowledgeBuilderFactory;
import org.kie.internal.io.ResourceFactory;
import org.kie.internal.runtime.StatefulKnowledgeSession;
public class RuleFlowUsingKieApi {
public static void main(String[] args) {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("Sample.drl"), ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("ruleflow.rf"), ResourceType.DRF);
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
// start a new process instance
Message message = new Message();
message.setMessage("Rule is fired");
message.setStatus(Message.HELLO);
ksession.insert(message);
ProcessInstance processInstance = ksession.startProcess("com.sample.ruleflow");
}
}
try this
Thanks
Jagan