flowable/flowable-engine · error · IllegalArgumentException

execution context is required

Error message

execution context is required

What it means

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.

Source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ELExpressionExecutor.java:43

/**
 * @author Yvo Swillens
 */
public class ELExpressionExecutor {

    private static final Logger LOGGER = LoggerFactory.getLogger(ELExpressionExecutor.class);

    public static Boolean executeInputExpression(InputClause inputClause, UnaryTests inputEntry, ExpressionManager expressionManager, ELExecutionContext executionContext) {
        if (inputClause == null) {
            throw new IllegalArgumentException("input clause is required");
        }
        if (inputClause.getInputExpression() == null) {
            throw new IllegalArgumentException("input expression is required");
        }
        if (inputEntry == null) {
            throw new IllegalArgumentException("input entry is required");
        }
        if (executionContext == null) {
            throw new IllegalArgumentException("execution context is required");
        }
        
        String inputExpression = inputClause.getInputExpression().getText();
        executionContext.checkExecutionContext(inputExpression);
        
        // pre parse expression
        String parsedExpression = ELInputEntryExpressionPreParser.parse(inputEntry.getText(), inputExpression, inputClause.getInputExpression().getTypeRef());

        Expression expression = expressionManager.createExpression(parsedExpression);
        RuleExpressionCondition condition = new RuleExpressionCondition(expression);
        
        try {
            return condition.evaluate(executionContext.getStackVariables(), executionContext);
        } catch (Exception ex) {
            LOGGER.warn("Error while executing input entry: {}", parsedExpression, ex);
            throw new FlowableDmnExpressionException("error while executing input entry", parsedExpression, ex);
        }
    }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Create and pass an ELExecutionContext populated with the decision's input variables before calling the executor.
  2. If invoking outside the engine, replicate the context setup the engine performs (stack variables, execution info) rather than passing null.
  3. Refactor to run the evaluation through the DMN engine (DmnDecisionTableManager/RuleEngineExecutor) so the context is constructed for you.
  4. Assert non-null arguments at the call site with Objects.requireNonNull to fail with a clearer stack trace.

Example fix

// before
Boolean hit = ELExpressionExecutor.executeInputExpression(clause, inputEntry, expressionManager, null);
// after
ELExecutionContext ctx = new ELExecutionContext();
ctx.setStackVariables(variables);
Boolean hit = ELExpressionExecutor.executeInputExpression(clause, inputEntry, expressionManager, ctx);
Defensive patterns

Strategy: validation

Validate before calling

Objects.requireNonNull(executionContext, "ELExecutionContext must be built before expression evaluation");

Try / catch

try {
    ELExpressionExecutor.executeInputExpression(clause, entry, em, ctx);
} catch (IllegalArgumentException e) {
    if ("execution context is required".equals(e.getMessage())) {
        // context was never created: initialize engine-side evaluation flow
    } else { throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/8199ea02ceda82c0. Report an issue: GitHub.