flowable/flowable-engine · error · FlowableException

Could not create execution variable

Error message

Could not create execution variable

What it means

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().

Source

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

            } else if (StringUtils.equals("date", type)) {
                if (expressionResult instanceof Date) {
                    executionVariable = expressionResult;
                } else if (expressionResult instanceof Instant instant) {
                    executionVariable = Date.from(instant);
                } else if (expressionResult instanceof LocalDate localDate) {
                    executionVariable = Date.from(localDate.atStartOfDay().atZone(ZoneOffset.UTC).toInstant());
                } else if (expressionResult instanceof LocalDateTime localDateTime) {
                    executionVariable = Date.from(localDateTime.atZone(ZoneOffset.UTC).toInstant());
                } else {
                    executionVariable = DateUtil.parseDate(expressionResult.toString());
                }
            } else {
                LOGGER.error("could not create result variable: unrecognized mapping type");
                throw new FlowableException("could not create result variable: unrecognized mapping type");
            }
        } catch (Exception e) {
            LOGGER.error("could not create result variable", e);
            throw new FlowableException("Could not create execution variable", e);
        }

        return executionVariable;
    }

    public static List<Object> getExecutionVariables(String type, List<Object> expressionResults) {
        if (type == null || expressionResults == null) {
            return null;
        }

        List<Object> executionVariables = new ArrayList<>();
        for (Object expressionResult : expressionResults) {
            executionVariables.add(getExecutionVariable(type, expressionResult));
        }

        return executionVariables;
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Inspect the chained cause (e.getCause()) — the wrapped exception names the real failure, usually 'unrecognized mapping type'.
  2. 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).
  3. 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).
  4. If a custom type was carried over from another Flowable version, register or map it explicitly instead of relying on the default mapping.
  5. Upgrade/downgrade the dmn-engine module so the mapping type matches the one documented for your Flowable version.

Example fix

// before (DMN decision table output)
<outputEntry name="result" type="varchar">...</outputEntry>
// after
<outputEntry name="result" type="string">...</outputEntry>
Defensive patterns

Strategy: try-catch

Validate before calling

Set<String> supported = Set.of("string","boolean","integer","long","double","date","list");
if (!supported.contains(resultType)) throw new IllegalArgumentException("unsupported result type: " + resultType);

Type guard

boolean isSupportedResultType(Object result) {
    return result instanceof String || result instanceof Boolean || result instanceof Number
        || result instanceof java.util.Date || result instanceof java.util.List;
}

Try / catch

try {
    Object var = ExecutionVariableFactory.getExecutionVariable(type, exprResult);
} catch (FlowableException e) {
    throw new IllegalArgumentException("DMN result conversion failed (type=" + type + "): " + e.getCause(), e);
}

Prevention

When it happens

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

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

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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