Modeler makes a lot of changes to file even for small change

Hi, we are trying to use the modeler on some fairly old BPMN files. The files load just fine (a bunch of warnings, but it works).
However, if we make even the smallest change (like just moving a node) and save the file we end up with a file that our application (JBPM) fails to be able to load.
It seems like there is a lot of change that is made to the file, not simply formatting but structural changes and things we don’t really expect.
What’s the best way to deal with this?

Hi @Scott_Chapman, welcome to the forums! Are you using Desktop Modeler? How old are BPMN files? Is it possible they are not BPMN 2.0 already?

Yea, I am using the desktop modeler. They look like they are BPMN already. For reference here is the definitions for it:

bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">

Can you share the entire file before and after changes? It’s expected that the DI section changes to represent the Z-order in the application, but the semantic should stay more or less the same after the export.

Yea, let me see if I can find one of the smaller models to demonstrate. I’ll have to anonymize it before I can share it though (for obvious reasons)

1 Like

OK, here is the before
cancel_v6.bpmn (19.4 KB)
and after
cancel_v6_modeler.bpmn (18.8 KB)
We get the following XML failures when it gets parsed:

2024-03-08 19:41:11,228 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 739, 31): cvc-complex-type.2.4.b: The content of element 'bpmn2:ioSpecification' is not complete. One of '{"http://www.omg.org/spec/BPMN/20100524/MODEL":dataInput, "http://www.omg.org/spec/BPMN/20100524/MODEL":dataOutput, "http://www.omg.org/spec/BPMN/20100524/MODEL":inputSet}' is expected.
2024-03-08 19:41:11,231 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 1,006, 31): cvc-complex-type.2.4.b: The content of element 'bpmn2:ioSpecification' is not complete. One of '{"http://www.omg.org/spec/BPMN/20100524/MODEL":dataInput, "http://www.omg.org/spec/BPMN/20100524/MODEL":dataOutput, "http://www.omg.org/spec/BPMN/20100524/MODEL":inputSet}' is expected.
2024-03-08 19:41:11,304 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 124, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.
2024-03-08 19:41:11,305 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 127, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.
2024-03-08 19:41:11,305 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 130, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.
2024-03-08 19:41:11,305 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 133, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.
2024-03-08 19:41:11,305 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 136, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.
2024-03-08 19:41:11,305 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 139, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.
2024-03-08 19:41:11,305 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 142, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.
2024-03-08 19:41:11,305 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 145, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.
2024-03-08 19:41:11,305 ERROR [default task-36]  org.drools.core.xml.ExtensibleXmlParser: (null: 198, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. 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":inMessageRef}' is expected.

I checked the files which you provided and was able to reproduce the modification of the XML present in cancel_v6_modeler.bpmn.

Unfortunately, the original file fails to validate with the schema due to a single error:

cancel_v6.bpmn:28: element outMessageRef: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}outMessageRef': This element is not expected. Expected is 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}inMessageRef ).

However, a change from outMessageRef to inMessageRef fixes the file. I reexported the fixed file from Desktop Modeler 5.20.0 and this introduced the following errors when validating with xmllint (xmllint --valid ~/Downloads/cancel_v6_fixed.bpmn --schema ~/workspace/bpmn-io/bpmn-moddle/resources/bpmn/xsd/BPMN20.xsd --noout:

/Users/maciej/Downloads/cancel_v6_fixed.bpmn:2: validity error : Validation failed: no DTD found !
tp://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd"
                                                                               ^
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:34: element process: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}process', attribute 'version': The attribute 'version' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:34: element process: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}process', attribute 'packageName': The attribute 'packageName' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:34: element process: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}process', attribute 'adHoc': The attribute 'adHoc' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:81: element sequenceFlow: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}sequenceFlow', attribute 'priority': The attribute 'priority' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:82: element sequenceFlow: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}sequenceFlow', attribute 'priority': The attribute 'priority' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:83: element sequenceFlow: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}sequenceFlow', attribute 'priority': The attribute 'priority' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:84: element sequenceFlow: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}sequenceFlow', attribute 'priority': The attribute 'priority' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:85: element task: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}task', attribute 'taskName': The attribute 'taskName' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:85: element task: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}task', attribute 'displayName': The attribute 'displayName' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:85: element task: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}task', attribute 'icon': The attribute 'icon' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:107: element sequenceFlow: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}sequenceFlow', attribute 'priority': The attribute 'priority' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:113: element sequenceFlow: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}sequenceFlow', attribute 'priority': The attribute 'priority' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:114: element callActivity: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}callActivity', attribute 'waitForCompletion': The attribute 'waitForCompletion' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:114: element callActivity: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}callActivity', attribute 'independent': The attribute 'independent' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:165: element sequenceFlow: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}sequenceFlow', attribute 'priority': The attribute 'priority' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn:212: element sequenceFlow: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/20100524/MODEL}sequenceFlow', attribute 'priority': The attribute 'priority' is not allowed.
/Users/maciej/Downloads/cancel_v6_fixed.bpmn fails to validate

I’ve found that the Modeler strips tns namespace in some cases. This needs to be further validated. I will check if this can be reproduced directly with the XML parser that we use in the Desktop Modeler, and then create an issue on GitHub.

I created an issue for this: BPMN is broken via saving · Issue #4190 · camunda/camunda-modeler · GitHub
Feel free to comment on this.

Thanks, appreciate the analysis. What do you think we can do in the short term to work around this?

Until we fix the bug, you could try if the problem was present in the old versions of the Modeler.

Ah, OK. So it is “worse” than simply manually editing the modified file?

I’m not sure if the files can be easily fixed manually :frowning:

@Scott_Chapman @barmac The problem stems from the fact that the example diagram declares default and prefixed usage for the same XML namespace:

xmlns:tns="http://www.jboss.org/drools" 
xmlns="http://www.jboss.org/drools" 

While this is not illegal usage it seems to confuse our importer regardless. As the diagram at hand does not use the default namespace it is safe to remove it. Afterwards the diagram imports (and serializes) without issues.


The files load just fine (a bunch of warnings, but it works).

The “just fine” warnings are reporting exactly what the importer is confused about.

1 Like

Oh interesting. So the recommendation is to remove the second one (xmlns) and leave the first one (xmlns:tns)?

So the recommendation is to remove the second one (xmlns ) and leave the first one (xmlns:tns )?

That is the simple workaround for you. We want to fix this import issue regardless.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.