flowable/flowable-engine · error · FlowableException

text is null

Error message

text is null

What it means

DmnDeploymentBuilderImpl.addString registers an in-memory String as a deployment resource. A FlowableException('text is null') is thrown as a defensive argument check when the caller passes null text, since the builder would otherwise store null bytes on the DmnResourceEntity. It is a fast-fail validation guard, not a state error.

Source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/repository/DmnDeploymentBuilderImpl.java:94

    }

    @Override
    public DmnDeploymentBuilder addClasspathResource(String resource) {
        try (final InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(resource)) {
            if (inputStream == null) {
                throw new FlowableException("resource '" + resource + "' not found");
            }
            return addInputStream(resource, inputStream);
            
        } catch (IOException ex) {
            throw new FlowableException("Failed to read resource " + resource, ex);
        }
    }

    @Override
    public DmnDeploymentBuilder addString(String resourceName, String text) {
        if (text == null) {
            throw new FlowableException("text is null");
        }

        DmnResourceEntity resource = resourceEntityManager.create();
        resource.setName(resourceName);
        resource.setBytes(text.getBytes(StandardCharsets.UTF_8));
        deployment.addResource(resource);
        return this;
    }

    @Override
    public DmnDeploymentBuilder addDmnBytes(String resourceName, byte[] dmnBytes) {
        if (dmnBytes == null) {
            throw new FlowableException("dmn bytes is null");
        }

        DmnResourceEntity resource = resourceEntityManager.create();
        resource.setName(resourceName);
        resource.setBytes(dmnBytes);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Ensure the String passed to addString is non-null before calling; validate or fail fast at the call site.
  2. If using addDmnModel, check that the DmnModel is properly initialized and the XML conversion returns a non-empty string.
  3. Fix the source of the null: missing config value, failed file read, or unpopulated variable that should contain the DMN XML.

Example fix

// before
String dmnXml = config.getDmnXml(); // may be null
repositoryService.createDeployment().addString("decision.dmn", dmnXml);
// after
String dmnXml = config.getDmnXml();
if (dmnXml == null || dmnXml.isEmpty()) {
    throw new IllegalArgumentException("dmnXml configuration is missing");
}
repositoryService.createDeployment().addString("decision.dmn", dmnXml);
Defensive patterns

Strategy: validation

Validate before calling

Objects.requireNonNull(dmnXml, "DMN XML text must not be null");
if (dmnXml.trim().isEmpty()) {
    throw new IllegalArgumentException("DMN XML text must not be empty");
}

Try / catch

try {
    builder.addString("decision.dmn", dmnXml);
} catch (FlowableException e) {
    if ("text is null".equals(e.getMessage())) {
        throw new IllegalArgumentException("Supplied DMN text was null", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling addString(resourceName, text) with a null second argument, directly or indirectly — including via addDmnModel when the model-to-string conversion (e.g. DmnXMLConverter.convertToDmnXML returning null) produces a null string.

Common situations: Converting a DmnModel to XML with a converter that returns null for an empty/uninitialized model, loading the DMN content from a config/property/env value that is missing and defaults to null, or dynamically generated DMN text where an upstream builder silently produced null.

Related errors


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