{"record":{"id":"55330c3fb327fe97","repo":"flowable/flowable-engine","slug":"error-converting-text-annotation","errorCode":null,"errorMessage":"Error converting text annotation","messagePattern":"Error converting text annotation","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-converter/src/main/java/org/flowable/cmmn/converter/TextXmlConverter.java","lineNumber":45,"sourceCode":"    @Override\n    public String getXMLElementName() {\n        return CmmnXmlConstants.ELEMENT_TEXT;\n    }\n    \n    @Override\n    public boolean hasChildElements() {\n        return false;\n    }\n\n    @Override\n    protected CmmnElement convert(XMLStreamReader xtr, ConversionHelper conversionHelper) {\n        CmmnElement currentCmmnElement = conversionHelper.getCurrentCmmnElement();\n        try {\n            if (currentCmmnElement instanceof TextAnnotation textAnnotation) {\n                textAnnotation.setText(xtr.getElementText());\n            }\n        } catch (XMLStreamException e) {\n            throw new FlowableException(\"Error converting text annotation\", e);\n        }\n\n        return null;\n    }\n    \n}\n","sourceCodeStart":27,"sourceCodeEnd":52,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-converter/src/main/java/org/flowable/cmmn/converter/TextXmlConverter.java#L27-L52","documentation":"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.","triggerScenarios":"Converting CMMN XML containing an artifact/text annotation whose <text> element is malformed, unclosed, or contains invalid characters.","commonSituations":"Hand-edited text annotations; copy-pasted text with illegal XML characters (control chars); truncated files; encoding mismatches.","solutions":["Validate the XML and fix the <text> element inside the text annotation.","Remove or escape illegal XML characters (e.g. control characters) in the annotation text.","Check the cause exception for line/column of the failure.","Re-create the annotation in the modeler."],"exampleFix":"// before\n<text>some notes \u0003</text>\n// after\n<text>some notes</text>","handlingStrategy":"try-catch","validationCode":"// Strip illegal XML control chars from annotation text before writing XML\ntext.replaceAll(\"[\\\\u0000-\\\\u0008\\\\u000B\\\\u000C\\\\u000E-\\\\u001F]\", \"\");","typeGuard":null,"tryCatchPattern":"try {\n    CmmnModel model = converter.convertToCmmnModel(in);\n} catch (FlowableException e) {\n    throw new IllegalStateException(\"Cannot read text annotation: \" + e.getCause(), e);\n}","preventionTips":["Escape/strip control characters from annotation text","Schema-validate the CMMN XML before conversion","Avoid pasting text from rich editors directly into XML"],"tags":["cmmn","xml-parsing","text-annotation"],"backgroundTag":"file-read-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}