-
Bug
-
Resolution: Done
-
Major
-
7.73.0.Final, 8.32.0.Final
-
None
-
2022 Week 41-43 (from Oct 10), 2022 Week 44-46 (from Oct 31), 2022 Week 47-49 (from Nov 21), 2022 Week 50-02 (from Dec 12)
-
3
-
-
Compatibility/Configuration
-
Workaround Exists
-
-
Set a Value
-
NEW
-
NEW
-
---
-
---
When using modify keyword, using this was allowed in DRL with mvel:
package drools.issues; dialect "mvel" rule "Modify fact without noloop will finish because of max number of executions" when $p:drools.issues.model.Person(address.visitors.value >= 0) then modify($p) { address.visitors.setValue(1) } end
but now it fails with executable model, these messages are generated:
Message [id=1, level=ERROR, path=src/main/java/drools/issues/PE8/LambdaConsequenceE8EF572C5F769FC95AE898113C2F8B70.java, line=21, column=718 text=address.visitors cannot be resolved to a type] Message [id=2, level=ERROR, path=src/main/java/drools/issues/PE8/LambdaConsequenceE8EF572C5F769FC95AE898113C2F8B70.java, line=0, column=0 text=Java source of src/main/java/drools/issues/PE8/LambdaConsequenceE8EF572C5F769FC95AE898113C2F8B70.java in error: package drools.issues.PE8; import static drools.issues.RulesDAD2D3B10D8BA86B61E204CF7EB94CC9.*; import drools.issues.*; import org.drools.modelcompiler.dsl.pattern.D; @org.drools.compiler.kie.builder.MaterializedLambda() public enum LambdaConsequenceE8EF572C5F769FC95AE898113C2F8B70 implements org.drools.model.functions.Block1<drools.issues.model.Person>, org.drools.model.functions.HashedExpression { INSTANCE; public static final String EXPRESSION_HASH = "D8F99B450BB690F8DC1774FBAFDCAFD9"; public java.lang.String getExpressionHash() { return EXPRESSION_HASH; } @Override() public void execute(drools.issues.model.Person $p) throws java.lang.Exception { { address.visitors.setValue(1); } } } ]
the model executor compiler does not take into account that address is a property of Person.
However, when using this syntax in modify:
package drools.issues; dialect "mvel" rule "Modify fact without noloop will finish because of max number of executions" when $p:drools.issues.model.Person(address.visitors.value >= 0) then modify($p) { getAddress().getVisitors().setValue(1) } end
both mvel runtime and executable model work well.
- is related to
-
DROOLS-5242 Executable model silently ignores a malformed modify statement
- Resolved
- relates to
-
DROOLS-7250 executable-model fails with mvel boolean property assignment in RHS
- Resolved