You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "gitgabrio (via GitHub)" <gi...@apache.org> on 2024/11/14 15:54:21 UTC
[I] Correctly manage execution of invalid models Edit Add comment Assign More In Progress Share this issue Export [incubator-kie-issues]
gitgabrio opened a new issue, #1619:
URL: https://github.com/apache/incubator-kie-issues/issues/1619
Inside
```java
DMNFEELHelper#compileFeelExpression(DMNCompilerContext, String, DMNModelImpl, DMNElement, Msg.Message, Object...) {
...
CompiledExpression ce = feel.compile( expression, feelctx );
processEvents( model, element, errorMsg, msgParams );
return ce;
}
```
a CompiledExpression is returned even in presence of Syntax errors, that are simply sent to MsgUtil.
Then, the calling code
```java
DMNEvaluatorCompiler#compileLiteralExpression(DMNCompilerContext, DMNModelImpl, DMNBaseNode, String, LiteralExpression) {
...
CompiledExpression compiledExpression = ctx.getFeelHelper().compileFeelExpression(ctx,
exprText,
model,
expression,
Msg.ERR_COMPILING_FEEL_EXPR_FOR_NAME_ON_NODE,
exprText,
exprName,
node.getIdentifierString() );
evaluator = new DMNLiteralExpressionEvaluator(compiledExpression, expression, ctx.getFeelHelper().newFEELInstance());
...
```
ignores the error messages, set the evaluator, and uses it to evalute the model.
The result of all that is inconsistent, since
1. on one side, the expression has syntax errors, so it should be completely discarded
2. but on the other side, an evaluator is instantiated and fired, leading to some kind of result.
This is demonstrated by the attached [DMN-Invalid.txt](https://github.com/user-attachments/files/17751196/DMN-Invalid.txt)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org