Skip to content

Commit

Permalink
fixed process validation and model examples (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jan 9, 2025
1 parent a5d763d commit cfdd3c0
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ Possible ImageTypes are:
* GRAY Shades of gray
* RGB Red, Green, Blue
</bpmn2:text>
<bpmn2:documentation id="documentation_AtBXTg"/>
</bpmn2:textAnnotation>
<bpmn2:participant id="participant_MqZCmA" name="Default Process" processRef="process_2"/>
</bpmn2:collaboration>
<bpmn2:process definitionalCollaborationRef="Collaboration_1" id="Process_1" isExecutable="false" name="Posteingang">
<bpmn2:process definitionalCollaborationRef="Collaboration_1" id="Process_1" isExecutable="false" name="Posteingang" processType="Private">
<bpmn2:laneSet id="LaneSet_1" name="Lane Set 1">
<bpmn2:lane id="Lane_2" name="Empfang">
<bpmn2:flowNodeRef>Task_4</bpmn2:flowNodeRef>
Expand Down Expand Up @@ -708,7 +709,9 @@ Max 10 PDF Pages will be scanned</bpmn2:text>
<bpmn2:sequenceFlow id="sequenceFlow_kkxDRg" sourceRef="gateway_vO0Jrw" targetRef="IntermediateCatchEvent_3">
<bpmn2:documentation id="documentation_wVueew"/>
</bpmn2:sequenceFlow>
<bpmn2:dataStoreReference id="dataStoreReference_NGlFPg" name="Data Store-1"/>
<bpmn2:dataStoreReference id="dataStoreReference_NGlFPg" name="Data Store-1">
<bpmn2:documentation id="documentation_kVOQFw"/>
</bpmn2:dataStoreReference>
<bpmn2:association id="association_9R2VSg" sourceRef="dataStoreReference_NGlFPg" targetRef="Task_1">
<bpmn2:documentation id="documentation_6rKTaQ"/>
</bpmn2:association>
Expand Down Expand Up @@ -886,9 +889,9 @@ Max 10 PDF Pages will be scanned</bpmn2:text>
<bpmndi:BPMNEdge bpmnElement="Association_1" id="BPMNEdge_Association_1" sourceElement="BPMNShape_TextAnnotation_2" targetElement="BPMNShape_IntermediateCatchEvent_4">
<bpmndi:BPMNLabel id="BPMNLabel_19"/>
<di:waypoint x="1152.0" y="251.0"/>
<di:waypoint x="1152.0" y="274.5"/>
<di:waypoint x="966.0" y="274.5"/>
<di:waypoint x="966.0" y="307.0277992443886"/>
<di:waypoint x="1152.0" y="275.0"/>
<di:waypoint x="966.0" y="275.0"/>
<di:waypoint x="966.0" y="307.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_5" id="BPMNEdge_SequenceFlow_5" sourceElement="BPMNShape_IntermediateCatchEvent_1" targetElement="BPMNShape_Task_2">
<bpmndi:BPMNLabel id="BPMNLabel_30"/>
Expand All @@ -910,24 +913,24 @@ Max 10 PDF Pages will be scanned</bpmn2:text>
<bpmndi:BPMNLabel id="BPMNLabel_35"/>
<di:waypoint x="1350.0" y="485.0"/>
<di:waypoint x="1433.0" y="485.0"/>
<di:waypoint x="1433.0" y="342.9722007556114"/>
<di:waypoint x="1433.0" y="343.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="Association_2" id="BPMNEdge_Association_2" sourceElement="BPMNShape_TextAnnotation_3" targetElement="BPMNShape_IntermediateCatchEvent_3">
<bpmndi:BPMNLabel id="BPMNLabel_37"/>
<di:waypoint x="739.0" y="174.5"/>
<di:waypoint x="808.5" y="174.5"/>
<di:waypoint x="808.5" y="325.0"/>
<di:waypoint x="739.0" y="175.0"/>
<di:waypoint x="809.0" y="175.0"/>
<di:waypoint x="809.0" y="325.0"/>
<di:waypoint x="878.0" y="325.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_16" id="BPMNEdge_SequenceFlow_16" sourceElement="BPMNShape_00qW5g" targetElement="BPMNShape_IntermediateCatchEvent_7">
<bpmndi:BPMNLabel id="BPMNLabel_39"/>
<di:waypoint x="765.0" y="340.0"/>
<di:waypoint x="765.0" y="396.0"/>
<di:waypoint x="947.0277992443886" y="396.0"/>
<di:waypoint x="947.0" y="396.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_17" id="BPMNEdge_SequenceFlow_17" sourceElement="BPMNShape_IntermediateCatchEvent_7" targetElement="BPMNShape_ExclusiveGateway_2">
<bpmndi:BPMNLabel id="BPMNLabel_40"/>
<di:waypoint x="981.124515496597" y="403.0"/>
<di:waypoint x="981.0" y="403.0"/>
<di:waypoint x="1089.0" y="403.0"/>
<di:waypoint x="1089.0" y="349.0"/>
</bpmndi:BPMNEdge>
Expand Down
38 changes: 19 additions & 19 deletions open-bpmn.glsp-client/workspace/demo/rechnungseingang-3.0.9.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Das ist eine automatische generierte E-Mail. Bitte nicht auf diese E-Mail antwor
</bpmn2:participant>
<bpmn2:participant id="participant_qI5ylQ" name="Default Process" processRef="process_2"/>
</bpmn2:collaboration>
<bpmn2:process definitionalCollaborationRef="Collaboration_1" id="Process_1" isExecutable="false" name="Rechnungseingang">
<bpmn2:process definitionalCollaborationRef="Collaboration_1" id="Process_1" isExecutable="false" name="Rechnungseingang" processType="Private">
<bpmn2:laneSet id="LaneSet_3" name="Lane Set 3">
<bpmn2:lane id="Lane_5" name="Empfang">
<bpmn2:flowNodeRef>EndEvent_1</bpmn2:flowNodeRef>
Expand Down Expand Up @@ -2903,8 +2903,8 @@ Compute _subject and additional data fields.
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_41" id="BPMNEdge_SequenceFlow_41" sourceElement="BPMNShape_EventBasedGateway_1" targetElement="BPMNShape_IntermediateThrowEvent_1">
<bpmndi:BPMNLabel id="BPMNLabel_80"/>
<di:waypoint x="681.0" y="363.0"/>
<di:waypoint x="699.5" y="363.0"/>
<di:waypoint x="699.5" y="433.0"/>
<di:waypoint x="700.0" y="363.0"/>
<di:waypoint x="700.0" y="433.0"/>
<di:waypoint x="718.0" y="433.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_49" id="BPMNEdge_SequenceFlow_49" sourceElement="BPMNShape_IntermediateCatchEvent_22" targetElement="BPMNShape_Task_1">
Expand Down Expand Up @@ -2935,13 +2935,13 @@ Compute _subject and additional data fields.
<di:waypoint x="526.0" y="388.0"/>
<di:waypoint x="526.0" y="408.0"/>
<di:waypoint x="532.0" y="408.0"/>
<di:waypoint x="532.0" y="426.02943725152284"/>
<di:waypoint x="532.0" y="426.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_59" id="BPMNEdge_SequenceFlow_59" sourceElement="BPMNShape_Task_4" targetElement="BPMNShape_IntermediateCatchEvent_5">
<bpmndi:BPMNLabel id="BPMNLabel_116"/>
<di:waypoint x="841.0" y="783.0"/>
<di:waypoint x="782.5" y="783.0"/>
<di:waypoint x="782.5" y="863.0"/>
<di:waypoint x="783.0" y="783.0"/>
<di:waypoint x="783.0" y="863.0"/>
<di:waypoint x="724.0" y="863.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_61" id="BPMNEdge_SequenceFlow_61" sourceElement="BPMNShape_ExclusiveGateway_7" targetElement="BPMNShape_Task_4">
Expand All @@ -2964,8 +2964,8 @@ Compute _subject and additional data fields.
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_14" id="BPMNEdge_SequenceFlow_16" sourceElement="BPMNShape_IntermediateCatchEvent_8" targetElement="BPMNShape_Task_5">
<bpmndi:BPMNLabel id="BPMNLabel_65"/>
<di:waypoint x="430.0" y="454.0"/>
<di:waypoint x="450.5" y="454.0"/>
<di:waypoint x="450.5" y="363.0"/>
<di:waypoint x="451.0" y="454.0"/>
<di:waypoint x="451.0" y="363.0"/>
<di:waypoint x="471.0" y="363.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_16" id="BPMNEdge_SequenceFlow_18" sourceElement="BPMNShape_EventBasedGateway_1" targetElement="BPMNShape_IntermediateCatchEvent_16">
Expand Down Expand Up @@ -3067,7 +3067,7 @@ Compute _subject and additional data fields.
<bpmndi:BPMNLabel id="BPMNLabel_70"/>
<di:waypoint x="1071.0" y="1063.0"/>
<di:waypoint x="1372.0" y="1063.0"/>
<di:waypoint x="1372.0" y="800.5499287747842"/>
<di:waypoint x="1372.0" y="801.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_1" id="BPMNEdge_SequenceFlow_1" sourceElement="BPMNShape_IntermediateCatchEvent_3" targetElement="BPMNShape_Task_19">
<bpmndi:BPMNLabel id="BPMNLabel_14"/>
Expand Down Expand Up @@ -3108,9 +3108,9 @@ Compute _subject and additional data fields.
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="Association_3" id="BPMNEdge_Association_3" sourceElement="BPMNShape_TextAnnotation_2" targetElement="BPMNShape_IntermediateCatchEvent_39">
<bpmndi:BPMNLabel id="BPMNLabel_69"/>
<di:waypoint x="1211.0" y="1254.5"/>
<di:waypoint x="1187.5" y="1254.5"/>
<di:waypoint x="1187.5" y="1253.0"/>
<di:waypoint x="1211.0" y="1255.0"/>
<di:waypoint x="1188.0" y="1255.0"/>
<di:waypoint x="1188.0" y="1253.0"/>
<di:waypoint x="1164.0" y="1253.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_4" id="BPMNEdge_SequenceFlow_4" sourceElement="BPMNShape_EventBasedGateway_2" targetElement="BPMNShape_IntermediateCatchEvent_6">
Expand All @@ -3124,8 +3124,8 @@ Compute _subject and additional data fields.
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="Association_1" id="BPMNEdge_Association_1" sourceElement="BPMNShape_TextAnnotation_4" targetElement="BPMNShape_IntermediateCatchEvent_12">
<bpmndi:BPMNLabel id="BPMNLabel_33"/>
<di:waypoint x="1148.5" y="1449.0"/>
<di:waypoint x="1148.5" y="1467.0"/>
<di:waypoint x="1149.0" y="1449.0"/>
<di:waypoint x="1149.0" y="1467.0"/>
<di:waypoint x="1146.0" y="1467.0"/>
<di:waypoint x="1146.0" y="1485.0"/>
</bpmndi:BPMNEdge>
Expand Down Expand Up @@ -3208,7 +3208,7 @@ Compute _subject and additional data fields.
<bpmndi:BPMNLabel id="BPMNLabel_110"/>
<di:waypoint x="1456.0" y="1478.0"/>
<di:waypoint x="1456.0" y="1385.0"/>
<di:waypoint x="1538.1114561800016" y="1385.0"/>
<di:waypoint x="1538.0" y="1385.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_47" id="BPMNEdge_SequenceFlow_47" sourceElement="BPMNShape_Task_19" targetElement="BPMNShape_EventBasedGateway_2">
<bpmndi:BPMNLabel id="BPMNLabel_123"/>
Expand Down Expand Up @@ -3307,7 +3307,7 @@ Compute _subject and additional data fields.
<bpmndi:BPMNLabel id="BPMNLabel_141"/>
<di:waypoint x="332.0" y="143.0"/>
<di:waypoint x="410.0" y="143.0"/>
<di:waypoint x="410.0" y="185.45007122521577"/>
<di:waypoint x="410.0" y="185.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_60" id="BPMNEdge_SequenceFlow_60" sourceElement="BPMNShape_IntermediateCatchEvent_21" targetElement="BPMNShape_IntermediateCatchEvent_4">
<bpmndi:BPMNLabel id="BPMNLabel_148"/>
Expand All @@ -3322,9 +3322,9 @@ Compute _subject and additional data fields.
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_64" id="BPMNEdge_SequenceFlow_64" sourceElement="BPMNShape_EventBasedGateway_5" targetElement="BPMNShape_IntermediateThrowEvent_3">
<bpmndi:BPMNLabel id="BPMNLabel_152"/>
<di:waypoint x="1041.0" y="783.0"/>
<di:waypoint x="1054.5" y="783.0"/>
<di:waypoint x="1054.5" y="715.0"/>
<di:waypoint x="1068.1114561800018" y="715.0"/>
<di:waypoint x="1055.0" y="783.0"/>
<di:waypoint x="1055.0" y="715.0"/>
<di:waypoint x="1068.0" y="715.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="dataStore_kaeeyA" id="BPMNShape_lgvo5A">
<dc:Bounds height="70.0" width="100.0" x="607.0" y="144.0"/>
Expand Down
29 changes: 0 additions & 29 deletions open-bpmn.glsp-client/workspace/demo/store-test.bpmn

This file was deleted.

20 changes: 16 additions & 4 deletions open-bpmn.metamodel/src/main/java/org/openbpmn/bpmn/BPMNModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1927,22 +1927,34 @@ private void loadProcessList() throws BPMNModelException {
// find process
NodeList processList = definitions.getElementsByTagNameNS(getUri(BPMNNS.BPMN2), "process");
if (processList != null && processList.getLength() > 0) {

// first we need to test if all processes have a processType attribute or if we
// found at lease one public process!
for (int i = 0; i < processList.getLength(); i++) {
Element processElement = (Element) processList.item(i);

String processType = processElement.getAttribute("processType");
if (BPMNTypes.PROCESS_TYPE_PUBLIC.equals(processType)) {
if (BPMNTypes.PROCESS_TYPE_PUBLIC.equals(processElement.getAttribute("processType"))) {
publicCount++;
}
}

// now we can build the process list
for (int i = 0; i < processList.getLength(); i++) {
Element processElement = (Element) processList.item(i);

String processType = processElement.getAttribute("processType");
if (processType.isEmpty()) {
// fix missing element attribute!
// if we did not find a public process, we default now to a public type
// if the model doese not contain at lease one public process, we default now to
// a public type
if (publicCount == 0) {
processType = BPMNTypes.PROCESS_TYPE_PUBLIC;
publicCount++;
} else {
// else set the process to a private type!
processType = BPMNTypes.PROCESS_TYPE_PRIVATE;
}
logger.warning(
"Set missing processType attribute for process " + processElement.getAttribute("id"));
processElement.setAttribute("processType", processType);
setDirty(true);
}
Expand Down

0 comments on commit cfdd3c0

Please sign in to comment.