{"record":{"id":"62db874fb0cddf3f","repo":"flowable/flowable-engine","slug":"variable-id-cannot-be-empty","errorCode":null,"errorMessage":"Variable id cannot be empty","messagePattern":"Variable id cannot be empty","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ELExecutionContext.java","lineNumber":41,"sourceCode":"\n/**\n * @author Yvo Swillens\n */\npublic class ELExecutionContext {\n\n    protected Map<Integer, Map<String, Object>> ruleResults = new LinkedHashMap<>();\n    protected Map<String, Object> stackVariables;\n    protected DecisionExecutionAuditContainer auditContainer;\n    protected Map<String, List<Object>> outputValues = new LinkedHashMap<>();\n    protected BuiltinAggregator aggregator;\n    protected String instanceId;\n    protected String scopeType;\n    protected String tenantId;\n    protected boolean forceDMN11;\n\n    public void checkExecutionContext(String variableId) {\n        if (StringUtils.isEmpty(variableId)) {\n            throw new IllegalArgumentException(\"Variable id cannot be empty\");\n        }\n    }\n\n    public void addRuleResult(int ruleNumber, String outputName, Object outputValue) {\n        Map<String, Object> ruleResult;\n        if (ruleResults.containsKey(ruleNumber)) {\n            ruleResult = ruleResults.get(ruleNumber);\n        } else {\n            ruleResult = new HashMap<>();\n            ruleResults.put(ruleNumber, ruleResult);\n        }\n        ruleResult.put(outputName, outputValue);\n    }\n\n    public void setStackVariables(Map<String, Object> variables) {\n        this.stackVariables = variables;\n    }\n","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ELExecutionContext.java#L23-L59","documentation":"ELExecutionContext.checkExecutionContext throws plain IllegalArgumentException when the variable id passed during EL expression evaluation is empty. It protects the DMN expression-evaluation context from resolving blank variable names.","triggerScenarios":"Evaluating an input expression that references a variable whose id is null/empty — e.g. DMN XML with <input> expression text blank or whitespace, or a variable map with empty-string keys fed to the decision-table execution.","commonSituations":"Hand-written DMN expressions referencing variables never declared; generated DMN from tooling that emits empty variable names; programmatic execution with executionInputVariables built from a map containing empty keys.","solutions":["Fix the DMN XML so input expressions reference non-empty variable names (e.g. ${age} not ${} ).","Validate the input-variable map: remove/repair entries with null or empty keys before executing the decision table.","Catch IllegalArgumentException around decision execution and report the offending expression.","Validate DMN files against the XSD before deployment to catch empty expressions early."],"exampleFix":"// before\nMap<String, Object> inputs = new HashMap<>();\ninputs.put(\"\", 42); // empty variable id\n// after\nMap<String, Object> inputs = new HashMap<>();\ninputs.put(\"amount\", 42);","handlingStrategy":"validation","validationCode":"for (String key : executionInputVariables.keySet()) {\n    if (key == null || key.trim().isEmpty()) {\n        throw new IllegalArgumentException(\"Input variable id must be non-empty\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    dmnEngine.evaluateDecisionTableByKey(\"myTable\", inputs);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"Variable id\")) { /* blank variable reference in DMN */ }\n}","preventionTips":["Check DMN input expressions for empty variable references","Sanitize input maps against empty keys","Validate DMN files against the XSD before deployment"],"tags":["flowable","dmn","el","empty-string","variable"],"backgroundTag":"empty-required-field","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}