{"record":{"id":"efede5cede2a8c52","repo":"flowable/flowable-engine","slug":"no-converter-for-flowelement-getclass-found","errorCode":null,"errorMessage":"No converter for ${flowElement.getClass()} found","messagePattern":"No converter for (.+?) found","errorType":"exception","errorClass":"XMLException","httpStatus":null,"severity":"error","filePath":"modules/flowable-bpmn-converter/src/main/java/org/flowable/bpmn/converter/BpmnXMLConverter.java","lineNumber":701,"sourceCode":"                if (StringUtils.isNotEmpty(adhocSubProcess.getCompletionCondition())) {\n                    xtw.writeStartElement(ELEMENT_COMPLETION_CONDITION);\n                    xtw.writeCData(adhocSubProcess.getCompletionCondition());\n                    xtw.writeEndElement();\n                }\n            }\n\n            for (Artifact artifact : subProcess.getArtifacts()) {\n                createXML(artifact, model, xtw);\n            }\n\n            xtw.writeEndElement();\n\n        } else {\n\n            BaseBpmnXMLConverter converter = convertersToXMLMap.get(flowElement.getClass());\n\n            if (converter == null) {\n                throw new XMLException(\"No converter for \" + flowElement.getClass() + \" found\");\n            }\n\n            converter.convertToXML(xtw, flowElement, model, options);\n        }\n    }\n\n    protected void createXML(Artifact artifact, BpmnModel model, XMLStreamWriter xtw) throws Exception {\n\n        BaseBpmnXMLConverter converter = convertersToXMLMap.get(artifact.getClass());\n\n        if (converter == null) {\n            throw new XMLException(\"No converter for \" + artifact.getClass() + \" found\");\n        }\n\n        converter.convertToXML(xtw, artifact, model, options);\n    }\n}\n","sourceCodeStart":683,"sourceCodeEnd":719,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-bpmn-converter/src/main/java/org/flowable/bpmn/converter/BpmnXMLConverter.java#L683-L719","documentation":"createXML(FlowElement, ...) looks up the XML writer converter in convertersToXMLMap by the flow element's class; if no BaseBpmnXMLConverter is registered for that concrete class it throws this XMLException. It means the model contains a FlowElement subtype the converter cannot serialize.","triggerScenarios":"Calling convertToXML on a BpmnModel that contains a FlowElement subclass not present in convertersToXMLMap — typically a custom FlowElement added programmatically, or a class introduced by a newer Flowable version being written by an older converter.","commonSituations":"Developers extending BpmnModel with custom flow elements without registering a matching converter via BpmnXMLConverter.addConverter (or without extending BaseBpmnXMLConverter); mixed Flowable versions between designer and engine.","solutions":["Register a converter for the custom element class with converter.addConverter(MyElement.class, MyConverter.class) before serialization.","Implement a BaseBpmnXMLConverter subclass for the unsupported element type (writeElementAttributes/writeChildElements).","Remove or replace the unsupported element in the model before calling convertToXML.","Align Flowable versions so the element type is one the converter knows."],"exampleFix":"// before\nmodel.addFlowElement(new MyCustomElement(\"id1\")); // no converter registered -> throws\nconverter.convertToXML(model, out);\n// after\nBpmnXMLConverter converter = new BpmnXMLConverter();\nconverter.addConverter(MyCustomElement.class, new MyCustomElementXMLConverter());\nconverter.convertToXML(model, out);","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean isSerializable(BpmnXMLConverter c, FlowElement el) {\n    return c != null && el != null\n        && c.getConvertersToXMLMap().containsKey(el.getClass()); // or track registered element classes yourself\n}","tryCatchPattern":"try {\n    converter.convertToXML(model, out);\n} catch (XMLException e) {\n    if (e.getMessage().startsWith(\"No converter for \")) {\n        throw new ModelSerializationException(\"Register a converter for the custom element (see addConverter)\", e);\n    }\n    throw e;\n}","preventionTips":["Always call addConverter for every custom FlowElement subclass before serialization","Write a round-trip test: convertToBpmnModel -> convertToXML -> convertToBpmnModel","Keep custom model extensions mirrored with custom XML converters in the same module"],"tags":["java","bpmn","converter","serialization"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}