am using Drools 5.x (drools-compiler 5.2.1.Final, drools-decisiontables 5.4.0.Final, and drools-templates 5.4.0.Final; jbpm-flow 5.1.1.Final, jbpm-bmpn2 5.1.1.Final and with their respective dependencies) for my Java job, I build/run it with Java 1.7.0_21. My current set up works properly. I am using a decision table (spreadsheet).
I am able to build/run my project with Java 1.8.0_162 using drools 5.x as described above; however, when the java job runs it loads the decision table (spreadsheet) but it does not fire up any of the rules, I am not getting an exception in the last line that gets executed:
Properties props = new Properties();
KnowledgeBuilderConfiguration configuration = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(props);
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newDecisionTableConfiguration(configuration);
DecisionTableConfiguration config = KnowledgeBuilderFactory.newDecisionTableConfiguration();
config.setInputType(DecisionTableInputType.XLS);
kbuilder.add(ResourceFactory.newClassPathResource(spreadsheetFile), ResourcType.DTABLE, config);
Prior to the last line getting executed I put some debug logs and they show the following:
>> Properties (props): {}
>> KnowledgeBuilderConfiguration (configuration): org.drools.compiler.PackageBuilderConfiguration@630cb4a4
>> KnowledgeBuilder (kbuilder): org.drools.builder.impl.KnowledgeBuilderImpl@239bof9d
>> ResourceFactory.newClassPathResource(spreadsheetFile): [ClassPathResource path='spreadsheet.xls']
>> ResourceType.DTABLE: ResourceType = 'Decision Table'
>> DecisionTableConfiguration (config): org.drools.builder.conf.impl.DecisionTableConfigurationImpl@150ab4ed
>> DecisionTableConfiguration (config.getInputType()): XLS
So I decided to upgrade from drools 5.5.0 to 7.5.0 and use kie-api/kie-ci; I had to do some refactoring because now drools is part of the KIE (Knowledge Is Everything) umbrella, see the code below:
KieServices ks = KieServices.Factory.get();
KieContainer kc = ks.getKieClasspathContainer();
KieSession ks = kc.newKieSession("ksession-dtables");
FactHandle fh = ks.insert(fact);
ks.fireAllRules();
....
The packages and rules are loaded into the Knowledge Base but only the first rules fire up and then it stops, do I need to upgrade my decision table (spreadsheet) in order to work for drools 7.5.0 with Java 8?
Any suggestions are welcome.
Thanks!!
What I have tried:
Figuring out if I need to modify my decision table (spreadsheet) and debug the code to find the culprit.