Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly manage execution of invalid models #1619

Open
gitgabrio opened this issue Nov 14, 2024 · 0 comments
Open

Correctly manage execution of invalid models #1619

gitgabrio opened this issue Nov 14, 2024 · 0 comments
Assignees
Labels
area:dmn Related to DMN area:engine Related to the runtime engines type:tech-debt Things that were left behind an may harm us in the future.

Comments

@gitgabrio
Copy link

gitgabrio commented Nov 14, 2024

Inside

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

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

@gitgabrio gitgabrio self-assigned this Nov 14, 2024
@gitgabrio gitgabrio added area:dmn Related to DMN area:engine Related to the runtime engines type:tech-debt Things that were left behind an may harm us in the future. labels Nov 14, 2024
@gitgabrio gitgabrio changed the title Correctly manage execution of invalid models Edit Add comment Assign More In Progress Share this issue Export Correctly manage execution of invalid models Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dmn Related to DMN area:engine Related to the runtime engines type:tech-debt Things that were left behind an may harm us in the future.
Projects
None yet
Development

No branches or pull requests

1 participant