[JBoss JIRA] (DROOLS-4377) Comparison error with primitive and Map in executable-model
by Luca Molteni (Jira)
[ https://issues.jboss.org/browse/DROOLS-4377?page=com.atlassian.jira.plugi... ]
Luca Molteni updated DROOLS-4377:
---------------------------------
Sprint: 2019 Week 29-31
> Comparison error with primitive and Map in executable-model
> -----------------------------------------------------------
>
> Key: DROOLS-4377
> URL: https://issues.jboss.org/browse/DROOLS-4377
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.24.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Luca Molteni
> Priority: Major
> Labels: support
>
> When comparing a primitive int with an Integer inside a Map,
> {noformat}
> import java.util.Map;
> import org.drools.modelcompiler.domain.Person;
> rule R1 when
> $m : Map()
> Person(age == $m['age'] )
> then
> end
> {noformat}
> executable-model build fails with "Comparison operation requires compatible types. Found int and class java.lang.Object" even though the Map's value is Integer.
> {noformat}
> [ERROR] Failures:
> [ERROR] CompilerTest.testMapPrimitiveComparison:1905->BaseModelTest.getKieSession:99->BaseModelTest.getKieSession:103->BaseModelTest.getKieContainer:107->BaseModelTest.getKieContainer:114->BaseModelTest.createKieBuilder:125->BaseModelTest.createKieBuilder:152 [Message [id=1, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=-1, column=0
> text=Comparison operation requires compatible types. Found int and class java.lang.Object]]
> {noformat}
> Non executable-model has no issue with the rule.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 11 months
[JBoss JIRA] (DROOLS-4375) BigDecimal in from accumulate with MVEL with executable-model
by Luca Molteni (Jira)
[ https://issues.jboss.org/browse/DROOLS-4375?page=com.atlassian.jira.plugi... ]
Luca Molteni updated DROOLS-4375:
---------------------------------
Sprint: 2019 Week 29-31
> BigDecimal in from accumulate with MVEL with executable-model
> -------------------------------------------------------------
>
> Key: DROOLS-4375
> URL: https://issues.jboss.org/browse/DROOLS-4375
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.24.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Luca Molteni
> Priority: Major
> Labels: support
>
> When "from accumulate" uses BigDecimal with Mvel syntax,
> for example)
> {noformat}
> import org.drools.modelcompiler.domain.Person;
> import java.math.BigDecimal;
> global java.util.List list;
> dialect "mvel"
> rule R when
> $b : BigDecimal() from accumulate (
> Person( $money : money ),
> init( BigDecimal sum = 0; ),
> action( sum += $money; ),
> reverse( sum -= $money; ),
> result( sum )
> )
> then
> list.add($b);
> end
> {noformat}
> It works with non executable-model but fails with executable-model.
> {noformat}
> [ERROR] Failures:
> [ERROR] AccumulateTest.testFromAccumulateBigDecimalMvel:1273->BaseModelTest.getKieSession:99->BaseModelTest.getKieSession:103->BaseModelTest.getKieContainer:107->BaseModelTest.getKieContainer:114->BaseModelTest.createKieBuilder:125->BaseModelTest.createKieBuilder:152 [Message [id=1, level=ERROR, path=src/main/java/defaultpkg/RAccumulate6.java, line=28, column=20
> text=incompatible types: int cannot be converted to java.math.BigDecimal], Message [id=2, level=ERROR, path=src/main/java/defaultpkg/RAccumulate6.java, line=32, column=18
> text=bad operand types for binary operator '+'
> first type: java.math.BigDecimal
> second type: java.math.BigDecimal], Message [id=3, level=ERROR, path=src/main/java/defaultpkg/RAccumulate6.java, line=36, column=18
> text=bad operand types for binary operator '-'
> first type: java.math.BigDecimal
> second type: java.math.BigDecimal], Message [id=4, level=ERROR, path=src/main/java/defaultpkg/RAccumulate6.java, line=0, column=0
> text=Java source of src/main/java/defaultpkg/RAccumulate6.java in error:
> package defaultpkg
> {noformat}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 11 months
[JBoss JIRA] (DROOLS-4376) Abbreviated comparison with Map fails in executable-model
by Luca Molteni (Jira)
[ https://issues.jboss.org/browse/DROOLS-4376?page=com.atlassian.jira.plugi... ]
Luca Molteni updated DROOLS-4376:
---------------------------------
Sprint: 2019 Week 29-31
> Abbreviated comparison with Map fails in executable-model
> ---------------------------------------------------------
>
> Key: DROOLS-4376
> URL: https://issues.jboss.org/browse/DROOLS-4376
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.24.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Luca Molteni
> Priority: Major
> Labels: support
>
> When we write abbreviated comparison with Map,
> {noformat}
> import java.util.Map;
> rule R1 when
> Map(this['money'] >= 65 && <= 75)
> then
> end
> {noformat}
> executable-model build fails.
> {noformat}
> [ERROR] testMapAbbreviatedComparison[FLOW_DSL](org.drools.modelcompiler.CompilerTest) Time elapsed: 0.258 s <<< ERROR!
> java.lang.UnsupportedOperationException: Unknown expression: this["money"]
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.findLeftLeafOfNameExpr(ExpressionTyper.java:875)
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.findLeftLeafOfNameExpr(ExpressionTyper.java:867)
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.findLeftLeafOfNameExpr(ExpressionTyper.java:867)
> at org.drools.modelcompiler.builder.generator.DrlxParseUtil.trasformHalfBinaryToBinary(DrlxParseUtil.java:331)
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:170)
> at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpression(ExpressionTyper.java:118)
> at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.parseBinaryExpr(ConstraintParser.java:309)
> at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.getDrlxParseResult(ConstraintParser.java:114)
> at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.drlxParse(ConstraintParser.java:81)
> at org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.findAllConstraint(PatternDSL.java:124)
> at org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.buildPattern(PatternDSL.java:191)
> at org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:128)
> at org.drools.compiler.lang.descr.PatternDescr.accept(PatternDescr.java:267)
> {noformat}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 11 months
[JBoss JIRA] (DROOLS-4374) Compilation error for "from accumulate" init() with executable-model or not
by Luca Molteni (Jira)
[ https://issues.jboss.org/browse/DROOLS-4374?page=com.atlassian.jira.plugi... ]
Luca Molteni updated DROOLS-4374:
---------------------------------
Sprint: 2019 Week 29-31
> Compilation error for "from accumulate" init() with executable-model or not
> ---------------------------------------------------------------------------
>
> Key: DROOLS-4374
> URL: https://issues.jboss.org/browse/DROOLS-4374
> Project: Drools
> Issue Type: Bug
> Components: core engine, executable model
> Affects Versions: 7.24.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Luca Molteni
> Priority: Minor
> Labels: support
>
> If we miss a semicolon in init() of "from accumulate",
> for example)
> {noformat}
> import org.drools.modelcompiler.domain.Person;
> rule R when
> $sum : Integer() from accumulate (
> Person( age > 18, $age : age ),
> init( int sum = 0 ),
> action( sum += $age; ),
> reverse( sum -= $age; ),
> result( sum )
> )
> then
> insert($sum);
> end
> {noformat}
> - Not executable-model -> The DRL is compiled and executed successfully
> - Executable-model -> Throws ParseProblemException
> {noformat}
> com.github.javaparser.ParseProblemException: (line 1,col 12) Parse error. Found "}", expected one of "!=" "%" "%=" "&" "&&" "&=" "*" "*=" "+" "+=" "," "-" "-=" "->" "/" "/=" "::" ";" "<" "<<=" "<=" "=" "==" ">" ">=" ">>=" ">>>=" "?" "^" "^=" "instanceof" "|" "|=" "||"
> Problem stacktrace :
> com.github.javaparser.GeneratedJavaParser.generateParseException(GeneratedJavaParser.java:10567)
> com.github.javaparser.GeneratedJavaParser.jj_consume_token(GeneratedJavaParser.java:10426)
> com.github.javaparser.GeneratedJavaParser.BlockStatement(GeneratedJavaParser.java:3847)
> com.github.javaparser.GeneratedJavaParser.Statements(GeneratedJavaParser.java:1644)
> com.github.javaparser.GeneratedJavaParser.Block(GeneratedJavaParser.java:3822)
> com.github.javaparser.GeneratedJavaParser.BlockParseStart(GeneratedJavaParser.java:5687)
> com.github.javaparser.JavaParser.parse(JavaParser.java:115)
> com.github.javaparser.JavaParser.parseBlock(JavaParser.java:309)
> com.github.javaparser.StaticJavaParser.parseBlock(StaticJavaParser.java:240)
> org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitor.visitAccInlineCustomCode(AccumulateVisitor.java:434)
> ...
> {noformat}
> I'm not very sure how it should be fixed. I filed this because of discrepancy between Executable-model and Not executable-model
> Poosible choices are:
> - Fail even in case of Not executable-model
> - Success in case of Executable-model
> Additonal Note: If we miss a semicolon in action(), a more understandable error message is thrown.
> {noformat}
> [Message [id=1, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=2, column=0
> text=Rule Compilation error Syntax error, insert ":: IdentifierOrNew" to complete Expression
> Syntax error, insert ";" to complete Statement]]
> {noformat}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 11 months
[JBoss JIRA] (DROOLS-3957) Make verifier panel use docks
by Jozef Marko (Jira)
[ https://issues.jboss.org/browse/DROOLS-3957?page=com.atlassian.jira.plugi... ]
Jozef Marko updated DROOLS-3957:
--------------------------------
Description:
Pretty sure we had a ticket for this, but could not find it. Here it is.
h3. Acceptance test
On both Firefox and Chrome
- Opening multiple decision tables, switching between them
- Repeated reopening of guided decision table
- Opening other asset that uses docks - scenario, data object
was:Pretty sure we had a ticket for this, but could not find it. Here it is.
> Make verifier panel use docks
> -----------------------------
>
> Key: DROOLS-3957
> URL: https://issues.jboss.org/browse/DROOLS-3957
> Project: Drools
> Issue Type: Enhancement
> Components: Guided Decision Table Editor
> Reporter: Toni Rikkola
> Assignee: Toni Rikkola
> Priority: Major
> Labels: drools-tools
>
> Pretty sure we had a ticket for this, but could not find it. Here it is.
> h3. Acceptance test
> On both Firefox and Chrome
> - Opening multiple decision tables, switching between them
> - Repeated reopening of guided decision table
> - Opening other asset that uses docks - scenario, data object
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 11 months
[JBoss JIRA] (DROOLS-2756) KieContainer.verify(kBaseName) throws NPE when kBaseName is wrong
by Luca Molteni (Jira)
[ https://issues.jboss.org/browse/DROOLS-2756?page=com.atlassian.jira.plugi... ]
Luca Molteni updated DROOLS-2756:
---------------------------------
Sprint: (was: 2019 Week 29-31)
> KieContainer.verify(kBaseName) throws NPE when kBaseName is wrong
> -----------------------------------------------------------------
>
> Key: DROOLS-2756
> URL: https://issues.jboss.org/browse/DROOLS-2756
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.8.0.Final
> Environment: Not relevant
> Reporter: Luca Buraggi
> Assignee: Luca Molteni
> Priority: Minor
> Labels: NPE
> Attachments: drooltestjar.zip
>
>
> This snippet:
> {code:java}
> // Using a wrong KB name causes a NPE
> KieContainer kc = DroolsUtils.getAndVerifyKieContainer("WrongKBName");
> {code}
> throws a NPE with thr following stacktrace
> {code:java}
> testSomeMethod(org.mydomain.drooltestjar.DroolsUtilsTest) Time elapsed: 1.065 sec <<< ERROR!
> java.lang.NullPointerException
> at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:207)
> at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:80)
> at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:68)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.verify(KieContainerImpl.java:343)
> ...
> ...
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 11 months