camunda-bpmn-js 0.13.0-alpha.7 → 0.13.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/CHANGELOG.md +23 -1
- package/dist/assets/base-navigated-viewer.css +2 -0
- package/dist/assets/base-viewer.css +2 -0
- package/dist/assets/camunda-cloud-navigated-viewer.css +1 -0
- package/dist/assets/camunda-cloud-viewer.css +1 -0
- package/dist/assets/camunda-platform-navigated-viewer.css +1 -0
- package/dist/assets/camunda-platform-viewer.css +1 -0
- package/dist/base-modeler.development.js +32 -6
- package/dist/base-modeler.production.min.js +1 -1
- package/dist/base-navigated-viewer.development.js +22218 -0
- package/dist/base-navigated-viewer.production.min.js +2 -0
- package/dist/base-viewer.development.js +21227 -0
- package/dist/base-viewer.production.min.js +2 -0
- package/dist/camunda-cloud-modeler.development.js +1380 -456
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-navigated-viewer.development.js +23041 -0
- package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -0
- package/dist/camunda-cloud-viewer.development.js +22050 -0
- package/dist/camunda-cloud-viewer.production.min.js +2 -0
- package/dist/camunda-platform-modeler.development.js +1657 -1340
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/dist/camunda-platform-navigated-viewer.development.js +23413 -0
- package/dist/camunda-platform-navigated-viewer.production.min.js +2 -0
- package/dist/camunda-platform-viewer.development.js +22422 -0
- package/dist/camunda-platform-viewer.production.min.js +2 -0
- package/lib/base/NavigatedViewer.js +3 -0
- package/lib/base/Viewer.js +3 -0
- package/lib/camunda-cloud/Modeler.js +6 -7
- package/lib/camunda-cloud/NavigatedViewer.js +34 -0
- package/lib/camunda-cloud/Viewer.js +34 -0
- package/lib/camunda-cloud/util/commonModules.js +14 -0
- package/lib/camunda-platform/Modeler.js +5 -5
- package/lib/camunda-platform/NavigatedViewer.js +25 -0
- package/lib/camunda-platform/Viewer.js +24 -0
- package/lib/camunda-platform/util/commonModules.js +7 -0
- package/package.json +13 -7
- package/styles/base-navigated-viewer.css +2 -0
- package/styles/base-viewer.css +2 -0
- package/styles/camunda-cloud-navigated-viewer.css +1 -0
- package/styles/camunda-cloud-viewer.css +1 -0
- package/styles/camunda-platform-navigated-viewer.css +1 -0
- package/styles/camunda-platform-viewer.css +1 -0
- package/util/index.js +39 -0
- package/dist/assets/bpmn-font/bpmn-codes.css +0 -108
- package/dist/assets/bpmn-font/bpmn-embedded.css +0 -161
- package/dist/assets/bpmn-font/bpmn.css +0 -164
- package/dist/assets/bpmn-font/bpmn.eot +0 -0
- package/dist/assets/bpmn-font/bpmn.svg +0 -224
- package/dist/assets/bpmn-font/bpmn.ttf +0 -0
- package/dist/assets/bpmn-font/bpmn.woff +0 -0
- package/dist/assets/bpmn-font/bpmn.woff2 +0 -0
- package/dist/assets/bpmn-font/css/bpmn-codes.css +0 -108
- package/dist/assets/bpmn-font/css/bpmn-embedded.css +0 -161
- package/dist/assets/bpmn-font/css/bpmn.css +0 -164
- package/dist/assets/bpmn-font/font/bpmn.eot +0 -0
- package/dist/assets/bpmn-font/font/bpmn.svg +0 -224
- package/dist/assets/bpmn-font/font/bpmn.ttf +0 -0
- package/dist/assets/bpmn-font/font/bpmn.woff +0 -0
- package/dist/assets/bpmn-font/font/bpmn.woff2 +0 -0
- package/dist/assets/bpmn-js.css +0 -116
- package/dist/assets/diagram-js-minimap.css +0 -87
- package/dist/assets/diagram-js.css +0 -819
- package/dist/assets/element-templates.css +0 -75
- package/dist/assets/properties-panel.css +0 -902
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +0 -115
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +0 -76
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +0 -86
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +0 -138
- package/lib/camunda-cloud/features/modeling/behavior/RemoveAssignmentDefinitionBehavior.js +0 -51
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +0 -136
- package/lib/camunda-cloud/features/modeling/behavior/index.js +0 -24
- package/lib/camunda-cloud/features/modeling/index.js +0 -7
- package/lib/camunda-cloud/helper/CalledElementHelper.js +0 -72
- package/lib/camunda-cloud/helper/ElementHelper.js +0 -18
- package/lib/camunda-cloud/helper/FormsHelper.js +0 -84
- package/lib/camunda-cloud/helper/InputOutputHelper.js +0 -138
- package/lib/camunda-cloud/helper/Utils.js +0 -10
- package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +0 -41
- package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +0 -54
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +0 -96
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +0 -68
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +0 -44
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +0 -54
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +0 -71
- package/lib/camunda-platform/features/modeling/behavior/UserTaskGeneratedFormsBehavior.js +0 -116
- package/lib/camunda-platform/features/modeling/behavior/index.js +0 -26
- package/lib/camunda-platform/features/modeling/index.js +0 -7
- package/lib/camunda-platform/helper/InputOutputHelper.js +0 -29
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getBusinessObject,
|
|
3
|
-
is
|
|
4
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
5
|
-
|
|
6
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
7
|
-
|
|
8
|
-
import { without } from 'min-dash';
|
|
9
|
-
|
|
10
|
-
import { getExtensionElementsList } from '../../../../util/ExtensionElementsUtil';
|
|
11
|
-
|
|
12
|
-
const HIGH_PRIORITY = 5000;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Zeebe BPMN behavior ensuring that bpmn:BusinessRuleTask only has one of the following:
|
|
17
|
-
*
|
|
18
|
-
* (1) zeebe:CalledDecision
|
|
19
|
-
* (2) zeebe:TaskDefinition and zeebe:TaskHeaders
|
|
20
|
-
*/
|
|
21
|
-
export default class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
|
|
22
|
-
constructor(commandStack, eventBus) {
|
|
23
|
-
super(eventBus);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Remove zeebe:CalledDecision if zeebe:TaskDefinition is about to be added.
|
|
27
|
-
*/
|
|
28
|
-
this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY, function(context) {
|
|
29
|
-
const {
|
|
30
|
-
element,
|
|
31
|
-
moddleElement,
|
|
32
|
-
properties
|
|
33
|
-
} = context;
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
!is(element, 'bpmn:BusinessRuleTask')
|
|
37
|
-
|| !is(moddleElement, 'bpmn:ExtensionElements')
|
|
38
|
-
|| !properties.values
|
|
39
|
-
) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const calledDecision = getCalledDecision(element),
|
|
44
|
-
taskDefinition = getTaskDefinition(element);
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
calledDecision
|
|
48
|
-
&& !taskDefinition
|
|
49
|
-
&& properties.values.find(value => is(value, 'zeebe:CalledDecision'))
|
|
50
|
-
&& properties.values.find(value => is(value, 'zeebe:TaskDefinition'))
|
|
51
|
-
) {
|
|
52
|
-
properties.values = without(properties.values, calledDecision);
|
|
53
|
-
}
|
|
54
|
-
}, true);
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Remove zeebe:TaskDefinition and zeebe:TaskHeaders if zeebe:CalledDecision is about to be added.
|
|
58
|
-
*/
|
|
59
|
-
this.preExecute('element.updateModdleProperties', HIGH_PRIORITY, function(context) {
|
|
60
|
-
const {
|
|
61
|
-
element,
|
|
62
|
-
moddleElement,
|
|
63
|
-
properties
|
|
64
|
-
} = context;
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
!is(element, 'bpmn:BusinessRuleTask')
|
|
68
|
-
|| !is(moddleElement, 'bpmn:ExtensionElements')
|
|
69
|
-
|| !properties.values
|
|
70
|
-
) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const calledDecision = getCalledDecision(element),
|
|
75
|
-
taskDefinition = getTaskDefinition(element),
|
|
76
|
-
taskHeaders = getTaskHeaders(element);
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
!calledDecision
|
|
80
|
-
&& (taskDefinition || taskHeaders)
|
|
81
|
-
&& properties.values.find(value => is(value, 'zeebe:CalledDecision'))
|
|
82
|
-
&& properties.values.find(value => is(value, 'zeebe:TaskDefinition') || is(value, 'zeebe:TaskHeaders'))
|
|
83
|
-
) {
|
|
84
|
-
properties.values = without(properties.values, (value) => value === taskDefinition || value === taskHeaders);
|
|
85
|
-
}
|
|
86
|
-
}, true);
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
CleanUpBusinessRuleTaskBehavior.$inject = [
|
|
92
|
-
'commandStack',
|
|
93
|
-
'eventBus'
|
|
94
|
-
];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
// helpers //////////
|
|
98
|
-
|
|
99
|
-
function getCalledDecision(element) {
|
|
100
|
-
const businessObject = getBusinessObject(element);
|
|
101
|
-
|
|
102
|
-
return getExtensionElementsList(businessObject, 'zeebe:CalledDecision')[ 0 ];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function getTaskDefinition(element) {
|
|
106
|
-
const businessObject = getBusinessObject(element);
|
|
107
|
-
|
|
108
|
-
return getExtensionElementsList(businessObject, 'zeebe:TaskDefinition')[ 0 ];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function getTaskHeaders(element) {
|
|
112
|
-
const businessObject = getBusinessObject(element);
|
|
113
|
-
|
|
114
|
-
return getExtensionElementsList(businessObject, 'zeebe:TaskHeaders')[ 0 ];
|
|
115
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getBusinessObject,
|
|
5
|
-
is
|
|
6
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
7
|
-
|
|
8
|
-
const HIGH_PRIORITY = 5000;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Zeebe BPMN specific behavior for creating boundary events.
|
|
13
|
-
*/
|
|
14
|
-
export default class CreateZeebeBoundaryEventBehavior extends CommandInterceptor {
|
|
15
|
-
constructor(bpmnFactory, elementFactory, eventBus) {
|
|
16
|
-
super(eventBus);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Replace intermediate catch event with boundary event when attaching it to a shape.
|
|
20
|
-
*/
|
|
21
|
-
this.preExecute('shape.create', HIGH_PRIORITY, function(context) {
|
|
22
|
-
const {
|
|
23
|
-
shape,
|
|
24
|
-
host
|
|
25
|
-
} = context;
|
|
26
|
-
|
|
27
|
-
const businessObject = getBusinessObject(shape);
|
|
28
|
-
|
|
29
|
-
let attrs = {
|
|
30
|
-
cancelActivity: true
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
let newBusinessObject,
|
|
34
|
-
hostBusinessObject,
|
|
35
|
-
boundaryEvent,
|
|
36
|
-
eventDefinitions;
|
|
37
|
-
|
|
38
|
-
if (!host || !is(shape, 'bpmn:IntermediateCatchEvent')) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
hostBusinessObject = getBusinessObject(host);
|
|
43
|
-
|
|
44
|
-
attrs = {
|
|
45
|
-
...attrs,
|
|
46
|
-
attachedToRef: hostBusinessObject
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
eventDefinitions = businessObject.eventDefinitions;
|
|
50
|
-
|
|
51
|
-
newBusinessObject = bpmnFactory.create('bpmn:BoundaryEvent', attrs);
|
|
52
|
-
|
|
53
|
-
boundaryEvent = {
|
|
54
|
-
type: 'bpmn:BoundaryEvent',
|
|
55
|
-
businessObject: newBusinessObject,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
if (eventDefinitions && eventDefinitions[0]) {
|
|
59
|
-
boundaryEvent = {
|
|
60
|
-
...boundaryEvent,
|
|
61
|
-
eventDefinitionType: eventDefinitions[0].$type
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
context.shape = elementFactory.createShape(boundaryEvent);
|
|
66
|
-
|
|
67
|
-
}, true);
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
CreateZeebeBoundaryEventBehavior.$inject = [
|
|
73
|
-
'bpmnFactory',
|
|
74
|
-
'elementFactory',
|
|
75
|
-
'eventBus'
|
|
76
|
-
];
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { has } from 'min-dash';
|
|
2
|
-
|
|
3
|
-
import { createElement } from '../../../helper/ElementHelper';
|
|
4
|
-
|
|
5
|
-
import { getCalledElement } from '../../../helper/CalledElementHelper';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
getBusinessObject,
|
|
9
|
-
is
|
|
10
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
11
|
-
|
|
12
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
13
|
-
|
|
14
|
-
const HIGH_PRIORITY = 5000;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Zeebe BPMN specific behavior for creating call activities.
|
|
19
|
-
*/
|
|
20
|
-
export default class CreateZeebeCallActivityBehavior extends CommandInterceptor {
|
|
21
|
-
constructor(bpmnFactory, eventBus, modeling) {
|
|
22
|
-
super(eventBus);
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Add zeebe:CalledElement extension element with zeebe:propagateAllChildVariables attribute = false
|
|
26
|
-
* when creating bpmn:CallActivity.
|
|
27
|
-
*/
|
|
28
|
-
this.postExecuted('shape.create', HIGH_PRIORITY, function(context) {
|
|
29
|
-
const { shape } = context;
|
|
30
|
-
|
|
31
|
-
if (!is(shape, 'bpmn:CallActivity')) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const businessObject = getBusinessObject(shape);
|
|
36
|
-
|
|
37
|
-
let calledElement = getCalledElement(businessObject);
|
|
38
|
-
|
|
39
|
-
if (!calledElement) {
|
|
40
|
-
let extensionElements = businessObject.get('extensionElements');
|
|
41
|
-
|
|
42
|
-
if (!extensionElements) {
|
|
43
|
-
extensionElements = createElement(
|
|
44
|
-
'bpmn:ExtensionElements',
|
|
45
|
-
{
|
|
46
|
-
values: []
|
|
47
|
-
},
|
|
48
|
-
businessObject,
|
|
49
|
-
bpmnFactory
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
modeling.updateProperties(shape, { extensionElements });
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
calledElement = createElement(
|
|
56
|
-
'zeebe:CalledElement',
|
|
57
|
-
{
|
|
58
|
-
propagateAllChildVariables: false
|
|
59
|
-
},
|
|
60
|
-
extensionElements,
|
|
61
|
-
bpmnFactory
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
modeling.updateModdleProperties(shape, extensionElements, {
|
|
65
|
-
values: [
|
|
66
|
-
...(extensionElements.values || []),
|
|
67
|
-
calledElement
|
|
68
|
-
]
|
|
69
|
-
});
|
|
70
|
-
} else if (!has(calledElement, 'propagateAllChildVariables')) {
|
|
71
|
-
|
|
72
|
-
// set zeebe:propagateAllChildVariables to false if zeebe:CalledElement exists
|
|
73
|
-
modeling.updateModdleProperties(shape, calledElement, {
|
|
74
|
-
propagateAllChildVariables: false
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}, true);
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
CreateZeebeCallActivityBehavior.$inject = [
|
|
83
|
-
'bpmnFactory',
|
|
84
|
-
'eventBus',
|
|
85
|
-
'modeling'
|
|
86
|
-
];
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
3
|
-
|
|
4
|
-
import { createElement } from '../../../helper/ElementHelper';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
getBusinessObject,
|
|
8
|
-
is
|
|
9
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
createFormDefinition,
|
|
13
|
-
createFormId,
|
|
14
|
-
createFormKey,
|
|
15
|
-
createUserTaskForm,
|
|
16
|
-
getFormDefinition,
|
|
17
|
-
getUserTaskForm
|
|
18
|
-
} from '../../../helper/FormsHelper';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Zeebe BPMN specific form definition behavior.
|
|
23
|
-
*/
|
|
24
|
-
export default class FormDefinitionBehavior extends CommandInterceptor {
|
|
25
|
-
constructor(bpmnFactory, eventBus, modeling) {
|
|
26
|
-
super(eventBus);
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Remove zeebe:UserTaskForm on user task removed.
|
|
30
|
-
*/
|
|
31
|
-
this.postExecute('shape.delete', function(context) {
|
|
32
|
-
const {
|
|
33
|
-
oldParent,
|
|
34
|
-
shape
|
|
35
|
-
} = context;
|
|
36
|
-
|
|
37
|
-
const rootElement = getRootElement(oldParent);
|
|
38
|
-
|
|
39
|
-
const userTaskForm = getUserTaskForm(shape, rootElement);
|
|
40
|
-
|
|
41
|
-
if (!is(shape, 'bpmn:UserTask') || !userTaskForm) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const rootExtensionElements = rootElement.get('extensionElements');
|
|
46
|
-
|
|
47
|
-
const values = rootExtensionElements.get('values').filter((element) => {
|
|
48
|
-
return element !== userTaskForm;
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
modeling.updateModdleProperties(shape, rootExtensionElements, { values });
|
|
52
|
-
}, true);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Create new zeebe:FormDefinition and zeebe:UserTaskForm on user task created.
|
|
57
|
-
*/
|
|
58
|
-
this.postExecute('shape.create', function(context) {
|
|
59
|
-
const { shape } = context;
|
|
60
|
-
|
|
61
|
-
const oldFormDefinition = getFormDefinition(shape);
|
|
62
|
-
|
|
63
|
-
if (!is(shape, 'bpmn:UserTask') || !oldFormDefinition) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const oldUserTaskForm = getUserTaskForm(shape);
|
|
68
|
-
|
|
69
|
-
const rootElement = getRootElement(shape);
|
|
70
|
-
|
|
71
|
-
const businessObject = getBusinessObject(shape);
|
|
72
|
-
|
|
73
|
-
const extensionElements = businessObject.get('extensionElements');
|
|
74
|
-
|
|
75
|
-
let rootExtensionElements = rootElement.get('extensionElements');
|
|
76
|
-
|
|
77
|
-
// (1) ensure extension elements exists
|
|
78
|
-
if (!rootExtensionElements) {
|
|
79
|
-
rootExtensionElements = createElement('bpmn:ExtensionElements', { values: [] }, rootElement, bpmnFactory);
|
|
80
|
-
|
|
81
|
-
modeling.updateModdleProperties(shape, rootElement, { extensionElements: rootExtensionElements });
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// (2) remove existing form definition
|
|
85
|
-
let values = extensionElements.get('values').filter((element) => {
|
|
86
|
-
return element !== oldFormDefinition;
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// (3) create new form definition
|
|
90
|
-
const formId = createFormId();
|
|
91
|
-
|
|
92
|
-
const newFormDefinition = createFormDefinition({ formKey: createFormKey(formId) }, extensionElements, bpmnFactory);
|
|
93
|
-
|
|
94
|
-
values = [
|
|
95
|
-
...values,
|
|
96
|
-
newFormDefinition
|
|
97
|
-
];
|
|
98
|
-
|
|
99
|
-
modeling.updateModdleProperties(shape, extensionElements, {
|
|
100
|
-
values
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// (4) create new user task form
|
|
104
|
-
const userTaskForm = createUserTaskForm({
|
|
105
|
-
id: formId,
|
|
106
|
-
body: oldUserTaskForm ? oldUserTaskForm.get('body') : ''
|
|
107
|
-
}, rootExtensionElements, bpmnFactory);
|
|
108
|
-
|
|
109
|
-
modeling.updateModdleProperties(shape, rootExtensionElements, {
|
|
110
|
-
values: [
|
|
111
|
-
...(rootExtensionElements.get('values') || []),
|
|
112
|
-
userTaskForm
|
|
113
|
-
]
|
|
114
|
-
});
|
|
115
|
-
}, true);
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
FormDefinitionBehavior.$inject = [
|
|
121
|
-
'bpmnFactory',
|
|
122
|
-
'eventBus',
|
|
123
|
-
'modeling'
|
|
124
|
-
];
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// helpers //////////////
|
|
128
|
-
|
|
129
|
-
function getRootElement(element) {
|
|
130
|
-
var businessObject = getBusinessObject(element),
|
|
131
|
-
parent = businessObject;
|
|
132
|
-
|
|
133
|
-
while (parent.$parent && !is(parent, 'bpmn:Process')) {
|
|
134
|
-
parent = parent.$parent;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return parent;
|
|
138
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { is } from 'bpmn-js/lib/util/ModelUtil';
|
|
2
|
-
|
|
3
|
-
import { getBusinessObject } from 'bpmn-js/lib/util/ModelUtil';
|
|
4
|
-
|
|
5
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
6
|
-
|
|
7
|
-
import { isUndefined } from 'min-dash';
|
|
8
|
-
|
|
9
|
-
import { removeExtensionElements } from '../../../../util/ExtensionElementsUtil';
|
|
10
|
-
|
|
11
|
-
const HIGH_PRIORITY = 5000;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Zeebe BPMN behavior removing zeebe:AssignmentDefinition elements without
|
|
16
|
-
* zeebe:assignee and zeebe:candidateGroups.
|
|
17
|
-
*/
|
|
18
|
-
export default class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
|
|
19
|
-
constructor(commandStack, eventBus) {
|
|
20
|
-
super(eventBus);
|
|
21
|
-
|
|
22
|
-
this.postExecuted('element.updateModdleProperties' , HIGH_PRIORITY, function(context) {
|
|
23
|
-
const {
|
|
24
|
-
element,
|
|
25
|
-
moddleElement
|
|
26
|
-
} = context;
|
|
27
|
-
|
|
28
|
-
if (!is(moddleElement, 'zeebe:AssignmentDefinition')) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const assignmentDefinition = moddleElement;
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
is(element, 'bpmn:UserTask')
|
|
36
|
-
&& isUndefined(assignmentDefinition.get('zeebe:assignee'))
|
|
37
|
-
&& isUndefined(assignmentDefinition.get('zeebe:candidateGroups'))
|
|
38
|
-
) {
|
|
39
|
-
const businessObject = getBusinessObject(element);
|
|
40
|
-
|
|
41
|
-
removeExtensionElements(element, businessObject, assignmentDefinition, commandStack);
|
|
42
|
-
}
|
|
43
|
-
}, true);
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
CleanUpBusinessRuleTaskBehavior.$inject = [
|
|
49
|
-
'commandStack',
|
|
50
|
-
'eventBus'
|
|
51
|
-
];
|
package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getBusinessObject,
|
|
5
|
-
is
|
|
6
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
getCalledElement,
|
|
10
|
-
isPropagateAllChildVariables
|
|
11
|
-
} from '../../../helper/CalledElementHelper';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
getInputParameters,
|
|
15
|
-
getOutputParameters,
|
|
16
|
-
getIoMapping
|
|
17
|
-
} from '../../../helper/InputOutputHelper';
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
removeExtensionElements
|
|
21
|
-
} from '../../../../util/ExtensionElementsUtil';
|
|
22
|
-
|
|
23
|
-
const HIGH_PRIORITY = 5000;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Zeebe BPMN behavior for updating bpmn:CallActivity elements
|
|
28
|
-
* ensuring that only one of the following is true:
|
|
29
|
-
*
|
|
30
|
-
* (1) zeebe:propagateAllChildVariables of zeebe:CalledElement is set to true
|
|
31
|
-
* (2) zeebe:IoMapping extension element has zeebe:Output elements
|
|
32
|
-
*/
|
|
33
|
-
export default class UpdatePropagateAllChildVariablesBehavior extends CommandInterceptor {
|
|
34
|
-
constructor(commandStack, eventBus, modeling) {
|
|
35
|
-
super(eventBus);
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Remove zeebe:Output elements if zeebe:propagateAllChildVariables is set to true.
|
|
39
|
-
* Remove zeebe:IoMapping extension element if empty.
|
|
40
|
-
*/
|
|
41
|
-
this.postExecute('element.updateModdleProperties' , HIGH_PRIORITY, function(context) {
|
|
42
|
-
const {
|
|
43
|
-
element,
|
|
44
|
-
moddleElement,
|
|
45
|
-
properties = {}
|
|
46
|
-
} = context;
|
|
47
|
-
|
|
48
|
-
const propagateAllChildVariables = properties.propagateAllChildVariables || properties[ 'zeebe:propagateAllChildVariables' ];
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
!is(element, 'bpmn:CallActivity')
|
|
52
|
-
|| !is(moddleElement, 'zeebe:CalledElement')
|
|
53
|
-
|| !propagateAllChildVariables
|
|
54
|
-
) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const inputParameters = getInputParameters(element),
|
|
59
|
-
outputParameters = getOutputParameters(element);
|
|
60
|
-
|
|
61
|
-
if (!outputParameters || !outputParameters.length) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const ioMapping = getIoMapping(element);
|
|
66
|
-
|
|
67
|
-
modeling.updateModdleProperties(element, ioMapping, {
|
|
68
|
-
'zeebe:outputParameters': []
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
if (!inputParameters || !inputParameters.length) {
|
|
72
|
-
removeExtensionElements(element, getBusinessObject(element), ioMapping, commandStack);
|
|
73
|
-
}
|
|
74
|
-
}, true);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Set zeebe:propagateAllChildVariables of zeebe:CalledElement to false if
|
|
79
|
-
* zeebe:Output or zeebe:IoMapping with zeebe:Output is added.
|
|
80
|
-
*/
|
|
81
|
-
this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY, function(context) {
|
|
82
|
-
const {
|
|
83
|
-
element,
|
|
84
|
-
moddleElement,
|
|
85
|
-
properties
|
|
86
|
-
} = context;
|
|
87
|
-
|
|
88
|
-
if (
|
|
89
|
-
!is(element, 'bpmn:CallActivity')
|
|
90
|
-
|| !isPropagateAllChildVariables(element)
|
|
91
|
-
) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const businessObject = getBusinessObject(element),
|
|
96
|
-
calledElement = getCalledElement(businessObject);
|
|
97
|
-
|
|
98
|
-
// (1) zeebe:IoMapping extension element with zeebe:Output added
|
|
99
|
-
if (
|
|
100
|
-
is(moddleElement, 'bpmn:ExtensionElements')
|
|
101
|
-
&& properties.values
|
|
102
|
-
) {
|
|
103
|
-
const ioMapping = properties.values.find((value) => is(value, 'zeebe:IoMapping'));
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
ioMapping
|
|
107
|
-
&& ioMapping.get('outputParameters').length
|
|
108
|
-
&& !getIoMapping(element)
|
|
109
|
-
) {
|
|
110
|
-
modeling.updateModdleProperties(element, calledElement, {
|
|
111
|
-
'zeebe:propagateAllChildVariables': false
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// (2) zeebe:Output added
|
|
117
|
-
if (is(moddleElement, 'zeebe:IoMapping')) {
|
|
118
|
-
const outputParameters = properties.outputParameters || properties[ 'zeebe:outputParameters' ];
|
|
119
|
-
|
|
120
|
-
if (outputParameters && outputParameters.length) {
|
|
121
|
-
modeling.updateModdleProperties(element, calledElement, {
|
|
122
|
-
'zeebe:propagateAllChildVariables': false
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
}, true);
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
UpdatePropagateAllChildVariablesBehavior.$inject = [
|
|
133
|
-
'commandStack',
|
|
134
|
-
'eventBus',
|
|
135
|
-
'modeling'
|
|
136
|
-
];
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import CleanUpBusinessRuleTaskBehavior from './CleanUpBusinessRuleTaskBehavior';
|
|
2
|
-
import CreateZeebeBoundaryEventBehavior from './CreateZeebeBoundaryEventBehavior';
|
|
3
|
-
import CreateZeebeCallActivityBehavior from './CreateZeebeCallActivityBehavior';
|
|
4
|
-
import FormDefinitionBehavior from './FormDefinitionBehavior';
|
|
5
|
-
import RemoveAssignmentDefinitionBehavior from './RemoveAssignmentDefinitionBehavior';
|
|
6
|
-
import UpdatePropagateAllChildVariablesBehavior from './UpdatePropagateAllChildVariablesBehavior';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
__init__: [
|
|
11
|
-
'cleanUpBusinessRuleTaskBehavior',
|
|
12
|
-
'createZeebeBoundaryEventBehavior',
|
|
13
|
-
'createZeebeCallActivityBehavior',
|
|
14
|
-
'formDefinitionBehavior',
|
|
15
|
-
'removeAssignmentDefinitionBehavior',
|
|
16
|
-
'updatePropagateAllChildVariablesBehavior'
|
|
17
|
-
],
|
|
18
|
-
cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
|
|
19
|
-
createZeebeBoundaryEventBehavior: [ 'type', CreateZeebeBoundaryEventBehavior ],
|
|
20
|
-
createZeebeCallActivityBehavior: [ 'type', CreateZeebeCallActivityBehavior ],
|
|
21
|
-
formDefinitionBehavior: [ 'type', FormDefinitionBehavior ],
|
|
22
|
-
removeAssignmentDefinitionBehavior: [ 'type', RemoveAssignmentDefinitionBehavior ],
|
|
23
|
-
updatePropagateAllChildVariablesBehavior: [ 'type', UpdatePropagateAllChildVariablesBehavior ]
|
|
24
|
-
};
|