{"record":{"id":"22293363344f4ea9","repo":"flowable/flowable-engine","slug":"errors-while-parsing-errorbuilder","errorCode":null,"errorMessage":"Errors while parsing:\n${errorBuilder}","messagePattern":"Errors while parsing:\n(.+?)","errorType":"validation","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java","lineNumber":192,"sourceCode":"                    List<ValidationError> validationErrors = processValidator.validate(bpmnModel);\n                    if (validationErrors != null && !validationErrors.isEmpty()) {\n\n                        StringBuilder warningBuilder = new StringBuilder();\n                        StringBuilder errorBuilder = new StringBuilder();\n\n                        for (ValidationError error : validationErrors) {\n                            if (error.isWarning()) {\n                                warningBuilder.append(error);\n                                warningBuilder.append(\"\\n\");\n                            } else {\n                                errorBuilder.append(error);\n                                errorBuilder.append(\"\\n\");\n                            }\n                        }\n\n                        // Throw exception if there is any error\n                        if (errorBuilder.length() > 0) {\n                            throw new ActivitiException(\"Errors while parsing:\\n\" + errorBuilder);\n                        }\n\n                        // Write out warnings (if any)\n                        if (warningBuilder.length() > 0) {\n                            LOGGER.warn(\"Following warnings encountered during process validation: {}\", warningBuilder);\n                        }\n\n                    }\n                }\n            }\n\n            bpmnModel.setSourceSystemId(sourceSystemId);\n            bpmnModel.setEventSupport(new FlowableEventSupport());\n\n            // Validation successful (or no validation)\n            transformProcessDefinitions();\n\n        } catch (Exception e) {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java#L174-L210","documentation":"After parsing a BPMN XML document, BpmnParse runs process validation and aggregates all errors into errorBuilder. If any validation problems were found, it throws this ActivitiException listing them all at once, aborting the parse/deployment.","triggerScenarios":"Deploying or parsing a BPMN 2.0 XML file that fails the process validator: e.g. references to undefined elements, invalid sequence-flow wiring, missing required attributes, duplicate ids.","commonSituations":"Importing diagrams exported by non-conforming tools; hand-edited process definitions; upgrading engine versions where validation rules became stricter; deploying many processes and only the offending file's errors are reported.","solutions":["Read the full errorBuilder message in the exception — it enumerates each validation problem with element/line context","Fix each listed problem in the BPMN XML (missing elements, broken references, invalid attributes)","Run the XML through a BPMN validator or the engine's repositoryService validation API before deploying","Regenerate the diagram from a conforming modeler (e.g. Flowable Modeler) if the source tool produced invalid XML"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate before deploy\nList<ValidationError> errors = repositoryService.validateProcess(bpmnXmlInputStream);\nif (!errors.isEmpty()) { /* fix first */ }","typeGuard":null,"tryCatchPattern":"try {\n  repositoryService.createDeployment().addInputStream(name, xml).deploy();\n} catch (ActivitiException e) {\n  if (e.getMessage().startsWith(\"Errors while parsing:\")) {\n    String[] problems = e.getMessage().split(\"\\\\n\");\n    // report each listed validation problem\n  }\n}","preventionTips":["Run the repository validation API or a BPMN validator in CI before deployment","Generate XML only from conforming BPMN modelers","Keep processes small and deploy-test incrementally so errors stay readable"],"tags":["bpmn","validation","xml","deployment"],"backgroundTag":"schema-validation-failed","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"}