Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BPMN with both the same namespace as default and named is broken at import #4190

Open
barmac opened this issue Mar 11, 2024 · 5 comments
Open
Assignees
Labels
bug Something isn't working ready Ready to be worked on

Comments

@barmac
Copy link
Contributor

barmac commented Mar 11, 2024

Describe the bug

The Modeler breaks some BPMNs exported from JBPM, cf. https://forum.camunda.io/t/modeler-makes-a-lot-of-changes-to-file-even-for-small-change/51016

I noticed that in some cases the namespace is stripped:

-    <bpmn2:sequenceFlow id="_1-_jbpm-unique-218" tns:priority="1" name="" sourceRef="_1" targetRef="_jbpm-unique-218"/>
+    <bpmn2:sequenceFlow id="_1-_jbpm-unique-218" name="" sourceRef="_1" targetRef="_jbpm-unique-218" priority="1" />

Steps to reproduce

gh repo clone github.com/barmac/drools-bpmn-test
cd drools-bpmn-test
npm i
npm t

Expected behavior

BPMN should be valid after export.

Environment

plain bpmn-moddle

Additional context

No response

@barmac barmac added bug Something isn't working ready Ready to be worked on labels Mar 11, 2024
@nikku
Copy link
Member

nikku commented Mar 11, 2024

I'll have a look into this.

@nikku nikku self-assigned this Mar 11, 2024
@nikku
Copy link
Member

nikku commented Mar 11, 2024

Initial assessment: The diagram does not break by saving, but breaks during import. As the original user reports there is a bunch of errors (attributes not known), which manifest in a broken BPMN 2.0 export later on.

Quoting from my user forum answer:

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.

@nikku nikku added this to the M75 milestone Mar 14, 2024
@nikku nikku modified the milestones: M75, M76 Mar 25, 2024
@nikku
Copy link
Member

nikku commented Mar 25, 2024

@barmac Removed from M75, let's follow up at a later stage.

@barmac
Copy link
Contributor Author

barmac commented Apr 8, 2024

I will update the issue title according to your assessment.

@barmac barmac changed the title BPMN is broken via saving BPMN with both default and named namespace is broken at import Apr 8, 2024
@barmac barmac changed the title BPMN with both default and named namespace is broken at import BPMN with both the same namespace as default and named is broken at import Apr 8, 2024
@nikku nikku added the in progress Currently worked on label Apr 9, 2024 — with bpmn-io-tasks
@nikku nikku removed the ready Ready to be worked on label Apr 9, 2024
@nikku
Copy link
Member

nikku commented Apr 11, 2024

I reproduced this down to moddle-xml and saxen. As it touches the core of our infrastructure and XML de-serialization I can finally read the specs again 🎉. Will take some time.

@nikku nikku added the ready Ready to be worked on label Apr 19, 2024 — with bpmn-io-tasks
@nikku nikku removed the in progress Currently worked on label Apr 19, 2024
@nikku nikku removed this from the M76 milestone May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready Ready to be worked on
Projects
None yet
Development

No branches or pull requests

2 participants