{"record":{"id":"2fe5495ab5725179","repo":"flowable/flowable-engine","slug":"could-not-create-execution-variable","errorCode":null,"errorMessage":"Could not create execution variable","messagePattern":"Could not create execution variable","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ExecutionVariableFactory.java","lineNumber":88,"sourceCode":"            } else if (StringUtils.equals(\"date\", type)) {\n                if (expressionResult instanceof Date) {\n                    executionVariable = expressionResult;\n                } else if (expressionResult instanceof Instant instant) {\n                    executionVariable = Date.from(instant);\n                } else if (expressionResult instanceof LocalDate localDate) {\n                    executionVariable = Date.from(localDate.atStartOfDay().atZone(ZoneOffset.UTC).toInstant());\n                } else if (expressionResult instanceof LocalDateTime localDateTime) {\n                    executionVariable = Date.from(localDateTime.atZone(ZoneOffset.UTC).toInstant());\n                } else {\n                    executionVariable = DateUtil.parseDate(expressionResult.toString());\n                }\n            } else {\n                LOGGER.error(\"could not create result variable: unrecognized mapping type\");\n                throw new FlowableException(\"could not create result variable: unrecognized mapping type\");\n            }\n        } catch (Exception e) {\n            LOGGER.error(\"could not create result variable\", e);\n            throw new FlowableException(\"Could not create execution variable\", e);\n        }\n\n        return executionVariable;\n    }\n\n    public static List<Object> getExecutionVariables(String type, List<Object> expressionResults) {\n        if (type == null || expressionResults == null) {\n            return null;\n        }\n\n        List<Object> executionVariables = new ArrayList<>();\n        for (Object expressionResult : expressionResults) {\n            executionVariables.add(getExecutionVariable(type, expressionResult));\n        }\n\n        return executionVariables;\n    }\n}","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ExecutionVariableFactory.java#L70-L106","documentation":"Flowable DMN wraps any exception raised while converting a DMN decision-table hit-policy result (the expression output) into an execution variable via ExecutionVariableFactory. The outer catch (Exception e) rethrows all failures — unrecognized mapping types, reflection/constructor failures, conversion errors — under this generic message with the original cause attached. The real reason is always in the chained cause, so inspect getCause().","triggerScenarios":"Calling getExecutionVariable(type, expressionResult) with a 'type' string that maps to no known result-variable mapping type, or with an expressionResult that the chosen factory (e.g. ReflectUtil-based instantiation or String/List conversion) cannot convert.","commonSituations":"DMN decision table output entry uses a custom or misspelled result type name; hit-policy result type changed across Flowable versions (e.g. renamed mapping type); expression returns a value whose class has no matching constructor for the target type.","solutions":["Inspect the chained cause (e.getCause()) — the wrapped exception names the real failure, usually 'unrecognized mapping type'.","Check the resultType / type string used in the DMN decision table output; it must match a supported mapping type in ExecutionVariableFactory (e.g. string, boolean, date, double, integer, long).","Verify the expression result's runtime type is compatible with the declared result type (e.g. a String result for a 'date' type must parse as a date).","If a custom type was carried over from another Flowable version, register or map it explicitly instead of relying on the default mapping.","Upgrade/downgrade the dmn-engine module so the mapping type matches the one documented for your Flowable version."],"exampleFix":"// before (DMN decision table output)\n<outputEntry name=\"result\" type=\"varchar\">...</outputEntry>\n// after\n<outputEntry name=\"result\" type=\"string\">...</outputEntry>","handlingStrategy":"try-catch","validationCode":"Set<String> supported = Set.of(\"string\",\"boolean\",\"integer\",\"long\",\"double\",\"date\",\"list\");\nif (!supported.contains(resultType)) throw new IllegalArgumentException(\"unsupported result type: \" + resultType);","typeGuard":"boolean isSupportedResultType(Object result) {\n    return result instanceof String || result instanceof Boolean || result instanceof Number\n        || result instanceof java.util.Date || result instanceof java.util.List;\n}","tryCatchPattern":"try {\n    Object var = ExecutionVariableFactory.getExecutionVariable(type, exprResult);\n} catch (FlowableException e) {\n    throw new IllegalArgumentException(\"DMN result conversion failed (type=\" + type + \"): \" + e.getCause(), e);\n}","preventionTips":["Only use mapping types documented in ExecutionVariableFactory for your Flowable version.","Check e.getCause() when this wrapper fires — the real error is always chained.","Verify expression result class matches the declared output type in the decision table.","Add a unit test per output type used in your DMN tables.","Pin Flowable version and re-validate types after upgrades."],"tags":["dmn","expression-evaluation","variable-conversion"],"backgroundTag":"invalid-argument-value","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"}