Please discuss issues and tips related to Drools

+1 vote
asked May 14, 2014 in SzolgInt by szarnyasg (252 points)  
commented May 15, 2014 by cseppento (294 points)  
edited May 17, 2014 by cseppento
[Please delete this comment]

2 Answers

0 votes
answered May 18, 2014 by borbast (39 points)  
edited May 18, 2014 by borbast

We hadn't any problem with the Drools but here is some tips which could help me if I known them when I had to use decision tables:

  • First of all the dependecy what you need when you want to use decision table is the folowing (of course change the ${version} for the version number what you want to use, we use 5.4.0.Final).:
<dependency>
    <groupId>org.drools</groupId>
    <artifactId>drools-decisiontables</artifactId>
    <version>5.4.0.Final</version>
</dependency>
  • The second is how to create a multi table xls document: you only have to create tables one above the others. Here is an example: multiple decision table

Best regards,
Raptor Team

0 votes
answered May 28, 2014 by karaszi (24 points)  

We had some problems running Drools in a Tomcat/Bonita BPM environment. At the startup of the deployed jar, we got the following exception:

Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at org.eclipse.jdt.internal.compiler.parser.Parser.consumeCastExpressionWithQualifiedGenericsArray(Parser.java:2083)
    at org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5983)
    at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9339)
    at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9571)
    at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9528)
    at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:8126)
    at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:712)
    at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:377)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:422)
    at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:389)
    at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
    at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:408)
    at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:46)
    at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:102)
    at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:1046)
    at org.drools.compiler.PackageBuilder.compileRules(PackageBuilder.java:948)
    at org.drools.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:879)
    at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:871)
    at org.drools.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:447)
    at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:711)
    at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
    at hu.bme.mit.sysint.mohoka.pricecalculation.PriceCalculator.readKnowledgeBase(PriceCalculator.java:122)

Environment: Windows 8.1, Java: Oracle JDK 1.7.0_55, with default config.

The Drools documentation had a note, that mentioned possible problems with the JDT compiler in J2EE environments and mentions a possible solution: using the Janino comiler. After we set the property, we got another exception in the log:

Caused by: org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel:org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration'
    at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:321)
    at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:307)
    at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:192)
    at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:165)
    at org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactoryServiceImpl.java:26)
    at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactory.java:85)
    at hu.bme.mit.sysint.mohoka.pricecalculation.PriceCalculator.readKnowledgeBase(PriceCalculator.java:117)
    at hu.bme.mit.sysint.mohoka.pricecalculation.PriceCalculator.calculateComputerPrice(PriceCalculator.java:37)
    at hu.bme.mit.sysint.mohoka.pricecalculation.connector.ComputerPriceCalculationImpl.executeBusinessLogic(ComputerPriceCalculationImpl.java:44)
    at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:74)
    at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:70)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:141)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:124)
    ... 4 more
Caused by: java.lang.ClassCastException: org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration cannot be cast to org.drools.compiler.DialectConfiguration
    at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:316)
    ... 16 more

Environment: Windows 8.1, Java: Oracle JDK 1.7.0_55. Config: drools.dialect.java.compiler=JANINO

MOHOKA Team

...