flowable/flowable-engine · error · FlowableException

Error converting text annotation

Error message

Error converting text annotation

What it means

Thrown when the text content of a <text> child of a TextAnnotation cannot be read from the XML stream during CMMN conversion. The converter sets the text on the TextAnnotation; XMLStreamException is wrapped into this FlowableException.

Source

Thrown at modules/flowable-cmmn-converter/src/main/java/org/flowable/cmmn/converter/TextXmlConverter.java:45

    @Override
    public String getXMLElementName() {
        return CmmnXmlConstants.ELEMENT_TEXT;
    }
    
    @Override
    public boolean hasChildElements() {
        return false;
    }

    @Override
    protected CmmnElement convert(XMLStreamReader xtr, ConversionHelper conversionHelper) {
        CmmnElement currentCmmnElement = conversionHelper.getCurrentCmmnElement();
        try {
            if (currentCmmnElement instanceof TextAnnotation textAnnotation) {
                textAnnotation.setText(xtr.getElementText());
            }
        } catch (XMLStreamException e) {
            throw new FlowableException("Error converting text annotation", e);
        }

        return null;
    }
    
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Validate the XML and fix the <text> element inside the text annotation.
  2. Remove or escape illegal XML characters (e.g. control characters) in the annotation text.
  3. Check the cause exception for line/column of the failure.
  4. Re-create the annotation in the modeler.

Example fix

// before
<text>some notes </text>
// after
<text>some notes</text>
Defensive patterns

Strategy: try-catch

Validate before calling

// Strip illegal XML control chars from annotation text before writing XML
text.replaceAll("[\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F]", "");

Try / catch

try {
    CmmnModel model = converter.convertToCmmnModel(in);
} catch (FlowableException e) {
    throw new IllegalStateException("Cannot read text annotation: " + e.getCause(), e);
}

Prevention

When it happens

Trigger: Converting CMMN XML containing an artifact/text annotation whose <text> element is malformed, unclosed, or contains invalid characters.

Common situations: Hand-edited text annotations; copy-pasted text with illegal XML characters (control chars); truncated files; encoding mismatches.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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