{"record":{"id":"8dd86b1f3fc2c9f3","repo":"flowable/flowable-engine","slug":"could-not-create-result-variable-unrecognized-map","errorCode":null,"errorMessage":"could not create result variable: unrecognized mapping type","messagePattern":"could not create result variable: unrecognized mapping type","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":84,"sourceCode":"                    executionVariable = ((BigInteger) expressionResult).longValue();\n                } else {\n                    executionVariable = Double.valueOf(expressionResult.toString());\n                }\n            } 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        }","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/ExecutionVariableFactory.java#L66-L102","documentation":"Thrown by ExecutionVariableFactory.getExecutionVariable when the declared mapping type is not one of the four supported values (boolean, string, number, date). The factory has no conversion rule for the given type string, so it aborts; note the inner throw is then caught and rethrown as 'Could not create execution variable' with the cause chained by the surrounding catch block.","triggerScenarios":"Calling getExecutionVariable with a type string outside {boolean,string,number,date} — e.g. a DMN output clause whose type is 'long', 'integer', 'json', a custom type name, or a capitalized/mispelled type like 'Boolean' or 'numerical'.","commonSituations":"DMN models authored with richer output types than the engine's mapping supports; type names produced by converters that don't normalize to the four supported strings; custom integrations passing an output type straight from a config file or UI dropdown.","solutions":["Set the output clause type to one of the supported values: boolean, string, number, or date.","Normalize/validate the type string before calling (lowercase, map synonyms like 'long'/'integer'/'double' to 'number').","If a richer type is required, convert the expression result yourself instead of routing through ExecutionVariableFactory.","Catch FlowableException and log the offending type value so the model author can correct the DMN output definition."],"exampleFix":"// before\nString type = outputClause.getTypeRef(); // e.g. \"long\"\nObject v = ExecutionVariableFactory.getExecutionVariable(type, result);\n// after\nString type = \"long\".equals(outputClause.getTypeRef()) ? \"number\" : outputClause.getTypeRef();\nif (!List.of(\"boolean\", \"string\", \"number\", \"date\").contains(type)) {\n    throw new IllegalArgumentException(\"unsupported output type: \" + type);\n}\nObject v = ExecutionVariableFactory.getExecutionVariable(type, result);","handlingStrategy":"validation","validationCode":"if (!List.of(\"boolean\",\"string\",\"number\",\"date\").contains(type)) {\n    throw new IllegalArgumentException(\"unsupported output type: \" + type);\n}\nObject v = ExecutionVariableFactory.getExecutionVariable(type, result);","typeGuard":"boolean supportedType(String t) {\n    return \"boolean\".equals(t) || \"string\".equals(t) || \"number\".equals(t) || \"date\".equals(t);\n}","tryCatchPattern":"try {\n    Object v = ExecutionVariableFactory.getExecutionVariable(type, result);\n} catch (FlowableException e) {\n    LOGGER.error(\"Unrecognized DMN output mapping type '{}' or conversion failed\", type, e);\n    // normalize type or reject the model with a clear message\n}","preventionTips":["Restrict output clause types to boolean/string/number/date in your authoring UI or validator","Normalize synonyms (long/integer/double -> number) before conversion","Validate DMN output types at deploy/import time","Catch and rethrow with the offending type name included for faster diagnosis"],"tags":["java","dmn","invalid-argument-value","variable-conversion"],"backgroundTag":"invalid-enum-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}