{"record":{"id":"8199ea02ceda82c0","repo":"flowable/flowable-engine","slug":"execution-context-is-required","errorCode":null,"errorMessage":"execution context is required","messagePattern":"execution context is required","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ELExpressionExecutor.java","lineNumber":43,"sourceCode":"/**\n * @author Yvo Swillens\n */\npublic class ELExpressionExecutor {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(ELExpressionExecutor.class);\n\n    public static Boolean executeInputExpression(InputClause inputClause, UnaryTests inputEntry, ExpressionManager expressionManager, ELExecutionContext executionContext) {\n        if (inputClause == null) {\n            throw new IllegalArgumentException(\"input clause is required\");\n        }\n        if (inputClause.getInputExpression() == null) {\n            throw new IllegalArgumentException(\"input expression is required\");\n        }\n        if (inputEntry == null) {\n            throw new IllegalArgumentException(\"input entry is required\");\n        }\n        if (executionContext == null) {\n            throw new IllegalArgumentException(\"execution context is required\");\n        }\n        \n        String inputExpression = inputClause.getInputExpression().getText();\n        executionContext.checkExecutionContext(inputExpression);\n        \n        // pre parse expression\n        String parsedExpression = ELInputEntryExpressionPreParser.parse(inputEntry.getText(), inputExpression, inputClause.getInputExpression().getTypeRef());\n\n        Expression expression = expressionManager.createExpression(parsedExpression);\n        RuleExpressionCondition condition = new RuleExpressionCondition(expression);\n        \n        try {\n            return condition.evaluate(executionContext.getStackVariables(), executionContext);\n        } catch (Exception ex) {\n            LOGGER.warn(\"Error while executing input entry: {}\", parsedExpression, ex);\n            throw new FlowableDmnExpressionException(\"error while executing input entry\", parsedExpression, ex);\n        }\n    }","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ELExpressionExecutor.java#L25-L61","documentation":"Thrown by ELExpressionExecutor.executeInputExpression (and identically by executeOutputExpression) when the ELExecutionContext argument is null. The execution context supplies the stack variables and hit-policy state needed to evaluate expressions, so a null context makes evaluation impossible and the executor throws IllegalArgumentException up front.","triggerScenarios":"Passing null as the ELExecutionContext argument to executeInputExpression/executeOutputExpression — e.g. calling the executor outside a decision-table evaluation flow where the context would normally be created by the engine.","commonSituations":"Unit-testing the executor without building an ELExecutionContext; custom integrations invoking ELExpressionExecutor directly after loading a DMN model, forgetting to construct the context with the input variables.","solutions":["Create and pass an ELExecutionContext populated with the decision's input variables before calling the executor.","If invoking outside the engine, replicate the context setup the engine performs (stack variables, execution info) rather than passing null.","Refactor to run the evaluation through the DMN engine (DmnDecisionTableManager/RuleEngineExecutor) so the context is constructed for you.","Assert non-null arguments at the call site with Objects.requireNonNull to fail with a clearer stack trace."],"exampleFix":"// before\nBoolean hit = ELExpressionExecutor.executeInputExpression(clause, inputEntry, expressionManager, null);\n// after\nELExecutionContext ctx = new ELExecutionContext();\nctx.setStackVariables(variables);\nBoolean hit = ELExpressionExecutor.executeInputExpression(clause, inputEntry, expressionManager, ctx);","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(executionContext, \"ELExecutionContext must be built before expression evaluation\");","typeGuard":null,"tryCatchPattern":"try {\n    ELExpressionExecutor.executeInputExpression(clause, entry, em, ctx);\n} catch (IllegalArgumentException e) {\n    if (\"execution context is required\".equals(e.getMessage())) {\n        // context was never created: initialize engine-side evaluation flow\n    } else { throw e; }\n}","preventionTips":["Never call ELExpressionExecutor directly without building an ELExecutionContext","Prefer the public DMN engine API which constructs the context for you","Reuse one context instance across input and output evaluation","Add requireNonNull asserts in test helpers that exercise the executor"],"tags":["java","dmn","null-argument","expression-evaluation"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}