flowable/flowable-engine · error · FlowableException

could not create result variable

Error message

could not create result variable

What it means

Thrown by ExecutionVariableFactory.getExecutionVariable when the mapping type or the expression result is null — it cannot build a typed execution variable without both. The factory converts raw expression results (Boolean, String, Double, date-like values) into variables of the declared type (boolean|string|number|date) used for DMN output/execution results.

Solutions

  1. Ensure the output expression yields a non-null value (use an IF-ELSE output expression or a default value in the DMN model).
  2. Check that the output clause's type is set (boolean/string/number/date) in the DMN XML or model before evaluation.
  3. If nulls are expected, filter or substitute them before calling getExecutionVariables, or handle null outputs as 'no output' in your integration.
  4. When calling the factory directly, assert both arguments non-null and fail with a domain-specific message.

Example fix

// before
Object v = ExecutionVariableFactory.getExecutionVariable(outputType, expressionResult); // expressionResult may be null
// after
if (outputType != null && expressionResult != null) {
    Object v = ExecutionVariableFactory.getExecutionVariable(outputType, expressionResult);
} else {
    // treat as missing output: skip, default, or raise a validation error
}
Defensive patterns

Strategy: validation

Validate before calling

if (type != null && expressionResult != null) {
    Object v = ExecutionVariableFactory.getExecutionVariable(type, expressionResult);
}

Type guard

boolean convertible(String type, Object result) { return type != null && result != null; }

Try / catch

try {
    Object v = ExecutionVariableFactory.getExecutionVariable(type, result);
} catch (FlowableException e) {
    if ("could not create result variable".equals(e.getMessage())) {
        // null type or null expression result: log and treat as missing output
    } else { throw e; }
}

Prevention

When it happens

Trigger: Calling getExecutionVariable(type, expressionResult) (directly or via getExecutionVariables) with a null type or a null expressionResult — e.g. an output entry evaluated to null but the DMN rule still declares an output, or a hit-policy result list containing nulls.

Common situations: Output expressions that legitimately evaluate to null/empty at runtime; decision tables with output clauses whose type was never set (null type string); custom code consuming the factory with unvalidated expression results.

Related errors


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

Appendix: source

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

import org.apache.commons.lang3.StringUtils;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.impl.util.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

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

    public static Object getExecutionVariable(String type, Object expressionResult) {

        if (type == null || expressionResult == null) {
            LOGGER.error("could not create result variable: type {} expression result {}", type, expressionResult);
            throw new FlowableException("could not create result variable");
        }

        Object executionVariable;

        try {
            if (StringUtils.equals("boolean", type)) {
                if (expressionResult instanceof Boolean) {
                    executionVariable = expressionResult;
                } else {
                    executionVariable = Boolean.valueOf(expressionResult.toString());
                }
            } else if (StringUtils.equals("string", type)) {
                if (expressionResult instanceof String) {
                    executionVariable = expressionResult;
                } else {
                    executionVariable = expressionResult.toString();
                }
            } else if (StringUtils.equals("number", type)) {

View on GitHub (pinned to d6d39ce1c6)