camunda-bpmn-js 0.12.1 → 0.13.0-drilldown.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 -0
- package/dist/assets/base-modeler.css +2 -1
- package/dist/assets/bpmn-js.css +113 -0
- package/dist/assets/camunda-platform-modeler.css +2 -1
- package/dist/assets/diagram-js.css +82 -78
- package/dist/assets/element-templates.css +75 -0
- package/dist/assets/properties-panel.css +115 -18
- package/dist/base-modeler.development.js +37641 -40582
- package/dist/base-modeler.production.min.js +8 -3
- package/dist/camunda-cloud-modeler.development.js +41845 -42826
- package/dist/camunda-cloud-modeler.production.min.js +8 -3
- package/dist/camunda-platform-modeler.development.js +51089 -53714
- package/dist/camunda-platform-modeler.production.min.js +8 -3
- package/lib/base/Modeler.js +5 -9
- package/lib/camunda-cloud/Modeler.js +16 -3
- package/lib/camunda-cloud/features/drilldown/index.js +3 -0
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpAssignmentDefinitionBehavior.js +78 -0
- 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/features/modeling/behavior/index.js +3 -0
- 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 +11 -10
- package/styles/base-modeler.css +2 -1
- package/styles/camunda-platform-modeler.css +2 -1
- 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,176 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getBusinessObject
|
|
3
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
4
|
-
|
|
5
|
-
import entryFactory from 'bpmn-js-properties-panel/lib/factory/EntryFactory';
|
|
6
|
-
|
|
7
|
-
import elementHelper from 'bpmn-js-properties-panel/lib/helper/ElementHelper';
|
|
8
|
-
|
|
9
|
-
import cmdHelper from 'bpmn-js-properties-panel/lib/helper/CmdHelper';
|
|
10
|
-
|
|
11
|
-
import extensionElementsHelper from 'bpmn-js-properties-panel/lib/helper/ExtensionElementsHelper';
|
|
12
|
-
|
|
13
|
-
export default function(element, bpmnFactory, translate) {
|
|
14
|
-
|
|
15
|
-
function getProperty(element, propertyName) {
|
|
16
|
-
const loopCharacteristics = getLoopCharacteristics(element),
|
|
17
|
-
zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
|
|
18
|
-
|
|
19
|
-
return zeebeLoopCharacteristics && zeebeLoopCharacteristics.get(propertyName);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function setProperties(element, values) {
|
|
23
|
-
const loopCharacteristics = getLoopCharacteristics(element),
|
|
24
|
-
commands = [];
|
|
25
|
-
|
|
26
|
-
// ensure extensionElements
|
|
27
|
-
let extensionElements = loopCharacteristics.get('extensionElements');
|
|
28
|
-
if (!extensionElements) {
|
|
29
|
-
extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, loopCharacteristics, bpmnFactory);
|
|
30
|
-
commands.push(cmdHelper.updateBusinessObject(element, loopCharacteristics, { extensionElements: extensionElements }));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// ensure zeebe:LoopCharacteristics
|
|
34
|
-
let zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
|
|
35
|
-
if (!zeebeLoopCharacteristics) {
|
|
36
|
-
zeebeLoopCharacteristics = elementHelper.createElement('zeebe:LoopCharacteristics', { }, extensionElements, bpmnFactory);
|
|
37
|
-
commands.push(cmdHelper.addAndRemoveElementsFromList(
|
|
38
|
-
element,
|
|
39
|
-
extensionElements,
|
|
40
|
-
'values',
|
|
41
|
-
'extensionElements',
|
|
42
|
-
[ zeebeLoopCharacteristics ],
|
|
43
|
-
[]
|
|
44
|
-
));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
commands.push(cmdHelper.updateBusinessObject(element, zeebeLoopCharacteristics, values));
|
|
48
|
-
return commands;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let entries = [];
|
|
52
|
-
|
|
53
|
-
// input collection //////////////////////////////////////////////////////////////
|
|
54
|
-
entries.push(entryFactory.textField(translate, {
|
|
55
|
-
id: 'multiInstance-inputCollection',
|
|
56
|
-
label: translate('Input Collection'),
|
|
57
|
-
modelProperty: 'inputCollection',
|
|
58
|
-
|
|
59
|
-
get: function(element) {
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
inputCollection: getProperty(element, 'inputCollection')
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
set: function(element, values) {
|
|
68
|
-
return setProperties(element, {
|
|
69
|
-
inputCollection: values.inputCollection || undefined
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
validate: function(element, values) {
|
|
74
|
-
const loopCharacteristics = getLoopCharacteristics(element),
|
|
75
|
-
zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
|
|
76
|
-
|
|
77
|
-
let validation = {};
|
|
78
|
-
if (zeebeLoopCharacteristics) {
|
|
79
|
-
const {
|
|
80
|
-
inputCollection
|
|
81
|
-
} = values;
|
|
82
|
-
|
|
83
|
-
if (!inputCollection) {
|
|
84
|
-
validation = {
|
|
85
|
-
inputCollection: 'input collection must not be empty'
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return validation;
|
|
90
|
-
}
|
|
91
|
-
}));
|
|
92
|
-
|
|
93
|
-
// input element //////////////////////////////////////////////////////////////////
|
|
94
|
-
entries.push(entryFactory.textField(translate, {
|
|
95
|
-
id: 'multiInstance-inputElement',
|
|
96
|
-
label: translate('Input Element'),
|
|
97
|
-
modelProperty: 'inputElement',
|
|
98
|
-
|
|
99
|
-
get: function(element) {
|
|
100
|
-
|
|
101
|
-
return {
|
|
102
|
-
inputElement: getProperty(element, 'inputElement')
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
set: function(element, values) {
|
|
108
|
-
return setProperties(element, {
|
|
109
|
-
inputElement: values.inputElement || undefined
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}));
|
|
113
|
-
|
|
114
|
-
// output collection ////////////////////////////////////////////////////////////
|
|
115
|
-
entries.push(entryFactory.textField(translate, {
|
|
116
|
-
id: 'multiInstance-outputCollection',
|
|
117
|
-
label: translate('Output Collection'),
|
|
118
|
-
modelProperty: 'outputCollection',
|
|
119
|
-
|
|
120
|
-
get: function(element) {
|
|
121
|
-
|
|
122
|
-
return {
|
|
123
|
-
outputCollection: getProperty(element, 'outputCollection')
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
set: function(element, values) {
|
|
129
|
-
return setProperties(element, {
|
|
130
|
-
outputCollection: values.outputCollection || undefined
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
}));
|
|
134
|
-
|
|
135
|
-
// output element //////////////////////////////////////////////////////
|
|
136
|
-
entries.push(entryFactory.textField(translate, {
|
|
137
|
-
id: 'multiInstance-outputElement',
|
|
138
|
-
label: translate('Output Element'),
|
|
139
|
-
modelProperty: 'outputElement',
|
|
140
|
-
|
|
141
|
-
get: function(element) {
|
|
142
|
-
|
|
143
|
-
return {
|
|
144
|
-
outputElement: getProperty(element, 'outputElement')
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
set: function(element, values) {
|
|
150
|
-
return setProperties(element, {
|
|
151
|
-
outputElement: values.outputElement || undefined
|
|
152
|
-
});
|
|
153
|
-
},
|
|
154
|
-
}));
|
|
155
|
-
|
|
156
|
-
return entries;
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// helper /////////
|
|
161
|
-
|
|
162
|
-
function getExtensionElements(bo, type, prop) {
|
|
163
|
-
const elements = extensionElementsHelper.getExtensionElements(bo, type);
|
|
164
|
-
return !prop ? elements : (elements[0] || {})[prop] || [];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function getZeebeLoopCharacteristics(loopCharacteristics) {
|
|
168
|
-
const extensionElements = getExtensionElements(loopCharacteristics, 'zeebe:LoopCharacteristics');
|
|
169
|
-
|
|
170
|
-
return extensionElements && extensionElements[0];
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function getLoopCharacteristics(element) {
|
|
174
|
-
const bo = getBusinessObject(element);
|
|
175
|
-
return bo.loopCharacteristics;
|
|
176
|
-
}
|
package/lib/camunda-cloud/features/properties-provider/parts/implementation/OutputParameterToggle.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import cmdHelper from 'bpmn-js-properties-panel/lib/helper/CmdHelper';
|
|
2
|
-
|
|
3
|
-
import entryFactory from 'bpmn-js-properties-panel/lib/factory/EntryFactory';
|
|
4
|
-
|
|
5
|
-
import elementHelper from 'bpmn-js-properties-panel/lib/helper/ElementHelper';
|
|
6
|
-
|
|
7
|
-
import { getBusinessObject } from 'bpmn-js/lib/util/ModelUtil';
|
|
8
|
-
|
|
9
|
-
import { is } from 'bpmn-js/lib/util/ModelUtil';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
getCalledElement,
|
|
13
|
-
isPropagateAllChildVariables
|
|
14
|
-
} from '../../../../helper/CalledElementHelper';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Create an input or output mapping entry for a single input or output entry
|
|
19
|
-
* @param {Function} translate - translate function.
|
|
20
|
-
* @param {Object} options - Options.
|
|
21
|
-
* @param {string} [options.idPrefix] - preFix used to construct the 'id' of the GUI entries
|
|
22
|
-
* @param {string} [options.prop] - moddle (zeebe-bpmn-moddle) property name for the IOMapping.
|
|
23
|
-
*
|
|
24
|
-
* @returns {Object} An Object containing multiple Objects in its `entries` attribute,
|
|
25
|
-
* each representing a properties-panel entry. First entry will always be a collapsible followed
|
|
26
|
-
* by two inputs (one for source and one for target).
|
|
27
|
-
*/
|
|
28
|
-
export default function(element, bpmnFactory, translate, options = {}) {
|
|
29
|
-
if (!(is(element, 'bpmn:CallActivity') &&
|
|
30
|
-
options.prop === 'outputParameters')) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const toggle = entryFactory.toggleSwitch(translate, {
|
|
35
|
-
id: `${options.prefix}-propagate-all-toggle`,
|
|
36
|
-
label: translate('Propagate all Child Process Variables'),
|
|
37
|
-
modelProperty: 'propagateAllChildVariables',
|
|
38
|
-
labelOn: translate('On'),
|
|
39
|
-
labelOff: translate('Off'),
|
|
40
|
-
descriptionOn: translate('All variables from the child process instance will be propagated to the parent process instance'),
|
|
41
|
-
descriptionOff: translate('Only variables defined via output mappings will be propagated from the child to the parent process instance'),
|
|
42
|
-
isOn: () => {
|
|
43
|
-
return isPropagateAllChildVariables(element);
|
|
44
|
-
},
|
|
45
|
-
get: () => {
|
|
46
|
-
return { propagateAllChildVariables: isPropagateAllChildVariables(element) };
|
|
47
|
-
},
|
|
48
|
-
set: function(element, values) {
|
|
49
|
-
let commands = [];
|
|
50
|
-
|
|
51
|
-
const propagateAllChildVariables = values.propagateAllChildVariables || false;
|
|
52
|
-
|
|
53
|
-
commands.push(setCalledElementProperties(element, bpmnFactory, { propagateAllChildVariables }));
|
|
54
|
-
|
|
55
|
-
return commands;
|
|
56
|
-
},
|
|
57
|
-
hidden: function() {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
return toggle;
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// helper //////////////////////////
|
|
68
|
-
|
|
69
|
-
function setCalledElementProperties(element, bpmnFactory, values) {
|
|
70
|
-
const businessObject = getBusinessObject(element),
|
|
71
|
-
commands = [];
|
|
72
|
-
|
|
73
|
-
// ensure extensionElements
|
|
74
|
-
let extensionElements = businessObject.get('extensionElements');
|
|
75
|
-
if (!extensionElements) {
|
|
76
|
-
extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, businessObject, bpmnFactory);
|
|
77
|
-
commands.push(cmdHelper.updateBusinessObject(element, businessObject, { extensionElements: extensionElements }));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// ensure zeebe:calledElement
|
|
81
|
-
let calledElement = getCalledElement(businessObject);
|
|
82
|
-
if (!calledElement) {
|
|
83
|
-
calledElement = elementHelper.createElement('zeebe:CalledElement', { }, extensionElements, bpmnFactory);
|
|
84
|
-
commands.push(cmdHelper.addAndRemoveElementsFromList(
|
|
85
|
-
element,
|
|
86
|
-
extensionElements,
|
|
87
|
-
'values',
|
|
88
|
-
'extensionElements',
|
|
89
|
-
[ calledElement ],
|
|
90
|
-
[]
|
|
91
|
-
));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// update properties
|
|
95
|
-
commands.push(cmdHelper.updateBusinessObject(element, calledElement, values));
|
|
96
|
-
return commands;
|
|
97
|
-
}
|
|
@@ -1,69 +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 entryFactory from 'bpmn-js-properties-panel/lib/factory/EntryFactory';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Creates 'bpmn:FormalExpression' element.
|
|
10
|
-
*
|
|
11
|
-
* @param {ModdleElement} parent
|
|
12
|
-
* @param {string} body
|
|
13
|
-
* @param {BpmnFactory} bpmnFactory
|
|
14
|
-
*
|
|
15
|
-
* @return {ModdleElement<bpmn:FormalExpression>} a formal expression
|
|
16
|
-
*/
|
|
17
|
-
function createFormalExpression(parent, body = undefined, bpmnFactory) {
|
|
18
|
-
return elementHelper.createElement('bpmn:FormalExpression', { body: body }, parent, bpmnFactory);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default function(group, bpmnFactory, timerEventDefinition, translate) {
|
|
22
|
-
group.entries.push(entryFactory.textField(translate, {
|
|
23
|
-
id: 'timer-event-duration',
|
|
24
|
-
label: translate('Timer Duration'),
|
|
25
|
-
modelProperty: 'timerDefinition',
|
|
26
|
-
|
|
27
|
-
get: function(element, node) {
|
|
28
|
-
const type = 'timeDuration';
|
|
29
|
-
const definition = type && timerEventDefinition.get(type);
|
|
30
|
-
const value = definition && definition.get('body');
|
|
31
|
-
return {
|
|
32
|
-
timerDefinition: value
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
set: function(element, values) {
|
|
37
|
-
const type = 'timeDuration';
|
|
38
|
-
let definition = type && timerEventDefinition.get(type);
|
|
39
|
-
const commands = [];
|
|
40
|
-
|
|
41
|
-
if (!definition) {
|
|
42
|
-
definition = createFormalExpression(timerEventDefinition, {}, bpmnFactory);
|
|
43
|
-
commands.push(cmdHelper.updateBusinessObject(element, timerEventDefinition, { 'timeDuration': definition }));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (definition) {
|
|
47
|
-
commands.push(cmdHelper.updateBusinessObject(element, definition, {
|
|
48
|
-
body: values.timerDefinition || undefined
|
|
49
|
-
}));
|
|
50
|
-
return commands;
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
validate: function(element) {
|
|
55
|
-
const type = 'timeDuration';
|
|
56
|
-
const definition = type && timerEventDefinition.get(type);
|
|
57
|
-
if (definition) {
|
|
58
|
-
const value = definition.get('body');
|
|
59
|
-
if (!value) {
|
|
60
|
-
return {
|
|
61
|
-
timerDefinition: translate('Must provide a value')
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}));
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerEventDefinition.js
DELETED
|
@@ -1,132 +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 entryFactory from 'bpmn-js-properties-panel/lib/factory/EntryFactory';
|
|
6
|
-
|
|
7
|
-
export default function(group, bpmnFactory, timerEventDefinition, timerOptions, translate) {
|
|
8
|
-
|
|
9
|
-
const selectOptions = timerOptions;
|
|
10
|
-
|
|
11
|
-
group.entries.push(entryFactory.selectBox(translate, {
|
|
12
|
-
id: 'timer-event-definition-type',
|
|
13
|
-
label: translate('Timer Definition Type'),
|
|
14
|
-
selectOptions: selectOptions,
|
|
15
|
-
emptyParameter: true,
|
|
16
|
-
modelProperty: 'timerDefinitionType',
|
|
17
|
-
|
|
18
|
-
get: function(element, node) {
|
|
19
|
-
return {
|
|
20
|
-
timerDefinitionType: getTimerDefinitionType(timerEventDefinition) || ''
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
set: function(element, values) {
|
|
25
|
-
const props = {
|
|
26
|
-
timeDuration: undefined,
|
|
27
|
-
timeDate: undefined,
|
|
28
|
-
timeCycle: undefined
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const newType = values.timerDefinitionType;
|
|
32
|
-
if (values.timerDefinitionType) {
|
|
33
|
-
const oldType = getTimerDefinitionType(timerEventDefinition);
|
|
34
|
-
|
|
35
|
-
let value;
|
|
36
|
-
if (oldType) {
|
|
37
|
-
const definition = timerEventDefinition.get(oldType);
|
|
38
|
-
value = definition.get('body');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
props[newType] = createFormalExpression(timerEventDefinition, value, bpmnFactory);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return cmdHelper.updateBusinessObject(element, timerEventDefinition, props);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
group.entries.push(entryFactory.textField(translate, {
|
|
50
|
-
id: 'timer-event-definition',
|
|
51
|
-
label: translate('Timer Definition'),
|
|
52
|
-
modelProperty: 'timerDefinition',
|
|
53
|
-
|
|
54
|
-
get: function(element, node) {
|
|
55
|
-
const type = getTimerDefinitionType(timerEventDefinition);
|
|
56
|
-
const definition = type && timerEventDefinition.get(type);
|
|
57
|
-
const value = definition && definition.get('body');
|
|
58
|
-
return {
|
|
59
|
-
timerDefinition: value
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
set: function(element, values) {
|
|
64
|
-
const type = getTimerDefinitionType(timerEventDefinition);
|
|
65
|
-
const definition = type && timerEventDefinition.get(type);
|
|
66
|
-
|
|
67
|
-
if (definition) {
|
|
68
|
-
return cmdHelper.updateBusinessObject(element, definition, {
|
|
69
|
-
body: values.timerDefinition || undefined
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
validate: function(element) {
|
|
75
|
-
const type = getTimerDefinitionType(timerEventDefinition);
|
|
76
|
-
const definition = type && timerEventDefinition.get(type);
|
|
77
|
-
if (definition) {
|
|
78
|
-
const value = definition.get('body');
|
|
79
|
-
if (!value) {
|
|
80
|
-
return {
|
|
81
|
-
timerDefinition: translate('Must provide a value')
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
hidden: function(element) {
|
|
88
|
-
return !getTimerDefinitionType(timerEventDefinition);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// helper //////////
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Get the timer definition type for a given timer event definition.
|
|
98
|
-
*
|
|
99
|
-
* @param {ModdleElement<bpmn:TimerEventDefinition>} timer
|
|
100
|
-
*
|
|
101
|
-
* @return {string|undefined} the timer definition type
|
|
102
|
-
*/
|
|
103
|
-
const getTimerDefinitionType = (timer) => {
|
|
104
|
-
const timeDate = timer.get('timeDate');
|
|
105
|
-
if (typeof timeDate !== 'undefined') {
|
|
106
|
-
return 'timeDate';
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const timeCycle = timer.get('timeCycle');
|
|
110
|
-
if (typeof timeCycle !== 'undefined') {
|
|
111
|
-
return 'timeCycle';
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const timeDuration = timer.get('timeDuration');
|
|
115
|
-
if (typeof timeDuration !== 'undefined') {
|
|
116
|
-
return 'timeDuration';
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Creates 'bpmn:FormalExpression' element.
|
|
122
|
-
*
|
|
123
|
-
* @param {ModdleElement} parent
|
|
124
|
-
* @param {string} body
|
|
125
|
-
* @param {BpmnFactory} bpmnFactory
|
|
126
|
-
*
|
|
127
|
-
* @return {ModdleElement<bpmn:FormalExpression>} a formal expression
|
|
128
|
-
*/
|
|
129
|
-
const createFormalExpression= (parent, body, bpmnFactory) => {
|
|
130
|
-
body = body || undefined;
|
|
131
|
-
return elementHelper.createElement('bpmn:FormalExpression', { body: body }, parent, bpmnFactory);
|
|
132
|
-
};
|