Should the BPMN modeler produce invalid XML output?


#1

Hi,

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,
Christian


#2

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).


#3

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.


#4

What is the exact exception being thrown?


#5
[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(DomUtil.java:241)
        at org.camunda.bpm.model.xml.impl.parser.AbstractModelParser.parseModelFromStream(AbstractModelParser.java:65)
        at org.camunda.bpm.model.bpmn.impl.BpmnParser.parseModelFromStream(BpmnParser.java:61)
        at org.camunda.bpm.model.bpmn.Bpmn.doReadModelFromInputStream(Bpmn.java:234)
        at org.camunda.bpm.model.bpmn.Bpmn.readModelFromStream(Bpmn.java:125)
        at models.services.BpmnValidatorServiceImpl$$anonfun$validate$1$$anonfun$apply$2$$anonfun$1.apply(BpmnValidatorServiceImpl.scala:35)
        at models.services.BpmnValidatorServiceImpl$$anonfun$validate$1$$anonfun$apply$2$$anonfun$1.apply(BpmnValidatorServiceImpl.scala:35)
        at scala.util.Try$.apply(Try.scala:192)
        at models.services.BpmnValidatorServiceImpl$$anonfun$validate$1$$anonfun$apply$2.apply(BpmnValidatorServiceImpl.scala:35)
        at models.services.BpmnValidatorServiceImpl$$anonfun$validate$1$$anonfun$apply$2.apply(BpmnValidatorServiceImpl.scala:34)
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 '{"http://www.omg.org/spec/BPMN/20100524/MODEL":documentation, "http://www.omg.org/spec/BPMN/20100524/MODEL":extensionElements, "http://www.omg.org/spec/BPMN/20100524/MODEL":condition}' is expected.
        at org.camunda.bpm.model.xml.impl.util.DomUtil$DomErrorHandler.error(DomUtil.java:198)
        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)

#6

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

Thanks for reporting.


#7

Similar error reported when trying to import into Yaoquiang Modeller.


#8

Hi,

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: https://github.com/bpmn-io/bpmn-js-properties-panel/commit/da2d353be7c784655aeb86bed89f1c2558542a45 where the condition is added but I am yet not able to get the properties-panel extension working.

Thank you for a short reply.

Chris


#9

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