Details
-
Bug
-
Resolution: Done
-
Major
-
None
-
7.28.0.Final
-
None
-
2019 Week 44-46 (from Okt 28), 2019 Week 47-49 (from Nov 18)
-
-
NEW
-
NEW
Description
See reproducer here: https://github.com/DuncanDoyle/drools-conditional-named-consequence-issue
When you use a Conditional Named Consequence
if
definition directly after an
accumulate
, Drools gives the following error when parsing the DRL:
[ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.28.0.Final:build (default-build) on project drools-conditional-named-consequence-issue: Execution default-build of goal org.kie:kie-maven-plugin:7.28.0.Final:build failed: Unable to get KieModule, Errors Existed: Error Messages: [ERROR] Message [id=1, kieBase=defaultKieBase, level=ERROR, path=rules.drl, line=19, column=0 [ERROR] text=Unable to resolve ObjectType 'if'] [ERROR] --- [ERROR] Warning Messages: [ERROR] --- [ERROR] Info Messages: [ERROR]
When you add a constraint between the
accumulate
and the
if
statement of the Conditional Named Consequence, it works fine.
Also when you try to generate the canonical model from a DRL that contains a Conditional Named Consequence, you get the following error:
[ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.28.0.Final:generateModel (default-generateModel) on project drools-conditional-named-consequence-issue: A type incompatibility occurred while executing org.kie:kie-maven-plugin:7.28.0.Final:generateModel: org.drools.compiler.lang.descr.NamedConsequenceDescr cannot be cast to org.drools.compiler.lang.descr.PatternDescr