EscalationEventDefinition.js
1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'use strict';
var entryFactory = require('../../../../factory/EntryFactory'),
cmdHelper = require('../../../../helper/CmdHelper');
var eventDefinitionReference = require('./EventDefinitionReference'),
elementReferenceProperty = require('./ElementReferenceProperty');
module.exports = function(group, element, bpmnFactory, escalationEventDefinition, showEscalationCodeVariable, translate) {
group.entries = group.entries.concat(eventDefinitionReference(element, escalationEventDefinition, bpmnFactory, {
label: translate('Escalation'),
elementName: 'escalation',
elementType: 'bpmn:Escalation',
referenceProperty: 'escalationRef',
newElementIdPrefix: 'Escalation_'
}));
group.entries = group.entries.concat(elementReferenceProperty(element, escalationEventDefinition, bpmnFactory, {
id: 'escalation-element-name',
label: translate('Escalation Name'),
referenceProperty: 'escalationRef',
modelProperty: 'name',
shouldValidate: true
}));
group.entries = group.entries.concat(elementReferenceProperty(element, escalationEventDefinition, bpmnFactory, {
id: 'escalation-element-code',
label: translate('Escalation Code'),
referenceProperty: 'escalationRef',
modelProperty: 'escalationCode'
}));
if (showEscalationCodeVariable) {
group.entries.push(entryFactory.textField({
id : 'escalationCodeVariable',
label : translate('Escalation Code Variable'),
modelProperty : 'escalationCodeVariable',
get: function(element) {
var codeVariable = escalationEventDefinition.get('camunda:escalationCodeVariable');
return {
escalationCodeVariable: codeVariable
};
},
set: function(element, values) {
return cmdHelper.updateBusinessObject(element, escalationEventDefinition, {
'camunda:escalationCodeVariable': values.escalationCodeVariable || undefined
});
}
}));
}
};