{"record":{"id":"3353f7d6088c3819","repo":"flowable/flowable-engine","slug":"errors-while-parsing-n-errorbuilder","errorCode":null,"errorMessage":"Errors while parsing:\\n\" + errorBuilder","messagePattern":"Errors while parsing:\\\\n\" \\+ errorBuilder","errorType":"validation","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/BpmnParse.java","lineNumber":177,"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 FlowableException(\"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\n            // Attach logic to the processes (eg. map ActivityBehaviors to bpmn model elements)\n            applyParseHandlers();","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/BpmnParse.java#L159-L195","documentation":"BpmnParse.execute() runs schema validation and semantic checks on the BPMN XML. When any validation errors were collected, it aggregates them into errorBuilder and throws a single FlowableException listing all problems, aborting the parse/deployment.","triggerScenarios":"Deploying a BPMN file that fails XSD schema validation or Flowable semantic validation — e.g. unknown elements/attributes, invalid references (sequenceFlow to missing activity), malformed conditional expressions.","commonSituations":"Hand-edited process XML; XML from an older Flowable version using removed elements; a process referencing an undefined variable expression caught by validation; deploy() of a broken .bpmn20.xml resource.","solutions":["Read the aggregated error list in the exception message — it contains line numbers for each problem","Fix each reported XML issue (element names, required attributes, valid references)","Validate locally against the Flowable XSD (or run the process through a validating parser) before deploying","Check that the process was exported from a compatible modeler/Flowable version"],"exampleFix":"// before\n<userTask id=\"t1\"><flowable:extensionElemens>...</flowable:extensionElemens></userTask>\n// after\n<userTask id=\"t1\"><extensionElements>...</extensionElements></userTask>","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    repositoryService.createDeployment().addClasspathResource(\"process.bpmn20.xml\").deploy();\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Errors while parsing:\")) {\n        log.error(\"BPMN validation failed:\\n{}\", e.getMessage());\n    }\n}","preventionTips":["Validate BPMN against XSD in CI before deploying","Keep modeler and Flowable runtime versions aligned","Test-deploy processes in a staging engine"],"tags":["bpmn","xml-validation","parsing"],"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-14T11:17:12.474Z"}