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