-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- sub process instances have the activity lifecycle, including input and output mappings - worfkflow instance records now reference their scope instance - adds validation for sub process start events - does not yet support cancellation when subprocess is active => #1119 - does not test/address payload updates => #1131
- Loading branch information
1 parent
db117d3
commit e54c707
Showing
23 changed files
with
727 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
bpmn-model/src/main/java/io/zeebe/model/bpmn/validation/zeebe/SubProcessValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright © 2017 camunda services GmbH (info@camunda.com) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.zeebe.model.bpmn.validation.zeebe; | ||
|
||
import io.zeebe.model.bpmn.instance.StartEvent; | ||
import io.zeebe.model.bpmn.instance.SubProcess; | ||
import java.util.Collection; | ||
import org.camunda.bpm.model.xml.validation.ModelElementValidator; | ||
import org.camunda.bpm.model.xml.validation.ValidationResultCollector; | ||
|
||
public class SubProcessValidator implements ModelElementValidator<SubProcess> { | ||
|
||
@Override | ||
public Class<SubProcess> getElementType() { | ||
return SubProcess.class; | ||
} | ||
|
||
@Override | ||
public void validate(SubProcess element, ValidationResultCollector validationResultCollector) { | ||
final Collection<StartEvent> startEvents = element.getChildElementsByType(StartEvent.class); | ||
|
||
if (startEvents.size() != 1) { | ||
validationResultCollector.addError(0, "Must have exactly one start event"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
bpmn-model/src/test/resources/io/zeebe/model/bpmn/validation/no-start-event-sub-process.bpmn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.2"> | ||
<bpmn:process id="Process_1" isExecutable="true"> | ||
<bpmn:startEvent id="StartEvent_1"> | ||
<bpmn:outgoing>SequenceFlow_0uj31r2</bpmn:outgoing> | ||
</bpmn:startEvent> | ||
<bpmn:sequenceFlow id="SequenceFlow_0uj31r2" sourceRef="StartEvent_1" targetRef="subProcess" /> | ||
<bpmn:subProcess id="subProcess"> | ||
<bpmn:incoming>SequenceFlow_0uj31r2</bpmn:incoming> | ||
<bpmn:outgoing>SequenceFlow_0alofse</bpmn:outgoing> | ||
</bpmn:subProcess> | ||
<bpmn:endEvent id="EndEvent_1dmb61w"> | ||
<bpmn:incoming>SequenceFlow_0alofse</bpmn:incoming> | ||
</bpmn:endEvent> | ||
<bpmn:sequenceFlow id="SequenceFlow_0alofse" sourceRef="subProcess" targetRef="EndEvent_1dmb61w" /> | ||
</bpmn:process> | ||
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> | ||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"> | ||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> | ||
<dc:Bounds x="173" y="102" width="36" height="36" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="SequenceFlow_0uj31r2_di" bpmnElement="SequenceFlow_0uj31r2"> | ||
<di:waypoint xsi:type="dc:Point" x="209" y="120" /> | ||
<di:waypoint xsi:type="dc:Point" x="230" y="120" /> | ||
<di:waypoint xsi:type="dc:Point" x="230" y="120" /> | ||
<di:waypoint xsi:type="dc:Point" x="258" y="120" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="245" y="114" width="0" height="12" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNShape id="SubProcess_1cctepv_di" bpmnElement="subProcess" isExpanded="true"> | ||
<dc:Bounds x="258" y="45" width="211" height="150" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="EndEvent_1dmb61w_di" bpmnElement="EndEvent_1dmb61w"> | ||
<dc:Bounds x="512" y="102" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="530" y="142" width="0" height="12" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="SequenceFlow_0alofse_di" bpmnElement="SequenceFlow_0alofse"> | ||
<di:waypoint xsi:type="dc:Point" x="469" y="120" /> | ||
<di:waypoint xsi:type="dc:Point" x="512" y="120" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="490.5" y="99" width="0" height="12" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNEdge> | ||
</bpmndi:BPMNPlane> | ||
</bpmndi:BPMNDiagram> | ||
</bpmn:definitions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,5 +41,6 @@ public enum BpmnStep { | |
|
||
START_ACTIVITY, | ||
|
||
TRIGGER_END_EVENT | ||
TRIGGER_END_EVENT, | ||
TRIGGER_START_EVENT | ||
} |
35 changes: 35 additions & 0 deletions
35
broker-core/src/main/java/io/zeebe/broker/workflow/model/ExecutableSubProcess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Zeebe Broker Core | ||
* Copyright © 2017 camunda services GmbH (info@camunda.com) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package io.zeebe.broker.workflow.model; | ||
|
||
public class ExecutableSubProcess extends ExecutableFlowNode { | ||
|
||
private ExecutableFlowNode startEvent; | ||
|
||
public ExecutableSubProcess(String id) { | ||
super(id); | ||
} | ||
|
||
public ExecutableFlowNode getStartEvent() { | ||
return startEvent; | ||
} | ||
|
||
public void setStartEvent(ExecutableFlowNode startEvent) { | ||
this.startEvent = startEvent; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.