@jylups/cmmn-js 0.0.0-stage → 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.
Files changed (103) hide show
  1. package/.babelrc +3 -0
  2. package/CHANGELOG.md +119 -0
  3. package/LICENSE +23 -0
  4. package/README.md +107 -2
  5. package/dist/assets/cmmn-font/css/cmmn-codes.css +41 -0
  6. package/dist/assets/cmmn-font/css/cmmn-embedded.css +94 -0
  7. package/dist/assets/cmmn-font/css/cmmn.css +97 -0
  8. package/dist/assets/cmmn-font/font/cmmn.eot +0 -0
  9. package/dist/assets/cmmn-font/font/cmmn.svg +90 -0
  10. package/dist/assets/cmmn-font/font/cmmn.ttf +0 -0
  11. package/dist/assets/cmmn-font/font/cmmn.woff +0 -0
  12. package/dist/assets/cmmn-font/font/cmmn.woff2 +0 -0
  13. package/dist/assets/diagram-js.css +713 -0
  14. package/dist/cmmn-modeler.development.js +44817 -0
  15. package/dist/cmmn-modeler.production.min.js +2 -0
  16. package/dist/cmmn-navigated-viewer.development.js +18131 -0
  17. package/dist/cmmn-navigated-viewer.production.min.js +2 -0
  18. package/dist/cmmn-viewer.development.js +17599 -0
  19. package/dist/cmmn-viewer.production.min.js +2 -0
  20. package/index.js +1 -0
  21. package/lib/Modeler.js +222 -0
  22. package/lib/NavigatedViewer.js +28 -0
  23. package/lib/Viewer.js +489 -0
  24. package/lib/core/ItemRegistry.js +316 -0
  25. package/lib/core/index.js +7 -0
  26. package/lib/draw/CmmnRenderer.js +1235 -0
  27. package/lib/draw/PathMap.js +335 -0
  28. package/lib/draw/index.js +5 -0
  29. package/lib/features/auto-resize/CmmnAutoResizeProvider.js +57 -0
  30. package/lib/features/auto-resize/index.js +7 -0
  31. package/lib/features/context-pad/ContextPadProvider.js +240 -0
  32. package/lib/features/context-pad/index.js +11 -0
  33. package/lib/features/editor-actions/CmmnEditorActions.js +105 -0
  34. package/lib/features/editor-actions/index.js +10 -0
  35. package/lib/features/keyboard/CmmnKeyboardBindings.js +159 -0
  36. package/lib/features/keyboard/index.js +7 -0
  37. package/lib/features/label-editing/LabelEditingProvider.js +221 -0
  38. package/lib/features/label-editing/LabelUtil.js +95 -0
  39. package/lib/features/label-editing/cmd/UpdateLabelHandler.js +63 -0
  40. package/lib/features/label-editing/index.js +9 -0
  41. package/lib/features/modeling/CmmnFactory.js +166 -0
  42. package/lib/features/modeling/CmmnLayouter.js +49 -0
  43. package/lib/features/modeling/CmmnUpdater.js +511 -0
  44. package/lib/features/modeling/ElementFactory.js +215 -0
  45. package/lib/features/modeling/Modeling.js +185 -0
  46. package/lib/features/modeling/behavior/AttachCriterionBehavior.js +58 -0
  47. package/lib/features/modeling/behavior/CaseFileItemUpdater.js +324 -0
  48. package/lib/features/modeling/behavior/LabelBehavior.js +139 -0
  49. package/lib/features/modeling/behavior/PlanItemDefinitionUpdater.js +449 -0
  50. package/lib/features/modeling/behavior/PlanningTableUpdater.js +620 -0
  51. package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +320 -0
  52. package/lib/features/modeling/behavior/ReplaceElementBehavior.js +395 -0
  53. package/lib/features/modeling/behavior/ResizeCasePlanModelBehavior.js +108 -0
  54. package/lib/features/modeling/behavior/SentryUpdater.js +678 -0
  55. package/lib/features/modeling/behavior/UnclaimIdBehavior.js +28 -0
  56. package/lib/features/modeling/behavior/index.js +24 -0
  57. package/lib/features/modeling/cmd/AppendShapeHandler.js +52 -0
  58. package/lib/features/modeling/cmd/IdClaimHandler.js +38 -0
  59. package/lib/features/modeling/cmd/ReconnectConnectionHandler.js +57 -0
  60. package/lib/features/modeling/cmd/ReplaceShapeHandler.js +46 -0
  61. package/lib/features/modeling/cmd/UpdateControlsHandler.js +221 -0
  62. package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +240 -0
  63. package/lib/features/modeling/cmd/UpdateSemanticParentHandler.js +94 -0
  64. package/lib/features/modeling/index.js +20 -0
  65. package/lib/features/modeling/util/ModelingUtil.js +138 -0
  66. package/lib/features/modeling/util/PlanItemDefinitionUtil.js +183 -0
  67. package/lib/features/ordering/CmmnOrderingProvider.js +146 -0
  68. package/lib/features/ordering/index.js +4 -0
  69. package/lib/features/outline/Outline.js +47 -0
  70. package/lib/features/outline/index.js +6 -0
  71. package/lib/features/palette/PaletteProvider.js +171 -0
  72. package/lib/features/palette/index.js +12 -0
  73. package/lib/features/popup-menu/ReplaceMenuProvider.js +448 -0
  74. package/lib/features/popup-menu/index.js +4 -0
  75. package/lib/features/replace/CmmnReplace.js +355 -0
  76. package/lib/features/replace/ReplaceOptions.js +241 -0
  77. package/lib/features/replace/index.js +8 -0
  78. package/lib/features/replace-preview/CmmnReplacePreview.js +247 -0
  79. package/lib/features/replace-preview/index.js +7 -0
  80. package/lib/features/rules/CmmnRules.js +1040 -0
  81. package/lib/features/rules/index.js +7 -0
  82. package/lib/features/search/CmmnSearchProvider.js +129 -0
  83. package/lib/features/search/index.js +7 -0
  84. package/lib/features/snapping/CmmnConnectSnapping.js +110 -0
  85. package/lib/features/snapping/CmmnCreateMoveSnapping.js +148 -0
  86. package/lib/features/snapping/CmmnResizeSnapping.js +42 -0
  87. package/lib/features/snapping/CmmnSnappingUtil.js +76 -0
  88. package/lib/features/snapping/index.js +17 -0
  89. package/lib/import/CmmnImporter.js +251 -0
  90. package/lib/import/CmmnTreeWalker.js +410 -0
  91. package/lib/import/Importer.js +73 -0
  92. package/lib/import/Util.js +9 -0
  93. package/lib/import/index.js +3 -0
  94. package/lib/util/DiUtil.js +39 -0
  95. package/lib/util/LabelUtil.js +124 -0
  96. package/lib/util/ModelUtil.js +257 -0
  97. package/lib/util/PoweredByUtil.js +91 -0
  98. package/package.json +88 -4
  99. package/test/helper/index.js +231 -0
  100. package/test/util/KeyEvents.js +23 -0
  101. package/test/util/MockEvents.js +55 -0
  102. package/test/util/custom-rules/CustomRules.js +19 -0
  103. package/test/util/custom-rules/index.js +4 -0
@@ -0,0 +1,355 @@
1
+ 'use strict';
2
+
3
+ var ModelUtil = require('../../util/ModelUtil'),
4
+ is = ModelUtil.is,
5
+ getDefinition = ModelUtil.getDefinition,
6
+ isAutoComplete = ModelUtil.isAutoComplete;
7
+
8
+ var isCollapsed = require('../../util/DiUtil').isCollapsed,
9
+ isPlanningTableCollapsed = require('../../util/DiUtil').isPlanningTableCollapsed;
10
+
11
+ var isPlanningTableCapable = require('../modeling/util/PlanItemDefinitionUtil').isPlanningTableCapable;
12
+ var isItemCapable = require('../modeling/util/PlanItemDefinitionUtil').isItemCapable;
13
+
14
+ /**
15
+ * This module takes care of replacing CMMN elements
16
+ */
17
+ function CmmnReplace(cmmnFactory, replace, selection, cmmnRules) {
18
+
19
+ /**
20
+ * Prepares a new business object for the replacement element
21
+ * and triggers the replace operation.
22
+ *
23
+ * @param {djs.model.Base} element
24
+ * @param {Object} target
25
+ * @param {Object} [hints]
26
+ *
27
+ * @return {djs.model.Base} the newly created element
28
+ */
29
+ function replaceElement(element, target, hints) {
30
+
31
+ hints = hints || {};
32
+
33
+ var type = target.type,
34
+ oldBusinessObject = element.businessObject,
35
+ newBusinessObject;
36
+
37
+
38
+ // TODO: need also to respect min/max Size
39
+ var newElement = {
40
+ type: type
41
+ };
42
+
43
+ if (isCriterion(oldBusinessObject)) {
44
+ newBusinessObject = replaceCriterion(oldBusinessObject, type);
45
+ }
46
+
47
+
48
+ if (isItemCapable(oldBusinessObject)) {
49
+
50
+ var oldDefinition = getDefinition(oldBusinessObject),
51
+ definitionType = target.definitionType,
52
+ newDefinition = oldDefinition;
53
+
54
+
55
+ // replace plan item definition if necessary
56
+ if (oldDefinition.$type !== definitionType) {
57
+ newDefinition = replacePlanItemDefinition(oldDefinition, definitionType);
58
+ }
59
+
60
+
61
+ // replace plan/discretionary item
62
+ newBusinessObject = replaceItemCapable(oldBusinessObject, type, newDefinition);
63
+
64
+
65
+ // handle isCollapsed property
66
+ if (isPlanFragment(oldDefinition) && isPlanFragment(newDefinition) && target.isCollapsed !== false) {
67
+ newElement.isCollapsed = isCollapsed(oldBusinessObject);
68
+ }
69
+
70
+
71
+ // switch collapsed/expanded plan fragment
72
+ if (isTask(oldDefinition) && target.isCollapsed === true) {
73
+ newElement.isCollapsed = true;
74
+ }
75
+
76
+ if (isTask(newDefinition) && target.isBlocking === false) {
77
+ newElement.isBlocking = false;
78
+ }
79
+
80
+
81
+ // handle isPlanningTableCollapsed property
82
+ if (isPlanningTableCapable(oldDefinition) && isPlanningTableCapable(newDefinition)) {
83
+ newElement.isPlanningTableCollapsed = isPlanningTableCollapsed(oldBusinessObject);
84
+ }
85
+
86
+
87
+ // handle autoComplete property
88
+ if (isStage(oldDefinition) && isStage(newDefinition)) {
89
+ newElement.autoComplete = isAutoComplete(oldBusinessObject);
90
+ }
91
+
92
+
93
+ // TODO: need also to respect min/max Size
94
+ // copy size, from an expanded plan fragment to an expanded alternative plan fragment
95
+ // except cmmn:Task, because Task is always expanded
96
+ if (!isCollapsed(oldBusinessObject) && !target.isCollapsed && !isTask(oldDefinition)) {
97
+ newElement.width = element.width;
98
+ newElement.height = element.height;
99
+ }
100
+ }
101
+
102
+ // create new business object if necessary
103
+ newElement.businessObject = newBusinessObject || cmmnFactory.create(type);
104
+
105
+ // trigger replacement
106
+ newElement = replace.replaceElement(element, newElement, hints);
107
+
108
+
109
+ if (hints.select !== false) {
110
+ selection.select(newElement);
111
+ }
112
+
113
+ return newElement;
114
+ }
115
+
116
+ this.replaceElement = replaceElement;
117
+
118
+
119
+ function replaceCriterion(criterion, type) {
120
+
121
+ var newCriterion;
122
+
123
+ if (criterion) {
124
+
125
+ type = type || criterion.$type;
126
+
127
+ newCriterion = cmmnFactory.createCriterion(type, {
128
+ sentryRef: criterion.sentryRef,
129
+ name: criterion.name
130
+ });
131
+
132
+ }
133
+
134
+ return newCriterion;
135
+
136
+ }
137
+
138
+ this.replaceCriterion = replaceCriterion;
139
+
140
+
141
+ function replaceSentry(sentry) {
142
+
143
+ var newSentry;
144
+
145
+ if (sentry) {
146
+
147
+ newSentry = cmmnFactory.createSentry({
148
+ name: sentry.name
149
+ });
150
+
151
+ if (sentry.ifPart) {
152
+
153
+ var newIfPart = cmmnFactory.create('cmmn:IfPart');
154
+ setParent(newIfPart, newSentry);
155
+ newSentry.ifPart = newIfPart;
156
+
157
+ var condition = replaceCondition(sentry.ifPart.condition);
158
+ setParent(condition, newIfPart);
159
+ newIfPart.condition = condition;
160
+
161
+ }
162
+
163
+ }
164
+
165
+ return newSentry;
166
+ }
167
+
168
+ this.replaceSentry = replaceSentry;
169
+
170
+
171
+ function replacePlanItemDefinition(definition, type) {
172
+
173
+ type = type || definition.$type;
174
+
175
+ var newDefinition = cmmnFactory.create(type, {
176
+ name: definition.name
177
+ });
178
+
179
+ if (isPlanItemControlCapable(newDefinition) && definition.defaultControl) {
180
+
181
+ var defaultControl = replacePlanItemControl(definition.defaultControl, newDefinition);
182
+
183
+ setParent(defaultControl, newDefinition);
184
+ newDefinition.defaultControl = defaultControl;
185
+
186
+ }
187
+
188
+ if (isStage(newDefinition) && definition.autoComplete) {
189
+ newDefinition.autoComplete = definition.autoComplete;
190
+ }
191
+
192
+ if (isTask(definition) && isTask(newDefinition)) {
193
+ newDefinition.isBlocking = definition.isBlocking;
194
+ }
195
+
196
+ return newDefinition;
197
+
198
+ }
199
+
200
+ this.replacePlanItemDefinition = replacePlanItemDefinition;
201
+
202
+
203
+ function replaceItemCapable(item, type, definition) {
204
+
205
+ type = type || item.$type;
206
+ definition = definition || getDefinition(item);
207
+
208
+ var newItem = cmmnFactory.create(type, {
209
+ name: item.name,
210
+ definitionRef: definition
211
+ });
212
+
213
+ if (isPlanItemControlCapable(newItem) && item.itemControl) {
214
+
215
+ var itemControl = replacePlanItemControl(item.itemControl, newItem);
216
+
217
+ setParent(itemControl, newItem);
218
+ newItem.itemControl = itemControl;
219
+
220
+ }
221
+
222
+ return newItem;
223
+
224
+ }
225
+
226
+ this.replaceItemCapable = replaceItemCapable;
227
+
228
+
229
+ function replacePlanItemControl(control, element) {
230
+
231
+ var newControl;
232
+
233
+ if (control) {
234
+
235
+ newControl = cmmnFactory.create('cmmn:PlanItemControl');
236
+
237
+ var repetitionRule = control.repetitionRule;
238
+ if (repetitionRule && (!element || cmmnRules.canSetRepetitionRule(element))) {
239
+
240
+ repetitionRule = replaceRule(repetitionRule);
241
+
242
+ setParent(repetitionRule, newControl);
243
+ newControl.repetitionRule = repetitionRule;
244
+
245
+ }
246
+
247
+ var requiredRule = control.requiredRule;
248
+ if (requiredRule && (!element || cmmnRules.canSetRequiredRule(element))) {
249
+
250
+ requiredRule = replaceRule(requiredRule);
251
+
252
+ setParent(requiredRule, newControl);
253
+ newControl.requiredRule = requiredRule;
254
+
255
+ }
256
+
257
+ var manualActivationRule = control.manualActivationRule;
258
+ if (manualActivationRule && (!element || cmmnRules.canSetManualActivationRule(element))) {
259
+
260
+ manualActivationRule = replaceRule(manualActivationRule);
261
+
262
+ setParent(manualActivationRule, newControl);
263
+ newControl.manualActivationRule = manualActivationRule;
264
+
265
+ }
266
+
267
+ }
268
+
269
+ return newControl;
270
+
271
+ }
272
+
273
+ this.replacePlanItemControl = replacePlanItemControl;
274
+
275
+
276
+ function replaceRule(rule) {
277
+
278
+ var newRule;
279
+
280
+ if (rule) {
281
+
282
+ var type = rule.$type;
283
+
284
+ var condition = replaceCondition(rule.condition);
285
+ newRule = cmmnFactory.create(type, {
286
+ condition: condition
287
+ });
288
+
289
+ setParent(condition, newRule);
290
+
291
+ }
292
+
293
+ return newRule;
294
+
295
+ }
296
+
297
+ this.replaceRule = replaceRule;
298
+
299
+
300
+ function replaceCondition(condition) {
301
+ var newCondition;
302
+
303
+ if (condition) {
304
+ newCondition = cmmnFactory.create('cmmn:Expression', {
305
+ language: condition.language,
306
+ body: condition.body
307
+ });
308
+ }
309
+
310
+ return newCondition;
311
+ }
312
+
313
+ this.replaceCondition = replaceCondition;
314
+
315
+
316
+ function setParent(element, parent) {
317
+ if (element) {
318
+ element.$parent = parent;
319
+ }
320
+ }
321
+
322
+ }
323
+
324
+ CmmnReplace.$inject = [ 'cmmnFactory', 'replace', 'selection', 'cmmnRules' ];
325
+
326
+ module.exports = CmmnReplace;
327
+
328
+ function isInstanceOf(element, type) {
329
+ element = getDefinition(element);
330
+ return is(element, type);
331
+ }
332
+
333
+ function isTask(element) {
334
+ return isInstanceOf(element, 'cmmn:Task');
335
+ }
336
+
337
+ function isMilestone(element) {
338
+ return isInstanceOf(element, 'cmmn:Milestone');
339
+ }
340
+
341
+ function isPlanFragment(element) {
342
+ return isInstanceOf(element, 'cmmn:PlanFragment');
343
+ }
344
+
345
+ function isStage(element) {
346
+ return isInstanceOf(element, 'cmmn:Stage');
347
+ }
348
+
349
+ function isCriterion(element) {
350
+ return is(element, 'cmmn:Criterion');
351
+ }
352
+
353
+ function isPlanItemControlCapable(element) {
354
+ return isTask(element) || isStage(element) || isMilestone(element);
355
+ }
@@ -0,0 +1,241 @@
1
+ 'use strict';
2
+
3
+
4
+ module.exports.TASK = [
5
+ {
6
+ label: 'Task',
7
+ actionName: 'replace-with-task-plan-item',
8
+ className: 'cmmn-icon-task-none',
9
+ target: {
10
+ definitionType: 'cmmn:Task',
11
+ type: 'cmmn:PlanItem'
12
+ }
13
+ },
14
+ {
15
+ label: 'Human Task',
16
+ actionName: 'replace-with-blocking-human-task-plan-item',
17
+ className: 'cmmn-icon-human-blocking-task',
18
+ target: {
19
+ definitionType: 'cmmn:HumanTask',
20
+ type: 'cmmn:PlanItem',
21
+ isBlocking: true
22
+ }
23
+ },
24
+ {
25
+ label: 'Human Task',
26
+ actionName: 'replace-with-non-blocking-human-task-plan-item',
27
+ className: 'cmmn-icon-human-non-blocking-task',
28
+ target: {
29
+ definitionType: 'cmmn:HumanTask',
30
+ type: 'cmmn:PlanItem',
31
+ isBlocking: false
32
+ }
33
+ },
34
+ {
35
+ label: 'Decision Task',
36
+ actionName: 'replace-with-decision-task-plan-item',
37
+ className: 'cmmn-icon-decision-task',
38
+ target: {
39
+ definitionType: 'cmmn:DecisionTask',
40
+ type: 'cmmn:PlanItem'
41
+ }
42
+ },
43
+ {
44
+ label: 'Process Task',
45
+ actionName: 'replace-with-process-task-plan-item',
46
+ className: 'cmmn-icon-process-task',
47
+ target: {
48
+ definitionType: 'cmmn:ProcessTask',
49
+ type: 'cmmn:PlanItem'
50
+ }
51
+ },
52
+ {
53
+ label: 'Case Task',
54
+ actionName: 'replace-with-case-task-plan-item',
55
+ className: 'cmmn-icon-case-task',
56
+ target: {
57
+ definitionType: 'cmmn:CaseTask',
58
+ type: 'cmmn:PlanItem'
59
+ }
60
+ },
61
+ {
62
+ label: 'Stage (collapsed)',
63
+ actionName: 'replace-with-collapsed-stage-plan-item',
64
+ className: 'cmmn-icon-stage-collapsed',
65
+ target: {
66
+ definitionType: 'cmmn:Stage',
67
+ type: 'cmmn:PlanItem',
68
+ isCollapsed: true
69
+ }
70
+ },
71
+ {
72
+ label: 'Stage (expanded)',
73
+ actionName: 'replace-with-expanded-stage-plan-item',
74
+ className: 'cmmn-icon-stage-expanded',
75
+ target: {
76
+ definitionType: 'cmmn:Stage',
77
+ type: 'cmmn:PlanItem',
78
+ isCollapsed: false
79
+ }
80
+ },
81
+ {
82
+ label: 'Discretionary Task',
83
+ actionName: 'replace-with-task-discretionary-item',
84
+ className: 'cmmn-icon-task-discretionary',
85
+ target: {
86
+ definitionType: 'cmmn:Task',
87
+ type: 'cmmn:DiscretionaryItem'
88
+ }
89
+ },
90
+ {
91
+ label: 'Discretionary Human Task',
92
+ actionName: 'replace-with-blocking-human-task-discretionary-item',
93
+ className: 'cmmn-icon-human-blocking-task-discretionary',
94
+ target: {
95
+ definitionType: 'cmmn:HumanTask',
96
+ type: 'cmmn:DiscretionaryItem',
97
+ isBlocking: true
98
+ }
99
+ },
100
+ {
101
+ label: 'Discretionary Human Task',
102
+ actionName: 'replace-with-non-blocking-human-task-discretionary-item',
103
+ className: 'cmmn-icon-human-non-blocking-task-discretionary',
104
+ target: {
105
+ definitionType: 'cmmn:HumanTask',
106
+ type: 'cmmn:DiscretionaryItem',
107
+ isBlocking: false
108
+ }
109
+ },
110
+ {
111
+ label: 'Discretionary Decision Task',
112
+ actionName: 'replace-with-decision-task-discretionary-item',
113
+ className: 'cmmn-icon-decision-task-discretionary',
114
+ target: {
115
+ definitionType: 'cmmn:DecisionTask',
116
+ type: 'cmmn:DiscretionaryItem'
117
+ }
118
+ },
119
+ {
120
+ label: 'Discretionary Process Task',
121
+ actionName: 'replace-with-process-task-discretionary-item',
122
+ className: 'cmmn-icon-process-task-discretionary',
123
+ target: {
124
+ definitionType: 'cmmn:ProcessTask',
125
+ type: 'cmmn:DiscretionaryItem'
126
+ }
127
+ },
128
+ {
129
+ label: 'Discretionary Case Task',
130
+ actionName: 'replace-with-case-task-discretionary-item',
131
+ className: 'cmmn-icon-case-task-discretionary',
132
+ target: {
133
+ definitionType: 'cmmn:CaseTask',
134
+ type: 'cmmn:DiscretionaryItem'
135
+ }
136
+ },
137
+ {
138
+ label: 'Discretionary Stage (collapsed)',
139
+ actionName: 'replace-with-collapsed-stage-discretionary-item',
140
+ className: 'cmmn-icon-stage-collapsed-discretionary',
141
+ target: {
142
+ definitionType: 'cmmn:Stage',
143
+ type: 'cmmn:DiscretionaryItem',
144
+ isCollapsed: true
145
+ }
146
+ },
147
+ {
148
+ label: 'Discretionary Stage (expanded)',
149
+ actionName: 'replace-with-expanded-stage-discretionary-item',
150
+ className: 'cmmn-icon-stage-expanded-discretionary',
151
+ target: {
152
+ definitionType: 'cmmn:Stage',
153
+ type: 'cmmn:DiscretionaryItem',
154
+ isCollapsed: false
155
+ }
156
+ }
157
+ ];
158
+
159
+
160
+ module.exports.PLAN_FRAGMENT_EXPANDED = [
161
+ {
162
+ label: 'Stage',
163
+ actionName: 'replace-with-stage-plan-item',
164
+ className: 'cmmn-icon-stage-expanded',
165
+ target: {
166
+ definitionType: 'cmmn:Stage',
167
+ type: 'cmmn:PlanItem',
168
+ isCollapsed: false
169
+ }
170
+ },
171
+ {
172
+ label: 'Discretionary Stage',
173
+ actionName: 'replace-with-stage-discretionary-item',
174
+ className: 'cmmn-icon-stage-expanded-discretionary',
175
+ target: {
176
+ definitionType: 'cmmn:Stage',
177
+ type: 'cmmn:DiscretionaryItem',
178
+ isCollapsed: false
179
+ }
180
+ },
181
+ {
182
+ label: 'Discretionary Plan Fragment',
183
+ actionName: 'replace-with-plan-fragment-discretionary-item',
184
+ className: 'cmmn-icon-plan-fragment-expanded-discretionary',
185
+ target: {
186
+ definitionType: 'cmmn:PlanFragment',
187
+ type: 'cmmn:DiscretionaryItem',
188
+ isCollapsed: false
189
+ }
190
+ }
191
+ ];
192
+
193
+ module.exports.EVENT_LISTENER = [
194
+ {
195
+ label: 'Event Listener',
196
+ actionName: 'replace-with-event-listener-plan-item',
197
+ className: 'cmmn-icon-event-listener',
198
+ target: {
199
+ definitionType: 'cmmn:EventListener',
200
+ type: 'cmmn:PlanItem'
201
+ }
202
+ },
203
+ {
204
+ label: 'Timer Event Listener',
205
+ actionName: 'replace-with-timer-event-listener-plan-item',
206
+ className: 'cmmn-icon-timer-event-listener',
207
+ target: {
208
+ definitionType: 'cmmn:TimerEventListener',
209
+ type: 'cmmn:PlanItem'
210
+ }
211
+ },
212
+ {
213
+ label: 'User Event Listener',
214
+ actionName: 'replace-with-user-event-listener-plan-item',
215
+ className: 'cmmn-icon-user-event-listener',
216
+ target: {
217
+ definitionType: 'cmmn:UserEventListener',
218
+ type: 'cmmn:PlanItem'
219
+ }
220
+ }
221
+ ];
222
+
223
+
224
+ module.exports.CRITERION = [
225
+ {
226
+ label: 'Entry Criterion',
227
+ actionName: 'replace-with-entry-criterion',
228
+ className: 'cmmn-icon-entry-criterion',
229
+ target: {
230
+ type: 'cmmn:EntryCriterion'
231
+ }
232
+ },
233
+ {
234
+ label: 'Exit Criterion',
235
+ actionName: 'replace-with-exit-criterion',
236
+ className: 'cmmn-icon-exit-criterion',
237
+ target: {
238
+ type: 'cmmn:ExitCriterion'
239
+ }
240
+ }
241
+ ];
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ __depends__: [
3
+ require('diagram-js/lib/features/popup-menu').default,
4
+ require('diagram-js/lib/features/replace').default,
5
+ require('diagram-js/lib/features/selection').default
6
+ ],
7
+ cmmnReplace: [ 'type', require('./CmmnReplace') ]
8
+ };