@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,171 @@
1
+ 'use strict';
2
+
3
+ var assign = require('min-dash').assign;
4
+
5
+ /**
6
+ * A palette provider for CMMN 1.1 elements.
7
+ */
8
+ function PaletteProvider(
9
+ create,
10
+ elementFactory,
11
+ globalConnect,
12
+ handTool,
13
+ lassoTool,
14
+ palette,
15
+ spaceTool
16
+ ) {
17
+
18
+ this._create = create;
19
+ this._elementFactory = elementFactory;
20
+ this._globalConnect = globalConnect;
21
+ this._handTool = handTool;
22
+ this._palette = palette;
23
+ this._lassoTool = lassoTool;
24
+ this._spaceTool = spaceTool;
25
+
26
+ palette.registerProvider(this);
27
+ }
28
+
29
+ module.exports = PaletteProvider;
30
+
31
+ PaletteProvider.$inject = [
32
+ 'create',
33
+ 'elementFactory',
34
+ 'globalConnect',
35
+ 'handTool',
36
+ 'lassoTool',
37
+ 'palette',
38
+ 'spaceTool'
39
+ ];
40
+
41
+
42
+ PaletteProvider.prototype.getPaletteEntries = function(element) {
43
+
44
+ var actions = {},
45
+ create = this._create,
46
+ elementFactory = this._elementFactory,
47
+ spaceTool = this._spaceTool,
48
+ lassoTool = this._lassoTool,
49
+ globalConnect = this._globalConnect,
50
+ handTool = this._handTool;
51
+
52
+ function createPlanItem(type, group, className, title) {
53
+
54
+ function createListener(event) {
55
+ create.start(event, elementFactory.createPlanItemShape(type));
56
+ }
57
+
58
+ var shortType = type.replace(/^cmmn:/, '');
59
+
60
+ return {
61
+ group: group,
62
+ className: className,
63
+ title: title || 'Create ' + shortType,
64
+ action: {
65
+ dragstart: createListener,
66
+ click: createListener
67
+ }
68
+ };
69
+ }
70
+
71
+ function createCasePlanModel(event) {
72
+ create.start(event, elementFactory.createCasePlanModelShape());
73
+ }
74
+
75
+ function createCriterion(event) {
76
+ create.start(event, elementFactory.createCriterionShape('cmmn:EntryCriterion'));
77
+ }
78
+
79
+ function createCaseFileItem(event) {
80
+ create.start(event, elementFactory.createCaseFileItemShape());
81
+ }
82
+
83
+ assign(actions, {
84
+ 'hand-tool': {
85
+ group: 'tools',
86
+ className: 'cmmn-icon-hand-tool',
87
+ title: 'Activate the hand tool',
88
+ action: {
89
+ click: function(event) {
90
+ handTool.activateHand(event);
91
+ }
92
+ }
93
+ },
94
+ 'lasso-tool': {
95
+ group: 'tools',
96
+ className: 'cmmn-icon-lasso-tool',
97
+ title: 'Activate the lasso tool',
98
+ action: {
99
+ click: function(event) {
100
+ lassoTool.activateSelection(event);
101
+ }
102
+ }
103
+ },
104
+ 'space-tool': {
105
+ group: 'tools',
106
+ className: 'cmmn-icon-space-tool',
107
+ title: 'Activate the create/remove space tool',
108
+ action: {
109
+ click: function(event) {
110
+ spaceTool.activateSelection(event);
111
+ }
112
+ }
113
+ },
114
+ 'global-connect-tool': {
115
+ group: 'tools',
116
+ className: 'cmmn-icon-connection',
117
+ title: 'Activate the global connect tool',
118
+ action: {
119
+ click: function(event) {
120
+ globalConnect.toggle(event);
121
+ }
122
+ }
123
+ },
124
+ 'tool-separator': {
125
+ group: 'tools',
126
+ separator: true
127
+ },
128
+ 'create.task': createPlanItem(
129
+ 'cmmn:Task', 'planItem', 'cmmn-icon-task'
130
+ ),
131
+ 'create.stage': createPlanItem(
132
+ 'cmmn:Stage', 'planItem', 'cmmn-icon-stage-expanded', 'Create expanded Stage'
133
+ ),
134
+ 'create.milestone': createPlanItem(
135
+ 'cmmn:Milestone', 'planItem', 'cmmn-icon-milestone'
136
+ ),
137
+ 'create.eventListener': createPlanItem(
138
+ 'cmmn:EventListener', 'planItem', 'cmmn-icon-event-listener'
139
+ ),
140
+ 'create.criterion': {
141
+ group: 'criterion',
142
+ className: 'cmmn-icon-entry-criterion',
143
+ title: 'Create Criterion',
144
+ action: {
145
+ dragstart: createCriterion,
146
+ click: createCriterion
147
+ }
148
+ },
149
+ 'create.casePlanModel': {
150
+ group: 'casePlanModel',
151
+ className: 'cmmn-icon-case-plan-model',
152
+ title: 'Create CasePlanModel',
153
+ action: {
154
+ dragstart: createCasePlanModel,
155
+ click: createCasePlanModel
156
+ }
157
+ },
158
+ 'create.caseFileItem': {
159
+ group: 'caseFileItem',
160
+ className: 'cmmn-icon-case-file-item',
161
+ title: 'Create Case File Item',
162
+ action: {
163
+ dragstart: createCaseFileItem,
164
+ click: createCaseFileItem
165
+ }
166
+ }
167
+
168
+ });
169
+
170
+ return actions;
171
+ };
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ __depends__: [
3
+ require('diagram-js/lib/features/palette').default,
4
+ require('diagram-js/lib/features/create').default,
5
+ require('diagram-js/lib/features/space-tool').default,
6
+ require('diagram-js/lib/features/lasso-tool').default,
7
+ require('diagram-js/lib/features/hand-tool').default,
8
+ require('diagram-js/lib/features/global-connect').default
9
+ ],
10
+ __init__: [ 'paletteProvider' ],
11
+ paletteProvider: [ 'type', require('./PaletteProvider') ]
12
+ };
@@ -0,0 +1,448 @@
1
+ 'use strict';
2
+
3
+ var forEach = require('min-dash').forEach,
4
+ filter = require('min-dash').filter;
5
+
6
+ var replaceOptions = require('../replace/ReplaceOptions');
7
+
8
+ var isItemCapable = require('../modeling/util/PlanItemDefinitionUtil').isItemCapable;
9
+
10
+ var isAny = require('../modeling/util/ModelingUtil').isAny;
11
+
12
+ var ModelUtil = require('../../util/ModelUtil'),
13
+ getBusinessObject = ModelUtil.getBusinessObject,
14
+ getDefinition = ModelUtil.getDefinition,
15
+ isCasePlanModel = ModelUtil.isCasePlanModel,
16
+ isRequired = ModelUtil.isRequired,
17
+ isRepeatable = ModelUtil.isRepeatable,
18
+ isManualActivation = ModelUtil.isManualActivation,
19
+ is = ModelUtil.is;
20
+
21
+ var isCollapsed = require('../../util/DiUtil').isCollapsed;
22
+
23
+
24
+ /**
25
+ * Returns true, if an element is from a different type.
26
+ * discretionary / non discretionary
27
+ *
28
+ * @param {djs.model.Base} element
29
+ * @param {Object} entry
30
+ *
31
+ * @return {Boolean}
32
+ */
33
+ function isDifferentType(element, entry) {
34
+
35
+ var businessObject = getBusinessObject(element);
36
+
37
+ return businessObject.$type !== entry.target.type;
38
+ }
39
+
40
+
41
+ /**
42
+ * Returns true if the definition type is different.
43
+ * e.g. process task / human task
44
+ *
45
+ * @param {djs.model.Base} element
46
+ * @param {Object} entry
47
+ *
48
+ * @return {Boolean}
49
+ */
50
+ function isDifferentDefinitionType(element, entry) {
51
+
52
+ return getDefinition(element).$type !== entry.target.definitionType;
53
+ }
54
+
55
+
56
+ function canReplaceElementByTarget(element, target) {
57
+
58
+ var type = target.type,
59
+ definitionType = target.definitionType,
60
+ parent = element.parent,
61
+ definition = getDefinition(element);
62
+
63
+ if (isPlanItem(element)) {
64
+ if (type === 'cmmn:DiscretionaryItem' && !isStage(parent)) {
65
+ return false;
66
+ }
67
+ }
68
+
69
+ if (definitionType === 'cmmn:HumanTask') {
70
+
71
+ if (isPlanFragment(element) && !target.isBlocking) {
72
+ return false;
73
+ }
74
+
75
+ if (isTask(element) && definition.isBlocking !== target.isBlocking) {
76
+ return false;
77
+ }
78
+
79
+ }
80
+
81
+ return true;
82
+
83
+ }
84
+
85
+
86
+ /**
87
+ * This module is an element agnostic replace menu provider for the popup menu.
88
+ */
89
+ function ReplaceMenuProvider(popupMenu, cmmnReplace, cmmnFactory, modeling, rules) {
90
+
91
+ this._popupMenu = popupMenu;
92
+ this._cmmnReplace = cmmnReplace;
93
+ this._cmmnFactory = cmmnFactory;
94
+ this._modeling = modeling;
95
+ this._rules = rules;
96
+
97
+ this.register();
98
+ }
99
+
100
+ ReplaceMenuProvider.$inject = [ 'popupMenu', 'cmmnReplace', 'cmmnFactory', 'modeling', 'rules' ];
101
+
102
+
103
+ /**
104
+ * Register replace menu provider in the popup menu
105
+ */
106
+ ReplaceMenuProvider.prototype.register = function() {
107
+ this._popupMenu.registerProvider('cmmn-replace', this);
108
+ };
109
+
110
+
111
+ /**
112
+ * Get all entries from replaceOptions for the given element and apply filters
113
+ * on them. Get for example only elements, which are different from the current one.
114
+ *
115
+ * @param {djs.model.Base} element
116
+ *
117
+ * @return {Array<Object>} a list of menu entry items
118
+ */
119
+ ReplaceMenuProvider.prototype.getEntries = function(element) {
120
+
121
+ var rules = this._rules;
122
+
123
+ var entries,
124
+ definition = getDefinition(element);
125
+
126
+
127
+ if (!rules.allowed('shape.replace', { element: element })) {
128
+ return [];
129
+ }
130
+
131
+
132
+ if (isItemCapable(element)) {
133
+
134
+ if (isTask(element)) {
135
+
136
+ entries = filter(replaceOptions.TASK, function(entry) {
137
+
138
+ var target = entry.target;
139
+
140
+ if (canReplaceElementByTarget(element, target)) {
141
+
142
+ // ^ === XOR
143
+ // returns true if and only of EITHER the type OR the definition type is different
144
+ return isDifferentType(element, entry) ^ isDifferentDefinitionType(element, entry);
145
+ }
146
+ });
147
+
148
+ return this._createEntries(element, entries);
149
+ }
150
+
151
+ if (isPlanFragment(element)) {
152
+
153
+ if (!isCollapsed(element)) {
154
+
155
+ entries = filter(replaceOptions.PLAN_FRAGMENT_EXPANDED, function(entry) {
156
+
157
+ var target = entry.target;
158
+
159
+ if (canReplaceElementByTarget(element, target)) {
160
+
161
+ // returns true if the type or the definition type is different (or both)
162
+ return isDifferentType(element, entry) || isDifferentDefinitionType(element, entry);
163
+ }
164
+ });
165
+
166
+ return this._createEntries(element, entries);
167
+ }
168
+
169
+ if (isCollapsed(element)) {
170
+
171
+ entries = filter(replaceOptions.TASK, function(entry) {
172
+
173
+ var target = entry.target,
174
+ definitionType = target.definitionType;
175
+
176
+ if (!canReplaceElementByTarget(element, target)) {
177
+ return false;
178
+ }
179
+
180
+ if (definitionType === definition.$type && !target.isCollapsed) {
181
+ return true;
182
+ }
183
+
184
+ // ^ === XOR
185
+ // returns true if and only of EITHER the type OR the definition type is different
186
+ return isDifferentType(element, entry) ^ isDifferentDefinitionType(element, entry);
187
+
188
+ });
189
+
190
+ return this._createEntries(element, entries);
191
+
192
+ }
193
+
194
+ }
195
+
196
+ if (isEventListener(element)) {
197
+
198
+ entries = filter(replaceOptions.EVENT_LISTENER, function(entry) {
199
+ return isDifferentDefinitionType(element, entry);
200
+ });
201
+
202
+ return this._createEntries(element, entries);
203
+ }
204
+
205
+ }
206
+
207
+
208
+ if (isCriterion(element)) {
209
+
210
+ entries = filter(replaceOptions.CRITERION, function(entry) {
211
+ return isDifferentType(element, entry);
212
+ });
213
+
214
+ return this._createEntries(element, entries);
215
+ }
216
+
217
+ return [];
218
+
219
+ };
220
+
221
+
222
+ ReplaceMenuProvider.prototype.getHeaderEntries = function(element) {
223
+
224
+ var headerEntries = [];
225
+
226
+ if (isTask(element)) {
227
+ headerEntries = headerEntries.concat(this._getBlockingEntry(element));
228
+ }
229
+
230
+ if (isStage(element)) {
231
+ headerEntries = headerEntries.concat(this._getAutoCompleteEntry(element));
232
+ }
233
+
234
+ if (ensureSupportRules(element)) {
235
+ headerEntries = headerEntries.concat(this._getRuleEntries(element));
236
+ }
237
+
238
+ return headerEntries;
239
+
240
+ };
241
+
242
+ /**
243
+ * Creates an array of menu entry objects for a given element and filters the replaceOptions
244
+ * according to a filter function.
245
+ *
246
+ * @param {djs.model.Base} element
247
+ * @param {Object} replaceOptions
248
+ *
249
+ * @return {Array<Object>} a list of menu items
250
+ */
251
+ ReplaceMenuProvider.prototype._createEntries = function(element, replaceOptions) {
252
+ var menuEntries = [];
253
+
254
+ var self = this;
255
+
256
+ forEach(replaceOptions, function(definition) {
257
+ var entry = self._createMenuEntry(definition, element);
258
+
259
+ menuEntries.push(entry);
260
+ });
261
+
262
+ return menuEntries;
263
+ };
264
+
265
+
266
+ /**
267
+ * Creates and returns a single menu entry item.
268
+ *
269
+ * @param {Object} definition a single replace options definition object
270
+ * @param {djs.model.Base} element
271
+ * @param {Function} [action] an action callback function which gets called when
272
+ * the menu entry is being triggered.
273
+ *
274
+ * @return {Object} menu entry item
275
+ */
276
+ ReplaceMenuProvider.prototype._createMenuEntry = function(definition, element, action) {
277
+
278
+ var replaceElement = this._cmmnReplace.replaceElement;
279
+
280
+ var replaceAction = function() {
281
+ return replaceElement(element, definition.target);
282
+ };
283
+
284
+ action = action || replaceAction;
285
+
286
+ var menuEntry = {
287
+ label: definition.label,
288
+ className: definition.className,
289
+ id: definition.actionName,
290
+ action: action
291
+ };
292
+
293
+ return menuEntry;
294
+ };
295
+
296
+
297
+ ReplaceMenuProvider.prototype._getBlockingEntry = function(element) {
298
+
299
+ var self = this;
300
+
301
+ var definition = getDefinition(element);
302
+
303
+ function toggleBlockingEntry(event, entry) {
304
+ var blocking = !entry.active;
305
+ self._modeling.updateControls(element, { isBlocking: blocking });
306
+ }
307
+
308
+ var isBlocking = definition.isBlocking;
309
+ var entries = [
310
+ {
311
+ id: 'toggle-is-blocking',
312
+ className: 'cmmn-icon-blocking',
313
+ title: 'Blocking',
314
+ active: isBlocking,
315
+ action: toggleBlockingEntry
316
+ }
317
+ ];
318
+
319
+ return entries;
320
+ };
321
+
322
+
323
+ ReplaceMenuProvider.prototype._getAutoCompleteEntry = function(element) {
324
+
325
+ var self = this;
326
+
327
+ var definition = getDefinition(element);
328
+
329
+ function toggleAutoCompleteEntry(event, entry) {
330
+ var autoComplete = !entry.active;
331
+ self._modeling.updateControls(element, { autoComplete: autoComplete });
332
+ }
333
+
334
+ var isAutoComplete = definition.autoComplete;
335
+ var entries = [
336
+ {
337
+ id: 'toggle-auto-complete',
338
+ className: 'cmmn-icon-auto-complete-marker',
339
+ title: 'Auto Complete',
340
+ active: isAutoComplete,
341
+ action: toggleAutoCompleteEntry
342
+ }
343
+ ];
344
+
345
+ return entries;
346
+ };
347
+
348
+
349
+ ReplaceMenuProvider.prototype._getRuleEntries = function(element) {
350
+
351
+ var self = this;
352
+
353
+ function toggleControlEntry(control, type) {
354
+
355
+ return function(event, entry) {
356
+
357
+ var value = {};
358
+
359
+ if (entry.active) {
360
+ value[control] = undefined;
361
+ }
362
+ else {
363
+ value[control] = self._cmmnFactory.create(type);
364
+ }
365
+
366
+ self._modeling.updateControls(element, value);
367
+ };
368
+
369
+ }
370
+
371
+ var repeatable = isRepeatable(element),
372
+ required = isRequired(element),
373
+ manualActivation = isManualActivation(element);
374
+
375
+ var entries = [
376
+ {
377
+ id: 'toggle-required-rule',
378
+ className: 'cmmn-icon-required-marker',
379
+ title: 'Required Rule',
380
+ active: required,
381
+ action: toggleControlEntry('requiredRule', 'cmmn:RequiredRule')
382
+ }
383
+ ];
384
+
385
+ if (!isMilestone(element)) {
386
+
387
+ entries.push({
388
+ id: 'toggle-manual-activation-rule',
389
+ className: 'cmmn-icon-manual-activation-marker',
390
+ title: 'Manual Activation Rule',
391
+ active: manualActivation,
392
+ action: toggleControlEntry('manualActivationRule', 'cmmn:ManualActivationRule')
393
+ });
394
+
395
+ }
396
+
397
+ entries.push({
398
+ id: 'toggle-repetition-rule',
399
+ className: 'cmmn-icon-repetition-marker',
400
+ title: 'Repetition Rule',
401
+ active: repeatable,
402
+ action: toggleControlEntry('repetitionRule', 'cmmn:RepetitionRule')
403
+ });
404
+
405
+ return entries;
406
+ };
407
+
408
+ module.exports = ReplaceMenuProvider;
409
+
410
+
411
+ function ensureSupportRules(element) {
412
+
413
+ var definition = getDefinition(element);
414
+
415
+ return !isCasePlanModel(element) && isAny(definition, [
416
+ 'cmmn:Stage',
417
+ 'cmmn:Milestone',
418
+ 'cmmn:Task'
419
+ ]);
420
+ }
421
+
422
+ function isPlanFragment(element) {
423
+ return is(getDefinition(element), 'cmmn:PlanFragment');
424
+ }
425
+
426
+ function isStage(element) {
427
+ return is(getDefinition(element), 'cmmn:Stage');
428
+ }
429
+
430
+ function isEventListener(element) {
431
+ return is(getDefinition(element), 'cmmn:EventListener');
432
+ }
433
+
434
+ function isMilestone(element) {
435
+ return is(getDefinition(element), 'cmmn:Milestone');
436
+ }
437
+
438
+ function isTask(element) {
439
+ return is(getDefinition(element), 'cmmn:Task');
440
+ }
441
+
442
+ function isCriterion(element) {
443
+ return is(element, 'cmmn:Criterion');
444
+ }
445
+
446
+ function isPlanItem(element) {
447
+ return is(element, 'cmmn:PlanItem');
448
+ }
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ __init__: [ 'replaceMenuProvider' ],
3
+ replaceMenuProvider: [ 'type', require('./ReplaceMenuProvider') ]
4
+ };