[Red Hat JIRA] (DROOLS-5913) [DMN Designer] Improving UX when Decision Table is relying on not updated data.
by Jozef Marko (Jira)
[ https://issues.redhat.com/browse/DROOLS-5913?page=com.atlassian.jira.plug... ]
Jozef Marko updated DROOLS-5913:
--------------------------------
Labels: Field Support (was: )
> [DMN Designer] Improving UX when Decision Table is relying on not updated data.
> --------------------------------------------------------------------------------
>
> Key: DROOLS-5913
> URL: https://issues.redhat.com/browse/DROOLS-5913
> Project: Drools
> Issue Type: Enhancement
> Components: DMN Editor
> Reporter: Yeser Amer
> Assignee: Guilherme Gomes
> Priority: Major
> Labels: Field, Support
>
> We should find a way to improve User Experience in the case a Decision Table is relying on Data Type which was modified by the user.
> Original Message:
> {noformat}
> TL;DR a modification of an Object (aka Structure) in the Data Model does not get reflected in the DMN Model.
> Maybe someone can point out the error in the following scenario.
> (1) Using the DMN editor in BC RHPAM.7.9 I defined the "Ve" Object (aka Structure) and the "Ve_data1" simple variable in the Data Model as custom data types
> (2) "Ve", named as "Vehicle", was used as data input to a DMN model and a decision was defined backed by a decision table
> (3) when the decision table was first created the columns for the "Vehicle" attributes were created as individual columns.
> (4) Modified the "Ve" structure by removing some attributes
> (5) The deleted attributes are still available in the decision table.
> I have two issues in this scenario.
> (I1) Step (3). By creating the columns as individual columns of the "Vehicle" variable in the decision table any sense between them belonging to the "Ve" structure is lost. Furthermore the decision table allows for changing the data type of the columns despite the fact that these belong(?) to the "Ve" object.
> (I2) Step (5). I was expecting that by modifying the columns in the data structure that change would be visible in the decision table as well. Yes, a warning is generated, but it is cryptic, lost in a table full of equally cryptic messages and no visual indication of the actual problem in the decision table. I can check the messages and find out what is going on, but explaining this to my customer proved to be quite a challenge.
> We are still targeting DMN to business analysts I presume.
> {noformat}
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 10 months
[Red Hat JIRA] (DROOLS-5913) [DMN Designer] Improving UX when Decision Table is relying on not updated data.
by Jozef Marko (Jira)
[ https://issues.redhat.com/browse/DROOLS-5913?page=com.atlassian.jira.plug... ]
Jozef Marko updated DROOLS-5913:
--------------------------------
Component/s: DMN Editor
Tester: Jozef Marko
> [DMN Designer] Improving UX when Decision Table is relying on not updated data.
> --------------------------------------------------------------------------------
>
> Key: DROOLS-5913
> URL: https://issues.redhat.com/browse/DROOLS-5913
> Project: Drools
> Issue Type: Enhancement
> Components: DMN Editor
> Reporter: Yeser Amer
> Assignee: Guilherme Gomes
> Priority: Major
>
> We should find a way to improve User Experience in the case a Decision Table is relying on Data Type which was modified by the user.
> Original Message:
> {noformat}
> TL;DR a modification of an Object (aka Structure) in the Data Model does not get reflected in the DMN Model.
> Maybe someone can point out the error in the following scenario.
> (1) Using the DMN editor in BC RHPAM.7.9 I defined the "Ve" Object (aka Structure) and the "Ve_data1" simple variable in the Data Model as custom data types
> (2) "Ve", named as "Vehicle", was used as data input to a DMN model and a decision was defined backed by a decision table
> (3) when the decision table was first created the columns for the "Vehicle" attributes were created as individual columns.
> (4) Modified the "Ve" structure by removing some attributes
> (5) The deleted attributes are still available in the decision table.
> I have two issues in this scenario.
> (I1) Step (3). By creating the columns as individual columns of the "Vehicle" variable in the decision table any sense between them belonging to the "Ve" structure is lost. Furthermore the decision table allows for changing the data type of the columns despite the fact that these belong(?) to the "Ve" object.
> (I2) Step (5). I was expecting that by modifying the columns in the data structure that change would be visible in the decision table as well. Yes, a warning is generated, but it is cryptic, lost in a table full of equally cryptic messages and no visual indication of the actual problem in the decision table. I can check the messages and find out what is going on, but explaining this to my customer proved to be quite a challenge.
> We are still targeting DMN to business analysts I presume.
> {noformat}
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 10 months
[Red Hat JIRA] (DROOLS-5934) NullPointerException at ConstraintEvaluator.findPatternAndRequiredDeclaration() in accumulate with exec-model
by Amit Nijhawan (Jira)
[ https://issues.redhat.com/browse/DROOLS-5934?page=com.atlassian.jira.plug... ]
Amit Nijhawan deleted DROOLS-5934:
----------------------------------
> NullPointerException at ConstraintEvaluator.findPatternAndRequiredDeclaration() in accumulate with exec-model
> -------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-5934
> URL: https://issues.redhat.com/browse/DROOLS-5934
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.48.0.Final
> Reporter: Amit Nijhawan
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> With exec-model, a rule like this:
> {noformat}
> when
> Number( ) from accumulate (
> FactA( $valueA : value )
> and
> FactB( $valueB : value, eval($valueB.compareTo($valueA) <= 0) )
> ;max($valueB.intValue())
> )
> then
> {noformat}
> generates the following PATTERN_DSL:
> {code:java}
> org.drools.model.Rule rule = D.rule("org.drools.mvel.compiler",
> "r1").build(D.pattern(var_GENERATED_$pattern_Number$1$),
> D.accumulate(D.and(D.pattern(var_GENERATED_$pattern_FactA$2$).bind(var_$valueA,
> org.drools.mvel.compiler.P46.LambdaExtractor468EFEB3BE9EA6494C88709DE97051CB.INSTANCE,
> D.reactOn("value")),
> D.pattern(var_GENERATED_$pattern_FactB$3$).bind(var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71,
> org.drools.mvel.compiler.P18.LambdaExtractor18D900ABC004631DF004CDA316CD34FD.INSTANCE,
> D.reactOn("value")).expr("A574527869CA97E0B100815026E8E8FA",
> var_$valueB,
> var_$valueA,
> org.drools.mvel.compiler.P3E.LambdaPredicate3E396A3A5FB9CCA4FC041866C27E4A3A.INSTANCE)),
> D.accFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction::new,
> var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71).as(var_GENERATED_$pattern_Number$1$)),
> D.execute(org.drools.mvel.compiler.P97.LambdaConsequence97C360F7B2C85569E6224ABDE862C784.INSTANCE));
> {code}
> It misses bind() for var_$valueB. It results in NPE during kbase build.
> {noformat}
> java.lang.NullPointerException
> at org.drools.modelcompiler.constraints.ConstraintEvaluator.findPatternAndRequiredDeclaration(ConstraintEvaluator.java:97)
> at org.drools.modelcompiler.constraints.ConstraintEvaluator.<init>(ConstraintEvaluator.java:67)
> at org.drools.modelcompiler.KiePackagesBuilder.createSingleConstraint(KiePackagesBuilder.java:1064)
> at org.drools.modelcompiler.KiePackagesBuilder.createConstraint(KiePackagesBuilder.java:1049)
> at org.drools.modelcompiler.KiePackagesBuilder.addConstraintsToPattern(KiePackagesBuilder.java:1043)
> at org.drools.modelcompiler.KiePackagesBuilder.buildPattern(KiePackagesBuilder.java:730)
> at org.drools.modelcompiler.KiePackagesBuilder.recursivelyAddConditions(KiePackagesBuilder.java:624)
> at org.drools.modelcompiler.KiePackagesBuilder.buildAccumulate(KiePackagesBuilder.java:581)
> at org.drools.modelcompiler.KiePackagesBuilder.conditionToElement(KiePackagesBuilder.java:493)
> at org.drools.modelcompiler.KiePackagesBuilder.addSubConditions(KiePackagesBuilder.java:655)
> at org.drools.modelcompiler.KiePackagesBuilder.populateLHS(KiePackagesBuilder.java:449)
> at org.drools.modelcompiler.KiePackagesBuilder.compileRule(KiePackagesBuilder.java:249)
> at org.drools.modelcompiler.KiePackagesBuilder.build(KiePackagesBuilder.java:220)
> at org.drools.modelcompiler.CanonicalKieModule.createKiePackages(CanonicalKieModule.java:306)
> at org.drools.modelcompiler.CanonicalKieModule.lambda$1(CanonicalKieModule.java:213)
> at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
> at org.drools.modelcompiler.CanonicalKieModule.createKieBase(CanonicalKieModule.java:213)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:470)
> {noformat}
> ====
> Even this rule causes the issue. So the key factor is the method invocation $valueB.intValue()
> {noformat}
> when
> Number( ) from accumulate (
> FactB( $valueB : value, $valueB > 0 )
> ;max($valueB.intValue())
> )
> then
> {noformat}
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 10 months
[Red Hat JIRA] (DROOLS-5934) NullPointerException at ConstraintEvaluator.findPatternAndRequiredDeclaration() in accumulate with exec-model
by Amit Nijhawan (Jira)
Amit Nijhawan created DROOLS-5934:
-------------------------------------
Summary: NullPointerException at ConstraintEvaluator.findPatternAndRequiredDeclaration() in accumulate with exec-model
Key: DROOLS-5934
URL: https://issues.redhat.com/browse/DROOLS-5934
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.48.0.Final
Reporter: Amit Nijhawan
Assignee: Toshiya Kobayashi
With exec-model, a rule like this:
{noformat}
when
Number( ) from accumulate (
FactA( $valueA : value )
and
FactB( $valueB : value, eval($valueB.compareTo($valueA) <= 0) )
;max($valueB.intValue())
)
then
{noformat}
generates the following PATTERN_DSL:
{code:java}
org.drools.model.Rule rule = D.rule("org.drools.mvel.compiler",
"r1").build(D.pattern(var_GENERATED_$pattern_Number$1$),
D.accumulate(D.and(D.pattern(var_GENERATED_$pattern_FactA$2$).bind(var_$valueA,
org.drools.mvel.compiler.P46.LambdaExtractor468EFEB3BE9EA6494C88709DE97051CB.INSTANCE,
D.reactOn("value")),
D.pattern(var_GENERATED_$pattern_FactB$3$).bind(var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71,
org.drools.mvel.compiler.P18.LambdaExtractor18D900ABC004631DF004CDA316CD34FD.INSTANCE,
D.reactOn("value")).expr("A574527869CA97E0B100815026E8E8FA",
var_$valueB,
var_$valueA,
org.drools.mvel.compiler.P3E.LambdaPredicate3E396A3A5FB9CCA4FC041866C27E4A3A.INSTANCE)),
D.accFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction::new,
var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71).as(var_GENERATED_$pattern_Number$1$)),
D.execute(org.drools.mvel.compiler.P97.LambdaConsequence97C360F7B2C85569E6224ABDE862C784.INSTANCE));
{code}
It misses bind() for var_$valueB. It results in NPE during kbase build.
{noformat}
java.lang.NullPointerException
at org.drools.modelcompiler.constraints.ConstraintEvaluator.findPatternAndRequiredDeclaration(ConstraintEvaluator.java:97)
at org.drools.modelcompiler.constraints.ConstraintEvaluator.<init>(ConstraintEvaluator.java:67)
at org.drools.modelcompiler.KiePackagesBuilder.createSingleConstraint(KiePackagesBuilder.java:1064)
at org.drools.modelcompiler.KiePackagesBuilder.createConstraint(KiePackagesBuilder.java:1049)
at org.drools.modelcompiler.KiePackagesBuilder.addConstraintsToPattern(KiePackagesBuilder.java:1043)
at org.drools.modelcompiler.KiePackagesBuilder.buildPattern(KiePackagesBuilder.java:730)
at org.drools.modelcompiler.KiePackagesBuilder.recursivelyAddConditions(KiePackagesBuilder.java:624)
at org.drools.modelcompiler.KiePackagesBuilder.buildAccumulate(KiePackagesBuilder.java:581)
at org.drools.modelcompiler.KiePackagesBuilder.conditionToElement(KiePackagesBuilder.java:493)
at org.drools.modelcompiler.KiePackagesBuilder.addSubConditions(KiePackagesBuilder.java:655)
at org.drools.modelcompiler.KiePackagesBuilder.populateLHS(KiePackagesBuilder.java:449)
at org.drools.modelcompiler.KiePackagesBuilder.compileRule(KiePackagesBuilder.java:249)
at org.drools.modelcompiler.KiePackagesBuilder.build(KiePackagesBuilder.java:220)
at org.drools.modelcompiler.CanonicalKieModule.createKiePackages(CanonicalKieModule.java:306)
at org.drools.modelcompiler.CanonicalKieModule.lambda$1(CanonicalKieModule.java:213)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.drools.modelcompiler.CanonicalKieModule.createKieBase(CanonicalKieModule.java:213)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:470)
{noformat}
====
Even this rule causes the issue. So the key factor is the method invocation $valueB.intValue()
{noformat}
when
Number( ) from accumulate (
FactB( $valueB : value, $valueB > 0 )
;max($valueB.intValue())
)
then
{noformat}
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 10 months
[Red Hat JIRA] (DROOLS-5933) NullPointerException at ConstraintEvaluator.findPatternAndRequiredDeclaration() in accumulate with exec-model
by Toshiya Kobayashi (Jira)
[ https://issues.redhat.com/browse/DROOLS-5933?page=com.atlassian.jira.plug... ]
Toshiya Kobayashi updated DROOLS-5933:
--------------------------------------
Description:
With exec-model, a rule like this:
{noformat}
when
Number( ) from accumulate (
FactA( $valueA : value )
and
FactB( $valueB : value, eval($valueB.compareTo($valueA) <= 0) )
;max($valueB.intValue())
)
then
{noformat}
generates the following PATTERN_DSL:
{code:java}
org.drools.model.Rule rule = D.rule("org.drools.mvel.compiler",
"r1").build(D.pattern(var_GENERATED_$pattern_Number$1$),
D.accumulate(D.and(D.pattern(var_GENERATED_$pattern_FactA$2$).bind(var_$valueA,
org.drools.mvel.compiler.P46.LambdaExtractor468EFEB3BE9EA6494C88709DE97051CB.INSTANCE,
D.reactOn("value")),
D.pattern(var_GENERATED_$pattern_FactB$3$).bind(var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71,
org.drools.mvel.compiler.P18.LambdaExtractor18D900ABC004631DF004CDA316CD34FD.INSTANCE,
D.reactOn("value")).expr("A574527869CA97E0B100815026E8E8FA",
var_$valueB,
var_$valueA,
org.drools.mvel.compiler.P3E.LambdaPredicate3E396A3A5FB9CCA4FC041866C27E4A3A.INSTANCE)),
D.accFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction::new,
var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71).as(var_GENERATED_$pattern_Number$1$)),
D.execute(org.drools.mvel.compiler.P97.LambdaConsequence97C360F7B2C85569E6224ABDE862C784.INSTANCE));
{code}
It misses bind() for var_$valueB. It results in NPE during kbase build.
{noformat}
java.lang.NullPointerException
at org.drools.modelcompiler.constraints.ConstraintEvaluator.findPatternAndRequiredDeclaration(ConstraintEvaluator.java:97)
at org.drools.modelcompiler.constraints.ConstraintEvaluator.<init>(ConstraintEvaluator.java:67)
at org.drools.modelcompiler.KiePackagesBuilder.createSingleConstraint(KiePackagesBuilder.java:1064)
at org.drools.modelcompiler.KiePackagesBuilder.createConstraint(KiePackagesBuilder.java:1049)
at org.drools.modelcompiler.KiePackagesBuilder.addConstraintsToPattern(KiePackagesBuilder.java:1043)
at org.drools.modelcompiler.KiePackagesBuilder.buildPattern(KiePackagesBuilder.java:730)
at org.drools.modelcompiler.KiePackagesBuilder.recursivelyAddConditions(KiePackagesBuilder.java:624)
at org.drools.modelcompiler.KiePackagesBuilder.buildAccumulate(KiePackagesBuilder.java:581)
at org.drools.modelcompiler.KiePackagesBuilder.conditionToElement(KiePackagesBuilder.java:493)
at org.drools.modelcompiler.KiePackagesBuilder.addSubConditions(KiePackagesBuilder.java:655)
at org.drools.modelcompiler.KiePackagesBuilder.populateLHS(KiePackagesBuilder.java:449)
at org.drools.modelcompiler.KiePackagesBuilder.compileRule(KiePackagesBuilder.java:249)
at org.drools.modelcompiler.KiePackagesBuilder.build(KiePackagesBuilder.java:220)
at org.drools.modelcompiler.CanonicalKieModule.createKiePackages(CanonicalKieModule.java:306)
at org.drools.modelcompiler.CanonicalKieModule.lambda$1(CanonicalKieModule.java:213)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.drools.modelcompiler.CanonicalKieModule.createKieBase(CanonicalKieModule.java:213)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:470)
{noformat}
====
Even this rule causes the issue. So the key factor is the method invocation $valueB.intValue()
{noformat}
when
Number( ) from accumulate (
FactB( $valueB : value, $valueB > 0 )
;max($valueB.intValue())
)
then
{noformat}
was:
With exec-model, a rule like this:
{noformat}
when
Number( ) from accumulate (
FactA( $valueA : value )
and
FactB( $valueB : value, eval($valueB.compareTo($valueA) <= 0) )
;max($valueB.intValue())
)
then
{noformat}
generates the following PATTERN_DSL:
{code:java}
org.drools.model.Rule rule = D.rule("org.drools.mvel.compiler",
"r1").build(D.pattern(var_GENERATED_$pattern_Number$1$),
D.accumulate(D.and(D.pattern(var_GENERATED_$pattern_FactA$2$).bind(var_$valueA,
org.drools.mvel.compiler.P46.LambdaExtractor468EFEB3BE9EA6494C88709DE97051CB.INSTANCE,
D.reactOn("value")),
D.pattern(var_GENERATED_$pattern_FactB$3$).bind(var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71,
org.drools.mvel.compiler.P18.LambdaExtractor18D900ABC004631DF004CDA316CD34FD.INSTANCE,
D.reactOn("value")).expr("A574527869CA97E0B100815026E8E8FA",
var_$valueB,
var_$valueA,
org.drools.mvel.compiler.P3E.LambdaPredicate3E396A3A5FB9CCA4FC041866C27E4A3A.INSTANCE)),
D.accFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction::new,
var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71).as(var_GENERATED_$pattern_Number$1$)),
D.execute(org.drools.mvel.compiler.P97.LambdaConsequence97C360F7B2C85569E6224ABDE862C784.INSTANCE));
{code}
It misses bind() for var_$valueB. It results in NPE during kbase build.
{noformat}
java.lang.NullPointerException
at org.drools.modelcompiler.constraints.ConstraintEvaluator.findPatternAndRequiredDeclaration(ConstraintEvaluator.java:97)
at org.drools.modelcompiler.constraints.ConstraintEvaluator.<init>(ConstraintEvaluator.java:67)
at org.drools.modelcompiler.KiePackagesBuilder.createSingleConstraint(KiePackagesBuilder.java:1064)
at org.drools.modelcompiler.KiePackagesBuilder.createConstraint(KiePackagesBuilder.java:1049)
at org.drools.modelcompiler.KiePackagesBuilder.addConstraintsToPattern(KiePackagesBuilder.java:1043)
at org.drools.modelcompiler.KiePackagesBuilder.buildPattern(KiePackagesBuilder.java:730)
at org.drools.modelcompiler.KiePackagesBuilder.recursivelyAddConditions(KiePackagesBuilder.java:624)
at org.drools.modelcompiler.KiePackagesBuilder.buildAccumulate(KiePackagesBuilder.java:581)
at org.drools.modelcompiler.KiePackagesBuilder.conditionToElement(KiePackagesBuilder.java:493)
at org.drools.modelcompiler.KiePackagesBuilder.addSubConditions(KiePackagesBuilder.java:655)
at org.drools.modelcompiler.KiePackagesBuilder.populateLHS(KiePackagesBuilder.java:449)
at org.drools.modelcompiler.KiePackagesBuilder.compileRule(KiePackagesBuilder.java:249)
at org.drools.modelcompiler.KiePackagesBuilder.build(KiePackagesBuilder.java:220)
at org.drools.modelcompiler.CanonicalKieModule.createKiePackages(CanonicalKieModule.java:306)
at org.drools.modelcompiler.CanonicalKieModule.lambda$1(CanonicalKieModule.java:213)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.drools.modelcompiler.CanonicalKieModule.createKieBase(CanonicalKieModule.java:213)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:470)
{noformat}
> NullPointerException at ConstraintEvaluator.findPatternAndRequiredDeclaration() in accumulate with exec-model
> -------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-5933
> URL: https://issues.redhat.com/browse/DROOLS-5933
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.48.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> With exec-model, a rule like this:
> {noformat}
> when
> Number( ) from accumulate (
> FactA( $valueA : value )
> and
> FactB( $valueB : value, eval($valueB.compareTo($valueA) <= 0) )
> ;max($valueB.intValue())
> )
> then
> {noformat}
> generates the following PATTERN_DSL:
> {code:java}
> org.drools.model.Rule rule = D.rule("org.drools.mvel.compiler",
> "r1").build(D.pattern(var_GENERATED_$pattern_Number$1$),
> D.accumulate(D.and(D.pattern(var_GENERATED_$pattern_FactA$2$).bind(var_$valueA,
> org.drools.mvel.compiler.P46.LambdaExtractor468EFEB3BE9EA6494C88709DE97051CB.INSTANCE,
> D.reactOn("value")),
> D.pattern(var_GENERATED_$pattern_FactB$3$).bind(var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71,
> org.drools.mvel.compiler.P18.LambdaExtractor18D900ABC004631DF004CDA316CD34FD.INSTANCE,
> D.reactOn("value")).expr("A574527869CA97E0B100815026E8E8FA",
> var_$valueB,
> var_$valueA,
> org.drools.mvel.compiler.P3E.LambdaPredicate3E396A3A5FB9CCA4FC041866C27E4A3A.INSTANCE)),
> D.accFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction::new,
> var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71).as(var_GENERATED_$pattern_Number$1$)),
> D.execute(org.drools.mvel.compiler.P97.LambdaConsequence97C360F7B2C85569E6224ABDE862C784.INSTANCE));
> {code}
> It misses bind() for var_$valueB. It results in NPE during kbase build.
> {noformat}
> java.lang.NullPointerException
> at org.drools.modelcompiler.constraints.ConstraintEvaluator.findPatternAndRequiredDeclaration(ConstraintEvaluator.java:97)
> at org.drools.modelcompiler.constraints.ConstraintEvaluator.<init>(ConstraintEvaluator.java:67)
> at org.drools.modelcompiler.KiePackagesBuilder.createSingleConstraint(KiePackagesBuilder.java:1064)
> at org.drools.modelcompiler.KiePackagesBuilder.createConstraint(KiePackagesBuilder.java:1049)
> at org.drools.modelcompiler.KiePackagesBuilder.addConstraintsToPattern(KiePackagesBuilder.java:1043)
> at org.drools.modelcompiler.KiePackagesBuilder.buildPattern(KiePackagesBuilder.java:730)
> at org.drools.modelcompiler.KiePackagesBuilder.recursivelyAddConditions(KiePackagesBuilder.java:624)
> at org.drools.modelcompiler.KiePackagesBuilder.buildAccumulate(KiePackagesBuilder.java:581)
> at org.drools.modelcompiler.KiePackagesBuilder.conditionToElement(KiePackagesBuilder.java:493)
> at org.drools.modelcompiler.KiePackagesBuilder.addSubConditions(KiePackagesBuilder.java:655)
> at org.drools.modelcompiler.KiePackagesBuilder.populateLHS(KiePackagesBuilder.java:449)
> at org.drools.modelcompiler.KiePackagesBuilder.compileRule(KiePackagesBuilder.java:249)
> at org.drools.modelcompiler.KiePackagesBuilder.build(KiePackagesBuilder.java:220)
> at org.drools.modelcompiler.CanonicalKieModule.createKiePackages(CanonicalKieModule.java:306)
> at org.drools.modelcompiler.CanonicalKieModule.lambda$1(CanonicalKieModule.java:213)
> at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
> at org.drools.modelcompiler.CanonicalKieModule.createKieBase(CanonicalKieModule.java:213)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:470)
> {noformat}
> ====
> Even this rule causes the issue. So the key factor is the method invocation $valueB.intValue()
> {noformat}
> when
> Number( ) from accumulate (
> FactB( $valueB : value, $valueB > 0 )
> ;max($valueB.intValue())
> )
> then
> {noformat}
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 10 months
[Red Hat JIRA] (DROOLS-5933) NullPointerException at ConstraintEvaluator.findPatternAndRequiredDeclaration() in accumulate with exec-model
by Toshiya Kobayashi (Jira)
Toshiya Kobayashi created DROOLS-5933:
-----------------------------------------
Summary: NullPointerException at ConstraintEvaluator.findPatternAndRequiredDeclaration() in accumulate with exec-model
Key: DROOLS-5933
URL: https://issues.redhat.com/browse/DROOLS-5933
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.48.0.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
With exec-model, a rule like this:
{noformat}
when
Number( ) from accumulate (
FactA( $valueA : value )
and
FactB( $valueB : value, eval($valueB.compareTo($valueA) <= 0) )
;max($valueB.intValue())
)
then
{noformat}
generates the following PATTERN_DSL:
{code:java}
org.drools.model.Rule rule = D.rule("org.drools.mvel.compiler",
"r1").build(D.pattern(var_GENERATED_$pattern_Number$1$),
D.accumulate(D.and(D.pattern(var_GENERATED_$pattern_FactA$2$).bind(var_$valueA,
org.drools.mvel.compiler.P46.LambdaExtractor468EFEB3BE9EA6494C88709DE97051CB.INSTANCE,
D.reactOn("value")),
D.pattern(var_GENERATED_$pattern_FactB$3$).bind(var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71,
org.drools.mvel.compiler.P18.LambdaExtractor18D900ABC004631DF004CDA316CD34FD.INSTANCE,
D.reactOn("value")).expr("A574527869CA97E0B100815026E8E8FA",
var_$valueB,
var_$valueA,
org.drools.mvel.compiler.P3E.LambdaPredicate3E396A3A5FB9CCA4FC041866C27E4A3A.INSTANCE)),
D.accFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction::new,
var_6C0A578A2EA3D5A5C82ABB0FA0DE5C71).as(var_GENERATED_$pattern_Number$1$)),
D.execute(org.drools.mvel.compiler.P97.LambdaConsequence97C360F7B2C85569E6224ABDE862C784.INSTANCE));
{code}
It misses bind() for var_$valueB. It results in NPE during kbase build.
{noformat}
java.lang.NullPointerException
at org.drools.modelcompiler.constraints.ConstraintEvaluator.findPatternAndRequiredDeclaration(ConstraintEvaluator.java:97)
at org.drools.modelcompiler.constraints.ConstraintEvaluator.<init>(ConstraintEvaluator.java:67)
at org.drools.modelcompiler.KiePackagesBuilder.createSingleConstraint(KiePackagesBuilder.java:1064)
at org.drools.modelcompiler.KiePackagesBuilder.createConstraint(KiePackagesBuilder.java:1049)
at org.drools.modelcompiler.KiePackagesBuilder.addConstraintsToPattern(KiePackagesBuilder.java:1043)
at org.drools.modelcompiler.KiePackagesBuilder.buildPattern(KiePackagesBuilder.java:730)
at org.drools.modelcompiler.KiePackagesBuilder.recursivelyAddConditions(KiePackagesBuilder.java:624)
at org.drools.modelcompiler.KiePackagesBuilder.buildAccumulate(KiePackagesBuilder.java:581)
at org.drools.modelcompiler.KiePackagesBuilder.conditionToElement(KiePackagesBuilder.java:493)
at org.drools.modelcompiler.KiePackagesBuilder.addSubConditions(KiePackagesBuilder.java:655)
at org.drools.modelcompiler.KiePackagesBuilder.populateLHS(KiePackagesBuilder.java:449)
at org.drools.modelcompiler.KiePackagesBuilder.compileRule(KiePackagesBuilder.java:249)
at org.drools.modelcompiler.KiePackagesBuilder.build(KiePackagesBuilder.java:220)
at org.drools.modelcompiler.CanonicalKieModule.createKiePackages(CanonicalKieModule.java:306)
at org.drools.modelcompiler.CanonicalKieModule.lambda$1(CanonicalKieModule.java:213)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.drools.modelcompiler.CanonicalKieModule.createKieBase(CanonicalKieModule.java:213)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:470)
{noformat}
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 10 months