bpmn-js 0.20.4 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +2 -0
- package/lib/draw/BpmnRenderer.js +4 -3
- package/lib/features/copy-paste/BpmnCopyPaste.js +22 -19
- package/lib/features/label-editing/LabelEditingPreview.js +122 -0
- package/lib/features/label-editing/LabelEditingProvider.js +154 -55
- package/lib/features/label-editing/cmd/UpdateLabelHandler.js +10 -6
- package/lib/features/label-editing/index.js +8 -3
- package/lib/features/modeling/BpmnUpdater.js +17 -13
- package/lib/features/modeling/ElementFactory.js +36 -19
- package/lib/features/modeling/Modeling.js +5 -1
- package/lib/features/modeling/behavior/DropOnFlowBehavior.js +50 -16
- package/lib/features/modeling/behavior/ReplaceElementBehaviour.js +4 -2
- package/lib/features/modeling/behavior/util/LabelLayoutUtil.js +3 -2
- package/lib/features/modeling/behavior/util/LineAttachmentUtil.js +36 -30
- package/lib/features/rules/BpmnRules.js +29 -11
- package/lib/features/snapping/BpmnSnapping.js +22 -6
- package/package.json +22 -22
- package/test/TestHelper.js +1 -1
- package/test/fixtures/bpmn/features/label-editing/labels.bpmn +132 -202
- package/test/integration/CustomElementsSpec.js +2 -5
- package/test/spec/features/copy-paste/BpmnCopyPasteSpec.js +38 -0
- package/test/spec/features/label-editing/LabelEditingPreviewSpec.js +133 -0
- package/test/spec/features/label-editing/LabelEditingProviderSpec.js +207 -172
- package/test/spec/features/modeling/LabelBoundsSpec.js +3 -1
- package/test/spec/features/modeling/LabelLayoutingSpec.js +211 -232
- package/test/spec/features/modeling/behavior/DropOnFlowBehavior.bpmn +5 -1
- package/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js +174 -1
- package/test/spec/features/modeling/behavior/util/LabelLayoutUtilSpec.js +75 -0
- package/test/spec/features/modeling/behavior/util/LineAttachmentUtilSpec.js +55 -7
- package/test/spec/features/rules/BpmnRulesSpec.js +108 -64
- package/test/spec/features/snapping/BpmnSnapping.sequenceFlow.bpmn +41 -0
- package/test/spec/features/snapping/BpmnSnappingSpec.js +66 -0
|
@@ -1,248 +1,178 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
</
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
</
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<bpmn2:boundaryEvent id="boundary-event" name="A" attachedToRef="user-task" />
|
|
62
|
-
<bpmn2:startEvent id="start-event">
|
|
63
|
-
<bpmn2:outgoing>sequenceflow-unlabeled</bpmn2:outgoing>
|
|
64
|
-
</bpmn2:startEvent>
|
|
65
|
-
<bpmn2:sequenceFlow id="sequenceflow-unlabeled" name="" sourceRef="start-event" targetRef="exclusive-gateway" />
|
|
66
|
-
<bpmn2:exclusiveGateway id="exclusive-gateway" name="A">
|
|
67
|
-
<bpmn2:incoming>sequenceflow-unlabeled</bpmn2:incoming>
|
|
68
|
-
<bpmn2:outgoing>sequence-flow-no</bpmn2:outgoing>
|
|
69
|
-
<bpmn2:outgoing>sequence-flow-yes</bpmn2:outgoing>
|
|
70
|
-
</bpmn2:exclusiveGateway>
|
|
71
|
-
<bpmn2:sequenceFlow id="sequence-flow-no" name="A" sourceRef="exclusive-gateway" targetRef="call-activity" />
|
|
72
|
-
<bpmn2:sequenceFlow id="sequence-flow-yes" name="A" sourceRef="exclusive-gateway" targetRef="intermediate-throw-event" />
|
|
73
|
-
<bpmn2:dataStoreReference id="data-store-reference" name="A" dataStoreRef="DataStore_1" />
|
|
74
|
-
<bpmn2:dataObject id="DataObject_1" name="Data Object 1" />
|
|
75
|
-
<bpmn2:dataObjectReference id="data-object-reference" name="A" dataObjectRef="DataObject_1" />
|
|
76
|
-
<bpmn2:intermediateThrowEvent id="intermediate-throw-event" name="A">
|
|
77
|
-
<bpmn2:incoming>sequence-flow-yes</bpmn2:incoming>
|
|
78
|
-
<bpmn2:outgoing>SequenceFlow_1r751z0</bpmn2:outgoing>
|
|
79
|
-
</bpmn2:intermediateThrowEvent>
|
|
80
|
-
<bpmn2:task id="empty-task">
|
|
81
|
-
<bpmn2:incoming>SequenceFlow_1r751z0</bpmn2:incoming>
|
|
82
|
-
</bpmn2:task>
|
|
83
|
-
<bpmn2:sequenceFlow id="SequenceFlow_1r751z0" sourceRef="intermediate-throw-event" targetRef="empty-task" />
|
|
84
|
-
<bpmn2:association id="Association_1" sourceRef="text-annotation" targetRef="subprocess-expanded" />
|
|
85
|
-
</bpmn2:process>
|
|
86
|
-
<bpmn2:dataStore id="DataStore_1" name="Data Store 1" />
|
|
2
|
+
<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.6.0">
|
|
3
|
+
<bpmn:collaboration id="Collaboration_1o0amh9">
|
|
4
|
+
<bpmn:participant id="Participant_1" name="FOO BAR" processRef="Process_1" />
|
|
5
|
+
<bpmn:participant id="Participant_2" />
|
|
6
|
+
<bpmn:messageFlow id="MessageFlow_1" name="FOO" sourceRef="Task_1fo1fvh" targetRef="Participant_2" />
|
|
7
|
+
<bpmn:textAnnotation id="TextAnnotation_1"> <bpmn:text>FOO</bpmn:text>
|
|
8
|
+
</bpmn:textAnnotation>
|
|
9
|
+
</bpmn:collaboration>
|
|
10
|
+
<bpmn:process id="Process_1" isExecutable="false">
|
|
11
|
+
<bpmn:laneSet>
|
|
12
|
+
<bpmn:lane id="Lane_2">
|
|
13
|
+
<bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
|
|
14
|
+
<bpmn:flowNodeRef>SubProcess_1</bpmn:flowNodeRef>
|
|
15
|
+
</bpmn:lane>
|
|
16
|
+
<bpmn:lane id="Lane_1" name="FOO BAR">
|
|
17
|
+
<bpmn:flowNodeRef>Task_1</bpmn:flowNodeRef>
|
|
18
|
+
<bpmn:flowNodeRef>StartEvent_08jn2xd</bpmn:flowNodeRef>
|
|
19
|
+
<bpmn:flowNodeRef>Task_1fo1fvh</bpmn:flowNodeRef>
|
|
20
|
+
<bpmn:flowNodeRef>ExclusiveGateway_1</bpmn:flowNodeRef>
|
|
21
|
+
<bpmn:flowNodeRef>EndEvent_1</bpmn:flowNodeRef>
|
|
22
|
+
</bpmn:lane>
|
|
23
|
+
</bpmn:laneSet>
|
|
24
|
+
<bpmn:startEvent id="StartEvent_1" name="FOO">
|
|
25
|
+
<bpmn:outgoing>SequenceFlow_2</bpmn:outgoing>
|
|
26
|
+
</bpmn:startEvent>
|
|
27
|
+
<bpmn:sequenceFlow id="SequenceFlow_2" sourceRef="StartEvent_1" targetRef="SubProcess_1" />
|
|
28
|
+
<bpmn:subProcess id="SubProcess_1" name="FOO">
|
|
29
|
+
<bpmn:incoming>SequenceFlow_2</bpmn:incoming>
|
|
30
|
+
<bpmn:outgoing>SequenceFlow_14kuv1e</bpmn:outgoing>
|
|
31
|
+
</bpmn:subProcess>
|
|
32
|
+
<bpmn:startEvent id="StartEvent_08jn2xd" name="FOO BAR">
|
|
33
|
+
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
|
|
34
|
+
</bpmn:startEvent>
|
|
35
|
+
<bpmn:task id="Task_1" name="FOO">
|
|
36
|
+
<bpmn:incoming>SequenceFlow_1</bpmn:incoming>
|
|
37
|
+
<bpmn:incoming>SequenceFlow_14kuv1e</bpmn:incoming>
|
|
38
|
+
<bpmn:outgoing>SequenceFlow_13rjp44</bpmn:outgoing>
|
|
39
|
+
<bpmn:outgoing>SequenceFlow_0kmqqm9</bpmn:outgoing>
|
|
40
|
+
</bpmn:task>
|
|
41
|
+
<bpmn:sequenceFlow id="SequenceFlow_1" name="FOO" sourceRef="StartEvent_08jn2xd" targetRef="Task_1" />
|
|
42
|
+
<bpmn:sequenceFlow id="SequenceFlow_14kuv1e" sourceRef="SubProcess_1" targetRef="Task_1" />
|
|
43
|
+
<bpmn:task id="Task_1fo1fvh" name="FOO BAR">
|
|
44
|
+
<bpmn:incoming>SequenceFlow_13rjp44</bpmn:incoming>
|
|
45
|
+
<bpmn:outgoing>SequenceFlow_1h7vuvi</bpmn:outgoing>
|
|
46
|
+
</bpmn:task>
|
|
47
|
+
<bpmn:sequenceFlow id="SequenceFlow_13rjp44" sourceRef="Task_1" targetRef="Task_1fo1fvh" />
|
|
48
|
+
<bpmn:exclusiveGateway id="ExclusiveGateway_1" name="FOO">
|
|
49
|
+
<bpmn:incoming>SequenceFlow_1h7vuvi</bpmn:incoming>
|
|
50
|
+
</bpmn:exclusiveGateway>
|
|
51
|
+
<bpmn:sequenceFlow id="SequenceFlow_1h7vuvi" sourceRef="Task_1fo1fvh" targetRef="ExclusiveGateway_1" />
|
|
52
|
+
<bpmn:endEvent id="EndEvent_1">
|
|
53
|
+
<bpmn:incoming>SequenceFlow_0kmqqm9</bpmn:incoming>
|
|
54
|
+
</bpmn:endEvent>
|
|
55
|
+
<bpmn:sequenceFlow id="SequenceFlow_0kmqqm9" sourceRef="Task_1" targetRef="EndEvent_1" />
|
|
56
|
+
<bpmn:dataObjectReference id="DataObjectReference_1" dataObjectRef="DataObject_1rq8hb8" />
|
|
57
|
+
<bpmn:dataObject id="DataObject_1rq8hb8" />
|
|
58
|
+
<bpmn:dataStoreReference id="DataStoreReference_1" />
|
|
59
|
+
<bpmn:association id="Association_0ckvfj2" sourceRef="SubProcess_1" targetRef="TextAnnotation_1" />
|
|
60
|
+
</bpmn:process>
|
|
87
61
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
|
88
|
-
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="
|
|
89
|
-
<bpmndi:BPMNShape id="
|
|
90
|
-
<dc:Bounds x="
|
|
62
|
+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1o0amh9">
|
|
63
|
+
<bpmndi:BPMNShape id="Participant_15tkgjw_di" bpmnElement="Participant_1">
|
|
64
|
+
<dc:Bounds x="160" y="122" width="600" height="477" />
|
|
91
65
|
</bpmndi:BPMNShape>
|
|
92
|
-
<bpmndi:BPMNShape id="
|
|
93
|
-
<dc:Bounds x="
|
|
66
|
+
<bpmndi:BPMNShape id="Lane_00fz5ca_di" bpmnElement="Lane_2">
|
|
67
|
+
<dc:Bounds x="190" y="122" width="570" height="250" />
|
|
94
68
|
</bpmndi:BPMNShape>
|
|
95
|
-
<bpmndi:BPMNShape id="
|
|
96
|
-
<dc:Bounds x="
|
|
69
|
+
<bpmndi:BPMNShape id="Lane_1qi2aws_di" bpmnElement="Lane_1">
|
|
70
|
+
<dc:Bounds x="190" y="372" width="570" height="227" />
|
|
97
71
|
</bpmndi:BPMNShape>
|
|
98
|
-
<bpmndi:BPMNShape id="
|
|
99
|
-
<dc:Bounds x="
|
|
72
|
+
<bpmndi:BPMNShape id="SubProcess_194zznr_di" bpmnElement="SubProcess_1" isExpanded="true">
|
|
73
|
+
<dc:Bounds x="311" y="147" width="350" height="200" />
|
|
100
74
|
</bpmndi:BPMNShape>
|
|
101
|
-
<bpmndi:BPMNShape id="
|
|
102
|
-
<dc:Bounds x="
|
|
103
|
-
</bpmndi:BPMNShape>
|
|
104
|
-
<bpmndi:BPMNShape id="_BPMNShape_Lane_6" bpmnElement="nested-lane-no-label" isHorizontal="true">
|
|
105
|
-
<dc:Bounds x="120" y="324" width="480" height="337" />
|
|
106
|
-
</bpmndi:BPMNShape>
|
|
107
|
-
<bpmndi:BPMNShape id="_BPMNShape_SubProcess_2" bpmnElement="subprocess-expanded" isExpanded="true">
|
|
108
|
-
<dc:Bounds x="359" y="364" width="200" height="150" />
|
|
109
|
-
</bpmndi:BPMNShape>
|
|
110
|
-
<bpmndi:BPMNShape id="_BPMNShape_SubProcess_3" bpmnElement="subprocess-collapsed">
|
|
111
|
-
<dc:Bounds x="156" y="364" width="100" height="80" />
|
|
112
|
-
</bpmndi:BPMNShape>
|
|
113
|
-
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="nested-embedded-start-event">
|
|
114
|
-
<dc:Bounds x="188" y="386" width="36" height="36" />
|
|
75
|
+
<bpmndi:BPMNShape id="StartEvent_0909sti_di" bpmnElement="StartEvent_1">
|
|
76
|
+
<dc:Bounds x="223" y="229" width="36" height="36" />
|
|
115
77
|
<bpmndi:BPMNLabel>
|
|
116
|
-
<dc:Bounds x="
|
|
78
|
+
<dc:Bounds x="228" y="265" width="25" height="12" />
|
|
117
79
|
</bpmndi:BPMNLabel>
|
|
118
80
|
</bpmndi:BPMNShape>
|
|
119
|
-
<bpmndi:
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
<bpmndi:BPMNShape id="_BPMNShape_Participant_3" bpmnElement="collapsed-pool" isHorizontal="true">
|
|
123
|
-
<dc:Bounds x="672" y="336" width="385" height="100" />
|
|
124
|
-
</bpmndi:BPMNShape>
|
|
125
|
-
<bpmndi:BPMNShape id="_BPMNShape_TextAnnotation_2" bpmnElement="text-annotation">
|
|
126
|
-
<dc:Bounds x="60" y="669" width="147" height="98" />
|
|
127
|
-
</bpmndi:BPMNShape>
|
|
128
|
-
<bpmndi:BPMNEdge id="BPMNEdge_Association_1" bpmnElement="Association_1" sourceElement="_BPMNShape_TextAnnotation_2" targetElement="_BPMNShape_SubProcess_2">
|
|
129
|
-
<di:waypoint xsi:type="dc:Point" x="190" y="669" />
|
|
130
|
-
<di:waypoint xsi:type="dc:Point" x="371" y="514" />
|
|
131
|
-
</bpmndi:BPMNEdge>
|
|
132
|
-
<bpmndi:BPMNShape id="_BPMNShape_CallActivity_2" bpmnElement="call-activity">
|
|
133
|
-
<dc:Bounds x="422" y="202" width="100" height="80" />
|
|
134
|
-
</bpmndi:BPMNShape>
|
|
135
|
-
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_3" bpmnElement="start-event">
|
|
136
|
-
<dc:Bounds x="168" y="96" width="36" height="36" />
|
|
81
|
+
<bpmndi:BPMNEdge id="SequenceFlow_140ewlr_di" bpmnElement="SequenceFlow_2">
|
|
82
|
+
<di:waypoint xsi:type="dc:Point" x="259" y="247" />
|
|
83
|
+
<di:waypoint xsi:type="dc:Point" x="311" y="247" />
|
|
137
84
|
<bpmndi:BPMNLabel>
|
|
138
|
-
<dc:Bounds x="
|
|
85
|
+
<dc:Bounds x="285" y="232" width="0" height="0" />
|
|
139
86
|
</bpmndi:BPMNLabel>
|
|
87
|
+
</bpmndi:BPMNEdge>
|
|
88
|
+
<bpmndi:BPMNShape id="TextAnnotation_0vwfagl_di" bpmnElement="TextAnnotation_1">
|
|
89
|
+
<dc:Bounds x="814" y="122" width="100" height="30" />
|
|
140
90
|
</bpmndi:BPMNShape>
|
|
141
|
-
<bpmndi:
|
|
142
|
-
<
|
|
91
|
+
<bpmndi:BPMNEdge id="Association_0ckvfj2_di" bpmnElement="Association_0ckvfj2">
|
|
92
|
+
<di:waypoint xsi:type="dc:Point" x="661" y="196" />
|
|
93
|
+
<di:waypoint xsi:type="dc:Point" x="814" y="152" />
|
|
94
|
+
</bpmndi:BPMNEdge>
|
|
95
|
+
<bpmndi:BPMNShape id="StartEvent_08jn2xd_di" bpmnElement="StartEvent_08jn2xd">
|
|
96
|
+
<dc:Bounds x="223" y="416" width="36" height="36" />
|
|
143
97
|
<bpmndi:BPMNLabel>
|
|
144
|
-
<dc:Bounds x="
|
|
98
|
+
<dc:Bounds x="228" y="452" width="25" height="24" />
|
|
145
99
|
</bpmndi:BPMNLabel>
|
|
146
100
|
</bpmndi:BPMNShape>
|
|
147
|
-
<bpmndi:BPMNShape id="
|
|
148
|
-
<dc:Bounds x="
|
|
149
|
-
</bpmndi:BPMNShape>
|
|
150
|
-
<bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_2" bpmnElement="boundary-event">
|
|
151
|
-
<dc:Bounds x="228" y="254" width="36" height="36" />
|
|
152
|
-
<bpmndi:BPMNLabel>
|
|
153
|
-
<dc:Bounds x="200" y="295" width="93" height="22" />
|
|
154
|
-
</bpmndi:BPMNLabel>
|
|
101
|
+
<bpmndi:BPMNShape id="Task_1i068gk_di" bpmnElement="Task_1">
|
|
102
|
+
<dc:Bounds x="436" y="394" width="100" height="80" />
|
|
155
103
|
</bpmndi:BPMNShape>
|
|
156
|
-
<bpmndi:
|
|
157
|
-
<
|
|
104
|
+
<bpmndi:BPMNEdge id="SequenceFlow_088kva8_di" bpmnElement="SequenceFlow_1">
|
|
105
|
+
<di:waypoint xsi:type="dc:Point" x="259" y="434" />
|
|
106
|
+
<di:waypoint xsi:type="dc:Point" x="436" y="434" />
|
|
158
107
|
<bpmndi:BPMNLabel>
|
|
159
|
-
<dc:Bounds x="
|
|
108
|
+
<dc:Bounds x="335" y="409" width="25" height="12" />
|
|
160
109
|
</bpmndi:BPMNLabel>
|
|
161
|
-
</bpmndi:
|
|
162
|
-
<bpmndi:BPMNEdge id="
|
|
163
|
-
<di:waypoint xsi:type="dc:Point" x="
|
|
164
|
-
<di:waypoint xsi:type="dc:Point" x="
|
|
110
|
+
</bpmndi:BPMNEdge>
|
|
111
|
+
<bpmndi:BPMNEdge id="SequenceFlow_14kuv1e_di" bpmnElement="SequenceFlow_14kuv1e">
|
|
112
|
+
<di:waypoint xsi:type="dc:Point" x="486" y="347" />
|
|
113
|
+
<di:waypoint xsi:type="dc:Point" x="486" y="394" />
|
|
165
114
|
<bpmndi:BPMNLabel>
|
|
166
|
-
<dc:Bounds x="
|
|
115
|
+
<dc:Bounds x="501" y="360.5" width="0" height="0" />
|
|
167
116
|
</bpmndi:BPMNLabel>
|
|
168
117
|
</bpmndi:BPMNEdge>
|
|
169
|
-
<bpmndi:
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
118
|
+
<bpmndi:BPMNShape id="Task_1fo1fvh_di" bpmnElement="Task_1fo1fvh">
|
|
119
|
+
<dc:Bounds x="436" y="500" width="100" height="80" />
|
|
120
|
+
</bpmndi:BPMNShape>
|
|
121
|
+
<bpmndi:BPMNEdge id="SequenceFlow_13rjp44_di" bpmnElement="SequenceFlow_13rjp44">
|
|
122
|
+
<di:waypoint xsi:type="dc:Point" x="486" y="474" />
|
|
123
|
+
<di:waypoint xsi:type="dc:Point" x="486" y="500" />
|
|
173
124
|
<bpmndi:BPMNLabel>
|
|
174
|
-
<dc:Bounds x="
|
|
125
|
+
<dc:Bounds x="501" y="477" width="0" height="0" />
|
|
175
126
|
</bpmndi:BPMNLabel>
|
|
176
127
|
</bpmndi:BPMNEdge>
|
|
177
|
-
<bpmndi:
|
|
178
|
-
<
|
|
179
|
-
<di:waypoint xsi:type="dc:Point" x="397" y="114" />
|
|
128
|
+
<bpmndi:BPMNShape id="ExclusiveGateway_1dulwbf_di" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
|
|
129
|
+
<dc:Bounds x="578" y="515" width="50" height="50" />
|
|
180
130
|
<bpmndi:BPMNLabel>
|
|
181
|
-
<dc:Bounds x="
|
|
131
|
+
<dc:Bounds x="590" y="565" width="25" height="12" />
|
|
182
132
|
</bpmndi:BPMNLabel>
|
|
183
|
-
</bpmndi:
|
|
184
|
-
<bpmndi:BPMNEdge id="
|
|
185
|
-
<di:waypoint xsi:type="dc:Point" x="
|
|
186
|
-
<di:waypoint xsi:type="dc:Point" x="
|
|
187
|
-
<di:waypoint xsi:type="dc:Point" x="632" y="386" />
|
|
188
|
-
<di:waypoint xsi:type="dc:Point" x="672" y="386" />
|
|
133
|
+
</bpmndi:BPMNShape>
|
|
134
|
+
<bpmndi:BPMNEdge id="SequenceFlow_1h7vuvi_di" bpmnElement="SequenceFlow_1h7vuvi">
|
|
135
|
+
<di:waypoint xsi:type="dc:Point" x="536" y="540" />
|
|
136
|
+
<di:waypoint xsi:type="dc:Point" x="578" y="540" />
|
|
189
137
|
<bpmndi:BPMNLabel>
|
|
190
|
-
<dc:Bounds x="
|
|
138
|
+
<dc:Bounds x="557" y="515" width="0" height="0" />
|
|
191
139
|
</bpmndi:BPMNLabel>
|
|
192
140
|
</bpmndi:BPMNEdge>
|
|
193
|
-
<bpmndi:BPMNShape id="
|
|
194
|
-
<dc:Bounds x="
|
|
141
|
+
<bpmndi:BPMNShape id="EndEvent_0c4s9zs_di" bpmnElement="EndEvent_1">
|
|
142
|
+
<dc:Bounds x="585" y="416" width="36" height="36" />
|
|
195
143
|
<bpmndi:BPMNLabel>
|
|
196
|
-
<dc:Bounds x="
|
|
144
|
+
<dc:Bounds x="603" y="452" width="0" height="0" />
|
|
197
145
|
</bpmndi:BPMNLabel>
|
|
198
146
|
</bpmndi:BPMNShape>
|
|
199
|
-
<bpmndi:
|
|
200
|
-
<
|
|
147
|
+
<bpmndi:BPMNEdge id="SequenceFlow_0kmqqm9_di" bpmnElement="SequenceFlow_0kmqqm9">
|
|
148
|
+
<di:waypoint xsi:type="dc:Point" x="536" y="434" />
|
|
149
|
+
<di:waypoint xsi:type="dc:Point" x="585" y="434" />
|
|
201
150
|
<bpmndi:BPMNLabel>
|
|
202
|
-
<dc:Bounds x="
|
|
151
|
+
<dc:Bounds x="561" y="409" width="0" height="0" />
|
|
203
152
|
</bpmndi:BPMNLabel>
|
|
204
|
-
</bpmndi:
|
|
205
|
-
<bpmndi:BPMNShape id="
|
|
206
|
-
<dc:Bounds x="
|
|
153
|
+
</bpmndi:BPMNEdge>
|
|
154
|
+
<bpmndi:BPMNShape id="DataObjectReference_024w45b_di" bpmnElement="DataObjectReference_1">
|
|
155
|
+
<dc:Bounds x="223" y="515" width="36" height="50" />
|
|
207
156
|
<bpmndi:BPMNLabel>
|
|
208
|
-
<dc:Bounds x="
|
|
157
|
+
<dc:Bounds x="241" y="565" width="0" height="0" />
|
|
209
158
|
</bpmndi:BPMNLabel>
|
|
210
159
|
</bpmndi:BPMNShape>
|
|
211
|
-
<bpmndi:BPMNShape id="
|
|
212
|
-
<dc:Bounds x="
|
|
160
|
+
<bpmndi:BPMNShape id="DataStoreReference_0b4jv9b_di" bpmnElement="DataStoreReference_1">
|
|
161
|
+
<dc:Bounds x="315.54926829268294" y="515" width="50" height="50" />
|
|
213
162
|
<bpmndi:BPMNLabel>
|
|
214
|
-
<dc:Bounds x="
|
|
163
|
+
<dc:Bounds x="341" y="565" width="0" height="0" />
|
|
215
164
|
</bpmndi:BPMNLabel>
|
|
216
165
|
</bpmndi:BPMNShape>
|
|
217
|
-
<bpmndi:BPMNEdge id="
|
|
218
|
-
<di:waypoint xsi:type="dc:Point" x="
|
|
219
|
-
<di:waypoint xsi:type="dc:Point" x="
|
|
220
|
-
</bpmndi:BPMNEdge>
|
|
221
|
-
<bpmndi:BPMNEdge id="BPMNEdge_DataOutputAssociation_1" bpmnElement="DataOutputAssociation_1" sourceElement="_BPMNShape_SubProcess_2" targetElement="_BPMNShape_DataOutput_2">
|
|
222
|
-
<di:waypoint xsi:type="dc:Point" x="495" y="514" />
|
|
223
|
-
<di:waypoint xsi:type="dc:Point" x="510" y="547" />
|
|
224
|
-
</bpmndi:BPMNEdge>
|
|
225
|
-
<bpmndi:BPMNEdge id="BPMNEdge_DataInputAssociation_2" bpmnElement="DataInputAssociation_2" sourceElement="_BPMNShape_DataStoreReference_2" targetElement="_BPMNShape_SubProcess_3">
|
|
226
|
-
<di:waypoint xsi:type="dc:Point" x="185" y="547" />
|
|
227
|
-
<di:waypoint xsi:type="dc:Point" x="200" y="444" />
|
|
228
|
-
</bpmndi:BPMNEdge>
|
|
229
|
-
<bpmndi:BPMNEdge id="BPMNEdge_MessageFlow_2" bpmnElement="message-flow-unlabeled" sourceElement="_BPMNShape_Participant_3" targetElement="_BPMNShape_Participant_2">
|
|
230
|
-
<di:waypoint xsi:type="dc:Point" x="672" y="386" />
|
|
231
|
-
<di:waypoint xsi:type="dc:Point" x="600" y="386" />
|
|
166
|
+
<bpmndi:BPMNEdge id="MessageFlow_0pmpiw7_di" bpmnElement="MessageFlow_1">
|
|
167
|
+
<di:waypoint xsi:type="dc:Point" x="486" y="580" />
|
|
168
|
+
<di:waypoint xsi:type="dc:Point" x="486" y="646" />
|
|
232
169
|
<bpmndi:BPMNLabel>
|
|
233
|
-
<dc:Bounds x="
|
|
170
|
+
<dc:Bounds x="488" y="603" width="25" height="13" />
|
|
234
171
|
</bpmndi:BPMNLabel>
|
|
235
172
|
</bpmndi:BPMNEdge>
|
|
236
|
-
<bpmndi:BPMNShape id="
|
|
237
|
-
<dc:Bounds x="
|
|
173
|
+
<bpmndi:BPMNShape id="Participant_0kzj58d_di" bpmnElement="Participant_2">
|
|
174
|
+
<dc:Bounds x="161" y="646" width="600" height="250" />
|
|
238
175
|
</bpmndi:BPMNShape>
|
|
239
|
-
<bpmndi:BPMNEdge id="SequenceFlow_1r751z0_di" bpmnElement="SequenceFlow_1r751z0">
|
|
240
|
-
<di:waypoint xsi:type="dc:Point" x="433" y="114" />
|
|
241
|
-
<di:waypoint xsi:type="dc:Point" x="472" y="114" />
|
|
242
|
-
<bpmndi:BPMNLabel>
|
|
243
|
-
<dc:Bounds x="407.5" y="89" width="90" height="20" />
|
|
244
|
-
</bpmndi:BPMNLabel>
|
|
245
|
-
</bpmndi:BPMNEdge>
|
|
246
176
|
</bpmndi:BPMNPlane>
|
|
247
177
|
</bpmndi:BPMNDiagram>
|
|
248
|
-
</
|
|
178
|
+
</bpmn:definitions>
|
|
@@ -154,7 +154,7 @@ describe('custom elements', function() {
|
|
|
154
154
|
);
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
it('should connect a bpmn element to a custom one',
|
|
157
|
+
it('should not connect a bpmn element to a custom one',
|
|
158
158
|
inject(function(elementFactory, dragging, elementRegistry, connect) {
|
|
159
159
|
|
|
160
160
|
// given
|
|
@@ -170,11 +170,8 @@ describe('custom elements', function() {
|
|
|
170
170
|
|
|
171
171
|
dragging.end();
|
|
172
172
|
|
|
173
|
-
var connection = triangle.incoming[0];
|
|
174
|
-
|
|
175
173
|
// then
|
|
176
|
-
expect(
|
|
177
|
-
expect(connection.source).to.equal(subProcess);
|
|
174
|
+
expect(triangle.incoming).to.have.lengthOf(0);
|
|
178
175
|
})
|
|
179
176
|
);
|
|
180
177
|
|
|
@@ -58,6 +58,43 @@ describe('features/copy-paste', function() {
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
|
|
61
|
+
it('should paste twice', inject(
|
|
62
|
+
function(elementRegistry, canvas, copyPaste) {
|
|
63
|
+
// given
|
|
64
|
+
var element = elementRegistry.get('SubProcess_1kd6ist'),
|
|
65
|
+
rootElement = canvas.getRootElement();
|
|
66
|
+
|
|
67
|
+
// when
|
|
68
|
+
copyPaste.copy(element);
|
|
69
|
+
|
|
70
|
+
copyPaste.paste({
|
|
71
|
+
element: rootElement,
|
|
72
|
+
point: {
|
|
73
|
+
x: 1000,
|
|
74
|
+
y: 100
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
copyPaste.paste({
|
|
79
|
+
element: rootElement,
|
|
80
|
+
point: {
|
|
81
|
+
x: 1500,
|
|
82
|
+
y: 275
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// then
|
|
87
|
+
expect(rootElement.children).to.have.length(3);
|
|
88
|
+
|
|
89
|
+
var pastedElements = elementRegistry.filter(function(e) {
|
|
90
|
+
return e !== element && is(e, 'bpmn:SubProcess');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
expect(pastedElements[0].id).to.not.equal(pastedElements[1].id);
|
|
94
|
+
}
|
|
95
|
+
));
|
|
96
|
+
|
|
97
|
+
|
|
61
98
|
describe('integration', function() {
|
|
62
99
|
|
|
63
100
|
it('should retain label\'s relative position',
|
|
@@ -489,6 +526,7 @@ describe('features/copy-paste', function() {
|
|
|
489
526
|
it('multiple participants', inject(integrationTest([ 'Participant_0pgdgt4', 'Participant_1id96b4' ])));
|
|
490
527
|
|
|
491
528
|
it('multiple participants', inject(integrationTest([ 'Participant_0pgdgt4', 'Participant_1id96b4' ])));
|
|
529
|
+
|
|
492
530
|
});
|
|
493
531
|
|
|
494
532
|
});
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* global bootstrapViewer, inject */
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var labelEditingModule = require('../../../../lib/features/label-editing'),
|
|
7
|
+
coreModule = require('../../../../lib/core'),
|
|
8
|
+
draggingModule = require('diagram-js/lib/features/dragging'),
|
|
9
|
+
modelingModule = require('diagram-js/lib/features/modeling');
|
|
10
|
+
|
|
11
|
+
describe('features - label-editing preview', function() {
|
|
12
|
+
|
|
13
|
+
var diagramXML = require('../../../fixtures/bpmn/features/label-editing/labels.bpmn');
|
|
14
|
+
|
|
15
|
+
var testModules = [ labelEditingModule, coreModule, draggingModule, modelingModule ];
|
|
16
|
+
|
|
17
|
+
beforeEach(bootstrapViewer(diagramXML, { modules: testModules }));
|
|
18
|
+
|
|
19
|
+
describe('activate', function() {
|
|
20
|
+
|
|
21
|
+
it('[external labels AND text annotations ] should add marker to hide element on activate', inject(function(directEditing, elementRegistry) {
|
|
22
|
+
|
|
23
|
+
// given
|
|
24
|
+
var textAnnotation = elementRegistry.get('TextAnnotation_1');
|
|
25
|
+
|
|
26
|
+
// when
|
|
27
|
+
directEditing.activate(textAnnotation);
|
|
28
|
+
|
|
29
|
+
// then
|
|
30
|
+
var gfx = elementRegistry.getGraphics(textAnnotation);
|
|
31
|
+
|
|
32
|
+
expect(gfx.classList.contains('djs-element-hidden')).to.be.true;
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
it('[internal labels] should add marker to hide label on activate', inject(function(directEditing, elementRegistry) {
|
|
37
|
+
|
|
38
|
+
// given
|
|
39
|
+
var task = elementRegistry.get('Task_1');
|
|
40
|
+
|
|
41
|
+
// when
|
|
42
|
+
directEditing.activate(task);
|
|
43
|
+
|
|
44
|
+
// then
|
|
45
|
+
var gfx = elementRegistry.getGraphics(task);
|
|
46
|
+
|
|
47
|
+
expect(gfx.classList.contains('djs-label-hidden')).to.be.true;
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
describe('resize', function() {
|
|
54
|
+
|
|
55
|
+
it('[text annotations] should resize preview on resize', inject(function(directEditing, elementRegistry, eventBus, labelEditingPreview) {
|
|
56
|
+
|
|
57
|
+
// given
|
|
58
|
+
var textAnnotation = elementRegistry.get('TextAnnotation_1');
|
|
59
|
+
directEditing.activate(textAnnotation);
|
|
60
|
+
|
|
61
|
+
// when
|
|
62
|
+
eventBus.fire('directEditing.resize', {
|
|
63
|
+
width: 200,
|
|
64
|
+
height: 200,
|
|
65
|
+
dx: 100,
|
|
66
|
+
dy: 100
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// then
|
|
70
|
+
var bounds = labelEditingPreview.path.getBBox();
|
|
71
|
+
|
|
72
|
+
expect(bounds).to.eql({ x: 0, y: 0, width: 10, height: 300 });
|
|
73
|
+
}));
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
it('[text annotations] should resize preview below 0', inject(function(directEditing, elementRegistry, eventBus, labelEditingPreview) {
|
|
77
|
+
|
|
78
|
+
// given
|
|
79
|
+
var textAnnotation = elementRegistry.get('TextAnnotation_1');
|
|
80
|
+
directEditing.activate(textAnnotation);
|
|
81
|
+
|
|
82
|
+
// when
|
|
83
|
+
eventBus.fire('directEditing.resize', {
|
|
84
|
+
width: 200,
|
|
85
|
+
height: 200,
|
|
86
|
+
dx: -300,
|
|
87
|
+
dy: -300
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// then
|
|
91
|
+
var bounds = labelEditingPreview.path.getBBox();
|
|
92
|
+
|
|
93
|
+
expect(bounds).to.eql({ x: 0, y: 0, width: 10, height: 0 });
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
describe('complete/cancel', function() {
|
|
100
|
+
|
|
101
|
+
it('[external labels AND text annotations] should remove marker to hide element on complete', inject(function(directEditing, elementRegistry) {
|
|
102
|
+
|
|
103
|
+
// given
|
|
104
|
+
var textAnnotation = elementRegistry.get('TextAnnotation_1');
|
|
105
|
+
directEditing.activate(textAnnotation);
|
|
106
|
+
|
|
107
|
+
// when
|
|
108
|
+
directEditing.complete();
|
|
109
|
+
|
|
110
|
+
// then
|
|
111
|
+
var gfx = elementRegistry.getGraphics(textAnnotation);
|
|
112
|
+
|
|
113
|
+
expect(gfx.classList.contains('djs-element-hidden')).to.be.false;
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
it('[internal labels] should remove marker to hide label on complete', inject(function(directEditing, elementRegistry) {
|
|
118
|
+
|
|
119
|
+
// given
|
|
120
|
+
var task = elementRegistry.get('Task_1');
|
|
121
|
+
directEditing.activate(task);
|
|
122
|
+
|
|
123
|
+
// when
|
|
124
|
+
directEditing.complete();
|
|
125
|
+
|
|
126
|
+
// then
|
|
127
|
+
var gfx = elementRegistry.getGraphics(task);
|
|
128
|
+
|
|
129
|
+
expect(gfx.classList.contains('djs-label-hidden')).to.be.false;
|
|
130
|
+
}));
|
|
131
|
+
|
|
132
|
+
});
|
|
133
|
+
});
|