{"record":{"id":"7ac921bd1a2ba02b","repo":"flowable/flowable-engine","slug":"no-errorcode-defined-mapexception-with-errorcode","errorCode":null,"errorMessage":"No errorCode defined mapException with errorCode=${errorCode} and class=${exceptionClass}","messagePattern":"No errorCode defined mapException with errorCode=(.+?) and class=(.+?)","errorType":"exception","errorClass":"XMLException","httpStatus":null,"severity":"error","filePath":"modules/flowable-bpmn-converter/src/main/java/org/flowable/bpmn/converter/child/FlowableMapExceptionParser.java","lineNumber":56,"sourceCode":"            return;\r\n        }\r\n\r\n        String errorCode = xtr.getAttributeValue(null, MAP_EXCEPTION_ERRORCODE);\r\n        String andChildren = xtr.getAttributeValue(null, MAP_EXCEPTION_ANDCHILDREN);\r\n        String rootCause = xtr.getAttributeValue(null, MAP_EXCEPTION_ROOTCAUSE);\r\n        String exceptionClass = xtr.getElementText();\r\n        boolean hasChildrenBool = false;\r\n\r\n        if (StringUtils.isEmpty(andChildren) || \"false\".equals(andChildren.toLowerCase())) {\r\n            hasChildrenBool = false;\r\n        } else if (\"true\".equals(andChildren.toLowerCase())) {\r\n            hasChildrenBool = true;\r\n        } else {\r\n            throw new XMLException(\"'\" + andChildren + \"' is not valid boolean in mapException with errorCode=\" + errorCode + \" and class=\" + exceptionClass);\r\n        }\r\n\r\n        if (StringUtils.isEmpty(errorCode) || StringUtils.isEmpty(errorCode.trim())) {\r\n            throw new XMLException(\"No errorCode defined mapException with errorCode=\" + errorCode + \" and class=\" + exceptionClass);\r\n        }\r\n\r\n        ((Activity) parentElement).getMapExceptions().add(new MapExceptionEntry(errorCode, exceptionClass, hasChildrenBool, rootCause));\r\n    }\r\n}\r\n","sourceCodeStart":38,"sourceCodeEnd":62,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-bpmn-converter/src/main/java/org/flowable/bpmn/converter/child/FlowableMapExceptionParser.java#L38-L62","documentation":"When parsing a <mapException> element the converter requires a non-empty errorCode attribute, because the error code is the key used to match thrown exceptions to their mapped Java class. An empty or missing errorCode makes the parser throw XMLException.","triggerScenarios":"Parsing BPMN XML with <flowable:mapException exceptionClass=\"...\"/> lacking an errorCode attribute, or with errorCode=\"\" or whitespace only.","commonSituations":"Copy-pasted mapException elements where errorCode was removed; modelers generating incomplete attributes; template placeholders like ${errorCode} not substituted before deployment.","solutions":["Add a non-empty errorCode attribute to the mapException element","Remove the empty/placeholder mapException element if it is unused","Redeploy the process definition after the fix"],"exampleFix":"<!-- before -->\n<flowable:mapException errorCode=\"\" exceptionClass=\"java.lang.Exception\"/>\n<!-- after -->\n<flowable:mapException errorCode=\"MY_ERR\" exceptionClass=\"java.lang.Exception\"/>","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { bpmnXMLConverter.convertToBpmnModel(xmlInput); } catch (XMLException e) { /* add missing errorCode */ }","preventionTips":["Ensure every mapException has a non-empty errorCode"],"tags":["bpmn","xml-parsing","validation"],"backgroundTag":"missing-required-argument","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"}