Skip to content

Commit e8f343a

Browse files
authored
feat: allow text annotations for message flows
Closes #2281
1 parent 601b0f8 commit e8f343a

File tree

11 files changed

+511
-173
lines changed

11 files changed

+511
-173
lines changed

lib/features/context-pad/ContextPadProvider.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,16 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
485485
});
486486
}
487487

488+
if (is(businessObject, 'bpmn:MessageFlow')) {
489+
assign(actions, {
490+
'append.text-annotation': appendAction(
491+
'bpmn:TextAnnotation',
492+
'bpmn-icon-text-annotation',
493+
translate('Add text annotation')
494+
)
495+
});
496+
}
497+
488498
if (
489499
isAny(businessObject, [
490500
'bpmn:FlowNode',

lib/import/BpmnTreeWalker.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,11 @@ export default function BpmnTreeWalker(handler) {
430430

431431
forEach(collaboration.participants, contextual(handleParticipant, context));
432432

433-
handleArtifacts(collaboration.artifacts, context);
434-
435-
// handle message flows latest in the process
436433
deferred.push(function() {
437434
handleMessageFlows(collaboration.messageFlows, context);
438435
});
436+
437+
handleArtifacts(collaboration.artifacts, context);
439438
}
440439

441440

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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" id="simple" targetNamespace="http://bpmn.io/schema/bpmn" exporter="bpmn-js (https://demo.bpmn.io)" exporterVersion="18.3.1" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
3+
<bpmn2:collaboration id="Collaboration_1apxmjs">
4+
<bpmn2:participant id="Participant_0pmdlbq" processRef="Process_08lzk4r" />
5+
<bpmn2:participant id="Participant_1b6h7co" processRef="Process_1dg06qb" />
6+
<bpmn2:messageFlow id="MessageFlow_1" sourceRef="Event_1s8jl8h" targetRef="Participant_1b6h7co" />
7+
<bpmn2:textAnnotation id="TextAnnotation_1">
8+
<bpmn2:text>TextAnnotation_1</bpmn2:text>
9+
</bpmn2:textAnnotation>
10+
<bpmn2:association id="Association_1" associationDirection="None" sourceRef="MessageFlow_1" targetRef="TextAnnotation_1" />
11+
</bpmn2:collaboration>
12+
<bpmn2:process id="Process_08lzk4r">
13+
<bpmn2:endEvent id="Event_1s8jl8h">
14+
<bpmn2:incoming>Flow_1wufvvv</bpmn2:incoming>
15+
</bpmn2:endEvent>
16+
<bpmn2:sequenceFlow id="Flow_1wufvvv" sourceRef="Activity_19vun9y" targetRef="Event_1s8jl8h" />
17+
<bpmn2:startEvent id="Event_0a7hfxb">
18+
<bpmn2:outgoing>Flow_12788mj</bpmn2:outgoing>
19+
</bpmn2:startEvent>
20+
<bpmn2:sequenceFlow id="Flow_12788mj" sourceRef="Event_0a7hfxb" targetRef="Activity_19vun9y" />
21+
<bpmn2:task id="Activity_19vun9y">
22+
<bpmn2:incoming>Flow_12788mj</bpmn2:incoming>
23+
<bpmn2:outgoing>Flow_1wufvvv</bpmn2:outgoing>
24+
</bpmn2:task>
25+
</bpmn2:process>
26+
<bpmn2:process id="Process_1dg06qb" />
27+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
28+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1apxmjs">
29+
<bpmndi:BPMNShape id="Participant_0pmdlbq_di" bpmnElement="Participant_0pmdlbq" isHorizontal="true">
30+
<dc:Bounds x="40" y="10" width="600" height="250" />
31+
</bpmndi:BPMNShape>
32+
<bpmndi:BPMNShape id="Event_1s8jl8h_di" bpmnElement="Event_1s8jl8h">
33+
<dc:Bounds x="312" y="102" width="36" height="36" />
34+
</bpmndi:BPMNShape>
35+
<bpmndi:BPMNShape id="Event_0a7hfxb_di" bpmnElement="Event_0a7hfxb">
36+
<dc:Bounds x="72" y="102" width="36" height="36" />
37+
</bpmndi:BPMNShape>
38+
<bpmndi:BPMNShape id="Activity_19vun9y_di" bpmnElement="Activity_19vun9y">
39+
<dc:Bounds x="170" y="80" width="100" height="80" />
40+
</bpmndi:BPMNShape>
41+
<bpmndi:BPMNEdge id="Flow_1wufvvv_di" bpmnElement="Flow_1wufvvv">
42+
<di:waypoint x="270" y="120" />
43+
<di:waypoint x="312" y="120" />
44+
</bpmndi:BPMNEdge>
45+
<bpmndi:BPMNEdge id="Flow_12788mj_di" bpmnElement="Flow_12788mj">
46+
<di:waypoint x="108" y="120" />
47+
<di:waypoint x="170" y="120" />
48+
</bpmndi:BPMNEdge>
49+
<bpmndi:BPMNShape id="Participant_1b6h7co_di" bpmnElement="Participant_1b6h7co" isHorizontal="true">
50+
<dc:Bounds x="40" y="420" width="600" height="250" />
51+
</bpmndi:BPMNShape>
52+
<bpmndi:BPMNEdge id="Association_1_di" bpmnElement="Association_1">
53+
<di:waypoint x="330" y="320" />
54+
<di:waypoint x="460" y="320" />
55+
</bpmndi:BPMNEdge>
56+
<bpmndi:BPMNEdge id="MessageFlow_1_di" bpmnElement="MessageFlow_1">
57+
<di:waypoint x="330" y="140" />
58+
<di:waypoint x="330" y="420" />
59+
</bpmndi:BPMNEdge>
60+
<bpmndi:BPMNShape id="TextAnnotation_1_di" bpmnElement="TextAnnotation_1">
61+
<dc:Bounds x="460" y="305" width="120" height="35" />
62+
<bpmndi:BPMNLabel />
63+
</bpmndi:BPMNShape>
64+
</bpmndi:BPMNPlane>
65+
</bpmndi:BPMNDiagram>
66+
</bpmn2:definitions>

0 commit comments

Comments
 (0)