I am using Drools for my Java back-end job, my current set up works properly with Java 1.7.0_21 using 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
This works fine when build and running with Java 1.7.0_21 but not with Java 1.8.0_162. My project builds successfully with Java 1.8.0_162 and it runs fine except when it tries to load the drools rule xls file
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); // last line executed and then job exists and completes successfully.
The job just completes, it is almost like it exists.
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
I try using knowledge-api-5.2.1.Final.jar and then with knowledge-api-5.4.0.Final.jar
So I decided to upgrade from drools 5.5.0 to 7.5.0; I had to do some refactoring because now drools is part of the KIE (Knowledge Is Everything) umbrella, the fact is inserted and it seems like all the rules fire up, but I think not. I believe the issue is that I am using
InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addPackages(kbuilder.getKnowledgePackager());
KieSession ksession = kbase.newKieSession();
Instead, I should be using
KieBase kbase = kbuilder.newKieBase();
//kbase.addPackages(kbuilder.getKnowledgePackager());
KieSession ksession = kbase.newKieSession();
Any suggestions are welcome.
Thanks,
Gibran
--
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/0c78089d-b913-40fd-8ba1-45bf58ffdc5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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/f9154279-2f68-4306-955c-c52bb5623ef3%40googlegroups.com.