camunda-bpmn-js 0.12.2 → 0.13.0-alpha.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 +11 -0
- package/dist/assets/base-modeler.css +1 -1
- package/dist/assets/camunda-platform-modeler.css +2 -1
- package/dist/assets/diagram-js.css +2 -0
- package/dist/assets/element-templates.css +75 -0
- package/dist/assets/properties-panel.css +889 -0
- package/dist/base-modeler.development.js +8542 -12092
- package/dist/base-modeler.production.min.js +8 -3
- package/dist/camunda-cloud-modeler.development.js +11998 -14456
- package/dist/camunda-cloud-modeler.production.min.js +8 -3
- package/dist/camunda-platform-modeler.development.js +22052 -25378
- package/dist/camunda-platform-modeler.production.min.js +8 -3
- package/lib/base/Modeler.js +5 -3
- package/lib/camunda-cloud/Modeler.js +5 -3
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +2 -2
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +2 -2
- package/lib/camunda-cloud/helper/CalledElementHelper.js +1 -1
- package/lib/camunda-cloud/helper/ElementHelper.js +18 -0
- package/lib/camunda-cloud/helper/ExtensionElementsHelper.js +17 -0
- package/lib/camunda-cloud/helper/FormsHelper.js +5 -5
- package/lib/camunda-cloud/helper/InputOutputHelper.js +2 -6
- package/lib/camunda-cloud/helper/Utils.js +10 -0
- package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +22 -5
- package/lib/camunda-platform/Modeler.js +7 -3
- package/package.json +4 -3
- package/styles/base-modeler.css +1 -1
- package/styles/camunda-platform-modeler.css +2 -1
- package/dist/assets/bpmn-js-properties-panel.css +0 -778
- package/lib/camunda-cloud/features/properties-provider/ZeebePropertiesProvider.js +0 -201
- package/lib/camunda-cloud/features/properties-provider/index.js +0 -11
- package/lib/camunda-cloud/features/properties-provider/parts/CallActivityProps.js +0 -90
- package/lib/camunda-cloud/features/properties-provider/parts/ErrorProps.js +0 -13
- package/lib/camunda-cloud/features/properties-provider/parts/FormProps.js +0 -14
- package/lib/camunda-cloud/features/properties-provider/parts/HeadersProps.js +0 -52
- package/lib/camunda-cloud/features/properties-provider/parts/InputOutputProps.js +0 -8
- package/lib/camunda-cloud/features/properties-provider/parts/MessageProps.js +0 -51
- package/lib/camunda-cloud/features/properties-provider/parts/MultiInstanceProps.js +0 -25
- package/lib/camunda-cloud/features/properties-provider/parts/SequenceFlowProps.js +0 -149
- package/lib/camunda-cloud/features/properties-provider/parts/TaskDefinitionProps.js +0 -135
- package/lib/camunda-cloud/features/properties-provider/parts/TimerEventProps.js +0 -77
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/ElementReferenceExtensionElementProperty.js +0 -110
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/FormDefinition.js +0 -207
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/Headers.js +0 -208
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +0 -274
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutputParameter.js +0 -147
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/MultiInstanceLoopCharacteristics.js +0 -176
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/OutputParameterToggle.js +0 -97
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerDurationDefinition.js +0 -69
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerEventDefinition.js +0 -132
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import PropertiesActivator from 'bpmn-js-properties-panel/lib/PropertiesActivator';
|
|
2
|
-
|
|
3
|
-
import idProps from 'bpmn-js-properties-panel/lib/provider/bpmn/parts/IdProps';
|
|
4
|
-
|
|
5
|
-
import nameProps from 'bpmn-js-properties-panel/lib/provider/bpmn/parts/NameProps';
|
|
6
|
-
|
|
7
|
-
import processProps from 'bpmn-js-properties-panel/lib/provider/bpmn/parts/ProcessProps';
|
|
8
|
-
|
|
9
|
-
import executableProps from 'bpmn-js-properties-panel/lib/provider/bpmn/parts/ExecutableProps';
|
|
10
|
-
|
|
11
|
-
import inputOutput from './parts/InputOutputProps';
|
|
12
|
-
|
|
13
|
-
import headers from './parts/HeadersProps';
|
|
14
|
-
|
|
15
|
-
import taskDefinition from './parts/TaskDefinitionProps';
|
|
16
|
-
|
|
17
|
-
import sequenceFlowProps from './parts/SequenceFlowProps';
|
|
18
|
-
|
|
19
|
-
import messageProps from './parts/MessageProps';
|
|
20
|
-
|
|
21
|
-
import timerProps from './parts/TimerEventProps';
|
|
22
|
-
|
|
23
|
-
import multiInstanceProps from './parts/MultiInstanceProps';
|
|
24
|
-
|
|
25
|
-
import errorProps from './parts/ErrorProps';
|
|
26
|
-
|
|
27
|
-
import callActivityProps from './parts/CallActivityProps';
|
|
28
|
-
|
|
29
|
-
import formProps from './parts/FormProps';
|
|
30
|
-
|
|
31
|
-
import { is } from 'bpmn-js/lib/util/ModelUtil';
|
|
32
|
-
|
|
33
|
-
function getIdOptions(element) {
|
|
34
|
-
if (is(element, 'bpmn:Participant')) {
|
|
35
|
-
return { id: 'participant-id', label: 'Participant Id' };
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function getNameOptions(element) {
|
|
40
|
-
if (is(element, 'bpmn:Participant')) {
|
|
41
|
-
return { id: 'participant-name', label: 'Participant Name' };
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function createGeneralTabGroups(element, bpmnFactory, canvas, translate) {
|
|
46
|
-
const generalGroup = {
|
|
47
|
-
id: 'general',
|
|
48
|
-
label: translate('General'),
|
|
49
|
-
entries: []
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
idProps(generalGroup, element, translate, getIdOptions(element));
|
|
53
|
-
nameProps(generalGroup, element, bpmnFactory, canvas, translate, getNameOptions(element));
|
|
54
|
-
processProps(generalGroup, element, translate);
|
|
55
|
-
executableProps(generalGroup, element, translate);
|
|
56
|
-
|
|
57
|
-
const detailsGroup = {
|
|
58
|
-
id: 'details',
|
|
59
|
-
label: translate('Details'),
|
|
60
|
-
entries: []
|
|
61
|
-
};
|
|
62
|
-
taskDefinition(detailsGroup, element, bpmnFactory, translate);
|
|
63
|
-
sequenceFlowProps(detailsGroup, element, bpmnFactory, translate);
|
|
64
|
-
messageProps(detailsGroup, element, bpmnFactory, translate);
|
|
65
|
-
timerProps(detailsGroup, element, bpmnFactory, translate);
|
|
66
|
-
errorProps(detailsGroup, element, bpmnFactory, translate);
|
|
67
|
-
callActivityProps(detailsGroup, element, bpmnFactory, translate);
|
|
68
|
-
|
|
69
|
-
const multiInstanceGroup = {
|
|
70
|
-
id: 'multiInstance',
|
|
71
|
-
label: translate('Multi Instance'),
|
|
72
|
-
entries: []
|
|
73
|
-
};
|
|
74
|
-
multiInstanceProps(multiInstanceGroup, element, bpmnFactory, translate);
|
|
75
|
-
|
|
76
|
-
return [
|
|
77
|
-
generalGroup,
|
|
78
|
-
detailsGroup,
|
|
79
|
-
multiInstanceGroup
|
|
80
|
-
];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function createFormsGroups(element, bpmnFactory, translate) {
|
|
84
|
-
|
|
85
|
-
const formsGroups = {
|
|
86
|
-
id: 'forms-properties',
|
|
87
|
-
label: translate('Forms'),
|
|
88
|
-
entries: []
|
|
89
|
-
};
|
|
90
|
-
formProps(formsGroups, element, bpmnFactory, translate);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return [
|
|
94
|
-
formsGroups
|
|
95
|
-
];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function createHeadersGroups(element, bpmnFactory, translate) {
|
|
99
|
-
|
|
100
|
-
const headersGroup = {
|
|
101
|
-
id: 'headers-properties',
|
|
102
|
-
label: translate('Headers'),
|
|
103
|
-
entries: []
|
|
104
|
-
};
|
|
105
|
-
headers(headersGroup, element, bpmnFactory, translate);
|
|
106
|
-
|
|
107
|
-
return [
|
|
108
|
-
headersGroup
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
function createInputOutputTabGroups(element, bpmnFactory, translate) {
|
|
114
|
-
|
|
115
|
-
const inputGroup = {
|
|
116
|
-
id: 'input',
|
|
117
|
-
label: translate('Input Parameters'),
|
|
118
|
-
entries: []
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
inputOutput(inputGroup, element, bpmnFactory, translate, {
|
|
122
|
-
type: 'zeebe:Input',
|
|
123
|
-
prop: 'inputParameters',
|
|
124
|
-
prefix: 'input'
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const outputGroup = {
|
|
128
|
-
id: 'output',
|
|
129
|
-
label: translate('Output Parameters'),
|
|
130
|
-
entries: []
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
inputOutput(outputGroup, element, bpmnFactory, translate, {
|
|
134
|
-
type: 'zeebe:Output',
|
|
135
|
-
prop: 'outputParameters',
|
|
136
|
-
prefix: 'output'
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
return [
|
|
140
|
-
inputGroup,
|
|
141
|
-
outputGroup
|
|
142
|
-
];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export default class ZeebePropertiesProvider extends PropertiesActivator {
|
|
146
|
-
constructor(eventBus, bpmnFactory, canvas, translate) {
|
|
147
|
-
|
|
148
|
-
super(eventBus);
|
|
149
|
-
|
|
150
|
-
this._bpmnFactory = bpmnFactory;
|
|
151
|
-
this._canvas = canvas;
|
|
152
|
-
this._translate = translate;
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
getTabs(element) {
|
|
157
|
-
const generalTab = {
|
|
158
|
-
id: 'general',
|
|
159
|
-
label: this._translate('General'),
|
|
160
|
-
groups: createGeneralTabGroups(
|
|
161
|
-
element, this._bpmnFactory, this._canvas, this._translate)
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const formsTab = {
|
|
165
|
-
id: 'forms',
|
|
166
|
-
label: this._translate('Forms'),
|
|
167
|
-
groups: createFormsGroups(
|
|
168
|
-
element, this._bpmnFactory, this._translate
|
|
169
|
-
)
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const inputOutputTab = {
|
|
173
|
-
id: 'input-output',
|
|
174
|
-
label: this._translate('Input/Output'),
|
|
175
|
-
groups: createInputOutputTabGroups(
|
|
176
|
-
element, this._bpmnFactory, this._translate)
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
const headersTab = {
|
|
180
|
-
id: 'headers',
|
|
181
|
-
label: this._translate('Headers'),
|
|
182
|
-
groups: createHeadersGroups(
|
|
183
|
-
element, this._bpmnFactory, this._translate)
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
return [
|
|
187
|
-
generalTab,
|
|
188
|
-
formsTab,
|
|
189
|
-
inputOutputTab,
|
|
190
|
-
headersTab
|
|
191
|
-
];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
ZeebePropertiesProvider.$inject = [
|
|
197
|
-
'eventBus',
|
|
198
|
-
'bpmnFactory',
|
|
199
|
-
'canvas',
|
|
200
|
-
'translate'
|
|
201
|
-
];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import translate from 'diagram-js/lib/i18n/translate';
|
|
2
|
-
|
|
3
|
-
import ZeebePropertiesProvider from './ZeebePropertiesProvider';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
__depends__: [
|
|
7
|
-
translate
|
|
8
|
-
],
|
|
9
|
-
__init__: [ 'propertiesProvider' ],
|
|
10
|
-
propertiesProvider: [ 'type', ZeebePropertiesProvider ]
|
|
11
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import elementHelper from 'bpmn-js-properties-panel/lib/helper/ElementHelper';
|
|
2
|
-
|
|
3
|
-
import cmdHelper from 'bpmn-js-properties-panel/lib/helper/CmdHelper';
|
|
4
|
-
|
|
5
|
-
import { isIdValid } from 'bpmn-js-properties-panel/lib/Utils';
|
|
6
|
-
|
|
7
|
-
import { getCalledElement } from '../../../helper/CalledElementHelper';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
is,
|
|
11
|
-
getBusinessObject
|
|
12
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
13
|
-
|
|
14
|
-
import entryFactory from 'bpmn-js-properties-panel/lib/factory/EntryFactory';
|
|
15
|
-
|
|
16
|
-
export default function(group, element, bpmnFactory, translate) {
|
|
17
|
-
|
|
18
|
-
if (!is(element, 'bpmn:CallActivity')) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function getProperty(element, propertyName) {
|
|
23
|
-
const businessObject = getBusinessObject(element),
|
|
24
|
-
calledElement = getCalledElement(businessObject);
|
|
25
|
-
|
|
26
|
-
return calledElement ? calledElement.get(propertyName) : '';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function setProperties(element, values) {
|
|
30
|
-
|
|
31
|
-
const businessObject = getBusinessObject(element),
|
|
32
|
-
commands = [];
|
|
33
|
-
|
|
34
|
-
// ensure extensionElements
|
|
35
|
-
let extensionElements = businessObject.get('extensionElements');
|
|
36
|
-
if (!extensionElements) {
|
|
37
|
-
extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, businessObject, bpmnFactory);
|
|
38
|
-
commands.push(cmdHelper.updateBusinessObject(element, businessObject, { extensionElements: extensionElements }));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// ensure zeebe:calledElement
|
|
42
|
-
let calledElement = getCalledElement(businessObject);
|
|
43
|
-
if (!calledElement) {
|
|
44
|
-
calledElement = elementHelper.createElement('zeebe:CalledElement', { }, extensionElements, bpmnFactory);
|
|
45
|
-
commands.push(cmdHelper.addAndRemoveElementsFromList(
|
|
46
|
-
element,
|
|
47
|
-
extensionElements,
|
|
48
|
-
'values',
|
|
49
|
-
'extensionElements',
|
|
50
|
-
[ calledElement ],
|
|
51
|
-
[]
|
|
52
|
-
));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// update properties
|
|
56
|
-
commands.push(cmdHelper.updateBusinessObject(element, calledElement, values));
|
|
57
|
-
return commands;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// properties /////////////////////////////////////////////////////////////////
|
|
61
|
-
|
|
62
|
-
group.entries.push(entryFactory.validationAwareTextField(translate, {
|
|
63
|
-
id: 'process-id',
|
|
64
|
-
label: translate('Process Id'),
|
|
65
|
-
modelProperty: 'processId',
|
|
66
|
-
|
|
67
|
-
getProperty: function(element) {
|
|
68
|
-
return getProperty(element, 'processId');
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
setProperty: function(element, values) {
|
|
72
|
-
return setProperties(element, {
|
|
73
|
-
processId: values.processId || undefined
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
validate: function(element, values) {
|
|
77
|
-
var idValue = values.processId;
|
|
78
|
-
var bo = getBusinessObject(element);
|
|
79
|
-
|
|
80
|
-
// pass on expression statements
|
|
81
|
-
if (/^=/.test(idValue || '')) {
|
|
82
|
-
return {};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
var idError = isIdValid(bo, idValue, translate);
|
|
86
|
-
|
|
87
|
-
return idError ? { processId: idError } : {};
|
|
88
|
-
}
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import eventDefinitionHelper from 'bpmn-js-properties-panel/lib/helper/EventDefinitionHelper';
|
|
2
|
-
|
|
3
|
-
import error from 'bpmn-js-properties-panel/lib/provider/bpmn/parts/implementation/ErrorEventDefinition';
|
|
4
|
-
|
|
5
|
-
export default function(group, element, bpmnFactory, translate) {
|
|
6
|
-
|
|
7
|
-
const errorEventDefinition = eventDefinitionHelper.getErrorEventDefinition(element);
|
|
8
|
-
|
|
9
|
-
if (errorEventDefinition) {
|
|
10
|
-
error(group, element, bpmnFactory, errorEventDefinition, translate);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isAny
|
|
3
|
-
} from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
|
|
4
|
-
|
|
5
|
-
import formDefinition from './implementation/FormDefinition';
|
|
6
|
-
|
|
7
|
-
export default function(group, element, bpmnFactory, translate) {
|
|
8
|
-
|
|
9
|
-
if (!isAny(element, [ 'bpmn:UserTask' ])) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
group.entries = group.entries.concat(formDefinition(element, bpmnFactory, translate));
|
|
14
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import properties from './implementation/Headers';
|
|
2
|
-
|
|
3
|
-
import elementHelper from 'bpmn-js-properties-panel/lib/helper/ElementHelper';
|
|
4
|
-
|
|
5
|
-
import cmdHelper from 'bpmn-js-properties-panel/lib/helper/CmdHelper';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
is
|
|
9
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
isZeebeServiceTask
|
|
13
|
-
} from '../../../helper/ZeebeServiceTaskHelper.js';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export default function(group, element, bpmnFactory, translate) {
|
|
17
|
-
|
|
18
|
-
if (!canHaveHeaders(element)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const propertiesEntry = properties(element, bpmnFactory, translate, {
|
|
23
|
-
id: 'headers',
|
|
24
|
-
modelProperties: [ 'key', 'value' ],
|
|
25
|
-
labels: [ translate('Key'), translate('Value') ],
|
|
26
|
-
|
|
27
|
-
getParent: function(element, node, bo) {
|
|
28
|
-
return bo.extensionElements;
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
createParent: function(element, bo) {
|
|
32
|
-
const parent = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, bo, bpmnFactory);
|
|
33
|
-
const cmd = cmdHelper.updateBusinessObject(element, bo, { extensionElements: parent });
|
|
34
|
-
return {
|
|
35
|
-
cmd: cmd,
|
|
36
|
-
parent: parent
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
if (propertiesEntry) {
|
|
42
|
-
group.entries.push(propertiesEntry);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// helpers ////////////////
|
|
49
|
-
|
|
50
|
-
function canHaveHeaders(element) {
|
|
51
|
-
return is(element, 'bpmn:UserTask') || isZeebeServiceTask(element);
|
|
52
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import inputOutput from './implementation/InputOutput';
|
|
2
|
-
|
|
3
|
-
export default function(group, element, bpmnFactory, translate, options) {
|
|
4
|
-
|
|
5
|
-
const inputOutputEntry = inputOutput(element, bpmnFactory, translate, options);
|
|
6
|
-
|
|
7
|
-
group.entries = group.entries.concat(inputOutputEntry.entries);
|
|
8
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getBusinessObject,
|
|
3
|
-
is
|
|
4
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
isEventSubProcess
|
|
8
|
-
} from 'bpmn-js/lib/util/DiUtil';
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
isZeebeServiceTask
|
|
12
|
-
} from '../../../helper/ZeebeServiceTaskHelper.js';
|
|
13
|
-
|
|
14
|
-
import eventDefinitionHelper from 'bpmn-js-properties-panel/lib/helper/EventDefinitionHelper';
|
|
15
|
-
|
|
16
|
-
import message from 'bpmn-js-properties-panel/lib/provider/bpmn/parts/implementation/MessageEventDefinition';
|
|
17
|
-
|
|
18
|
-
import referenceExtensionElementProperty from './implementation/ElementReferenceExtensionElementProperty';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export default function(group, element, bpmnFactory, translate) {
|
|
22
|
-
|
|
23
|
-
const messageEventDefinition = eventDefinitionHelper.getMessageEventDefinition(element),
|
|
24
|
-
parent = element.parent;
|
|
25
|
-
|
|
26
|
-
if (is(element, 'bpmn:ReceiveTask')) {
|
|
27
|
-
message(group, element, bpmnFactory, getBusinessObject(element), translate);
|
|
28
|
-
group.entries = group.entries.concat(referenceExtensionElementProperty(element, getBusinessObject(element), bpmnFactory, translate, {
|
|
29
|
-
id: 'message-element-subscription',
|
|
30
|
-
label: translate('Subscription Correlation Key'),
|
|
31
|
-
referenceProperty: 'messageRef',
|
|
32
|
-
modelProperty: 'correlationKey',
|
|
33
|
-
extensionElement: 'zeebe:Subscription',
|
|
34
|
-
shouldValidate: true
|
|
35
|
-
}));
|
|
36
|
-
} else if (messageEventDefinition && !isZeebeServiceTask(element)) {
|
|
37
|
-
message(group, element, bpmnFactory, messageEventDefinition, translate);
|
|
38
|
-
if (!is(element, 'bpmn:StartEvent') || isEventSubProcess(parent)) {
|
|
39
|
-
|
|
40
|
-
group.entries = group.entries.concat(referenceExtensionElementProperty(element, messageEventDefinition, bpmnFactory, translate, {
|
|
41
|
-
id: 'message-element-subscription',
|
|
42
|
-
label: translate('Subscription Correlation Key'),
|
|
43
|
-
referenceProperty: 'messageRef',
|
|
44
|
-
modelProperty: 'correlationKey',
|
|
45
|
-
extensionElement: 'zeebe:Subscription',
|
|
46
|
-
shouldValidate: true
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getBusinessObject
|
|
3
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
4
|
-
|
|
5
|
-
import multiInstanceLoopCharacteristics from './implementation/MultiInstanceLoopCharacteristics';
|
|
6
|
-
|
|
7
|
-
export default function(group, element, bpmnFactory, translate) {
|
|
8
|
-
|
|
9
|
-
if (!ensureMultiInstanceSupported(element)) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
group.entries = group.entries.concat(multiInstanceLoopCharacteristics(element, bpmnFactory, translate));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// helpers //////////////
|
|
17
|
-
|
|
18
|
-
function getLoopCharacteristics(element) {
|
|
19
|
-
const bo = getBusinessObject(element);
|
|
20
|
-
return bo.loopCharacteristics;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function ensureMultiInstanceSupported(element) {
|
|
24
|
-
return !!getLoopCharacteristics(element);
|
|
25
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isAny
|
|
3
|
-
} from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
getBusinessObject
|
|
7
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
escapeHTML
|
|
11
|
-
} from 'bpmn-js-properties-panel/lib/Utils';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
query as domQuery
|
|
15
|
-
} from 'min-dom';
|
|
16
|
-
|
|
17
|
-
import cmdHelper from 'bpmn-js-properties-panel/lib/helper/CmdHelper';
|
|
18
|
-
|
|
19
|
-
import elementHelper from 'bpmn-js-properties-panel/lib/helper/ElementHelper';
|
|
20
|
-
|
|
21
|
-
export default function(group, element, bpmnFactory, translate) {
|
|
22
|
-
const bo = getBusinessObject(element);
|
|
23
|
-
|
|
24
|
-
if (!bo) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (!isConditionalSource(element.source)) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
group.entries.push({
|
|
33
|
-
id: 'condition',
|
|
34
|
-
label: translate('Condition expression'),
|
|
35
|
-
html: // expression
|
|
36
|
-
`<div class="bpp-row">
|
|
37
|
-
<label for="zeebe-condition">
|
|
38
|
-
${escapeHTML(translate('Condition expression'))}
|
|
39
|
-
</label>
|
|
40
|
-
<div class="bpp-field-wrapper">
|
|
41
|
-
<input id="zeebe-condition" type="text" name="condition" />
|
|
42
|
-
<button class="action-button clear" data-action="clear" data-show="canClear">
|
|
43
|
-
<span>X</span>
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
</div>`,
|
|
47
|
-
|
|
48
|
-
get: function(element, propertyName) {
|
|
49
|
-
|
|
50
|
-
// read values from xml:
|
|
51
|
-
const conditionExpression = bo.conditionExpression;
|
|
52
|
-
|
|
53
|
-
const values = {};
|
|
54
|
-
let conditionType = '';
|
|
55
|
-
|
|
56
|
-
if (conditionExpression) {
|
|
57
|
-
conditionType = 'expression';
|
|
58
|
-
values.condition = conditionExpression.get('body');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
values.conditionType = conditionType;
|
|
62
|
-
|
|
63
|
-
return values;
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
set: function(element, values, containerElement) {
|
|
67
|
-
const conditionType = 'expression';
|
|
68
|
-
const commands = [];
|
|
69
|
-
|
|
70
|
-
const conditionProps = {
|
|
71
|
-
body: undefined
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const condition = values.condition;
|
|
75
|
-
conditionProps.body = condition;
|
|
76
|
-
|
|
77
|
-
const update = {
|
|
78
|
-
'conditionExpression': undefined
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
if (conditionType) {
|
|
82
|
-
update.conditionExpression = elementHelper.createElement(
|
|
83
|
-
'bpmn:FormalExpression',
|
|
84
|
-
conditionProps,
|
|
85
|
-
bo,
|
|
86
|
-
bpmnFactory
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
const source = element.source;
|
|
90
|
-
|
|
91
|
-
// if default-flow, remove default-property from source
|
|
92
|
-
if (source.businessObject.default === bo) {
|
|
93
|
-
commands.push(cmdHelper.updateProperties(source, { 'default': undefined }));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
commands.push(cmdHelper.updateBusinessObject(element, bo, update));
|
|
98
|
-
|
|
99
|
-
return commands;
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
validate: function(element, values) {
|
|
103
|
-
const validationResult = {};
|
|
104
|
-
|
|
105
|
-
if (!values.condition && values.conditionType === 'expression') {
|
|
106
|
-
validationResult.condition = 'Must provide a value';
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return validationResult;
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
isExpression: function(element, inputNode) {
|
|
113
|
-
const conditionType = domQuery('select[name=conditionType]', inputNode);
|
|
114
|
-
if (conditionType.selectedIndex >= 0) {
|
|
115
|
-
return conditionType.options[conditionType.selectedIndex].value === 'expression';
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
clear: function(element, inputNode) {
|
|
120
|
-
|
|
121
|
-
// clear text input
|
|
122
|
-
domQuery('input[name=condition]', inputNode).value = '';
|
|
123
|
-
|
|
124
|
-
return true;
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
canClear: function(element, inputNode) {
|
|
128
|
-
const input = domQuery('input[name=condition]', inputNode);
|
|
129
|
-
|
|
130
|
-
return input.value !== '';
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
cssClasses: ['bpp-textfield']
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
// helper //////////////////////////
|
|
139
|
-
|
|
140
|
-
const CONDITIONAL_SOURCES = [
|
|
141
|
-
'bpmn:Activity',
|
|
142
|
-
'bpmn:ExclusiveGateway',
|
|
143
|
-
'bpmn:InclusiveGateway',
|
|
144
|
-
'bpmn:ComplexGateway'
|
|
145
|
-
];
|
|
146
|
-
|
|
147
|
-
function isConditionalSource(element) {
|
|
148
|
-
return isAny(element, CONDITIONAL_SOURCES);
|
|
149
|
-
}
|