Skip to content

Commit 473cdde

Browse files
committed
fix namespace resolving (Issue #402)
1 parent baef875 commit 473cdde

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

open-bpmn.metamodel/src/main/java/org/openbpmn/bpmn/BPMNModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ private void parseAllNamespaces() {
174174
continue;
175175
}
176176

177-
String prefix = node.getLocalName(); // Gets the part after 'xmlns:'
177+
// String prefix = node.getLocalName(); // Gets the part after 'xmlns:'
178+
String prefix = nodeName.substring(6);
178179

179180
// Map URIs to their corresponding BPMN namespace types
180181
mapUriToNamespace(prefix, nodeValue);

open-bpmn.metamodel/src/main/java/org/openbpmn/bpmn/util/BPMNModelFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public static BPMNModel createInstance(String exporter, String exporterVersion,
7070
Element definitions = doc.createElementNS("http://www.omg.org/spec/BPMN/20100524/MODEL",
7171
"bpmn2:definitions");
7272

73-
// set BPMN default namespaces
73+
// Set BPMN default namespaces - use consistent prefixes with BPMNModel defaults
74+
definitions.setAttribute("xmlns:bpmn2", "http://www.omg.org/spec/BPMN/20100524/MODEL");
7475
definitions.setAttribute("xmlns:bpmndi", "http://www.omg.org/spec/BPMN/20100524/DI");
7576
definitions.setAttribute("xmlns:di", "http://www.omg.org/spec/DD/20100524/DI");
7677
definitions.setAttribute("xmlns:dc", "http://www.omg.org/spec/DD/20100524/DC");

open-bpmn.metamodel/src/test/resources/missing-process-participant.bpmn

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<!-- origin at X=0.0 Y=0.0 --><bpmn2:definitions 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:ext="http://org.eclipse.bpmn2/ext" xmlns:imixs="http://www.imixs.org/bpmn2" xmlns:open-bpmn="http://open-bpmn.org/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.2.SNAPSHOT-v20200602-1600-B1" id="Definitions_1" targetNamespace="http://www.imixs.org/bpmn2">
3+
<bpmn2:extensionElements>
4+
<open-bpmn:auto-align/>
5+
</bpmn2:extensionElements>
36
<bpmn2:collaboration id="Collaboration_1" name="Collaboration 1">
47
<bpmn2:participant id="Participant_1" name="Anlage" processRef="Process_1">
58
<bpmn2:documentation id="Documentation_17"><![CDATA[Antrag, Angebot und Auftrag]]></bpmn2:documentation>
69
</bpmn2:participant>
7-
<bpmn2:participant id="Participant_2" name="Rechnungseingang Pool"/>
810
<bpmn2:participant id="participant_B0T1GQ" name="Default Process" processRef="process_3"/>
911
</bpmn2:collaboration>
10-
<bpmn2:process definitionalCollaborationRef="Collaboration_1" id="Process_1" isExecutable="false" name="Anlage">
12+
<bpmn2:process definitionalCollaborationRef="Collaboration_1" id="Process_1" isExecutable="false" name="Anlage" processType="Private">
1113
<bpmn2:laneSet id="LaneSet_1" name="Lane Set 1">
1214
<bpmn2:lane id="Lane_1" name="Backoffice">
1315
<bpmn2:documentation id="documentation_ZcCgvw"/>

open-bpmn.metamodel/src/test/resources/out_blank.bpmn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<bpmn2:definitions 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:open-bpmn="http://open-bpmn.org/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exporter="org.openbpmn" exporterVersion="1.0.0" targetNamespace="http://open-bpmn.org" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL">
2+
<bpmn2:definitions 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:open-bpmn="http://open-bpmn.org/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exporter="org.openbpmn" exporterVersion="1.0.0" targetNamespace="http://open-bpmn.org">
33
<bpmn2:process id="process_1" name="Default Process" processType="Public"/>
44
<bpmndi:BPMNDiagram id="BPMNDiagram_1" name="OpenBPMN Diagram">
55
<bpmndi:BPMNPlane id="BPMNPlane_1"/>

0 commit comments

Comments
 (0)