Should the BPMN modeler produce invalid XML output?


I use the BPMN modeler and parse the output with camunda-bpmn-model. If I add a conditional event without a condition, the modeler produces invalid XML, so that the XML parser throws an exception. Is this the expected behavior or is this a bug?

Best regards,

What is the XML parser for you?

For our Modeling tools, validity is asserted with respect to the BPMN 2.0 standard, not an execution engine (if that is what you mean by XML parser).

I use org.camunda.bpm.model.bpmn.Bpmn.readModelFromStream provided by camunda-bpmn-model and it seems that it validates the file against the BPMN 2.0 schema.

What is the exact exception being thrown?

[info] m.s.BpmnValidatorServiceImpl - Cannot parse BPMN file
org.camunda.bpm.model.xml.ModelParseException: SAXException while parsing input stream
        at org.camunda.bpm.model.xml.impl.util.DomUtil.parseInputStream(
        at org.camunda.bpm.model.xml.impl.parser.AbstractModelParser.parseModelFromStream(
        at org.camunda.bpm.model.bpmn.impl.BpmnParser.parseModelFromStream(
        at org.camunda.bpm.model.bpmn.Bpmn.doReadModelFromInputStream(
        at org.camunda.bpm.model.bpmn.Bpmn.readModelFromStream(
        at scala.util.Try$.apply(Try.scala:192)
Caused by: org.xml.sax.SAXException: Error: URI=null Line=222: cvc-complex-type.2.4.b: The content of element 'bpmn:conditionalEventDefinition' is not complete. One of '{"":documentation, "":extensionElements, "":condition}' is expected.
        at org.camunda.bpm.model.xml.impl.util.DomUtil$DomErrorHandler.error(
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.elementLocallyValidType(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.processElementContent(Unknown Source)

This is a bug. Whatever the modeler produces should be valid according to the BPMN 2.0 XML schema.

Thanks for reporting.

Similar error reported when trying to import into Yaoquiang Modeller.


any update on this issue? I use precompiled “bpmn-modeler v0.22.1” and still encounter the issue described above. Is there a short workaround? I have full access to the businessObject in JavaScript and hoped to add the <condition> via code.

I found this post: where the condition is added but I am yet not able to get the properties-panel extension working.

Thank you for a short reply.


A fix for this issue will ship with the next version of our BPMN toolkit.