ExecutableProps.js
1.13 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
'use strict';
var is = require('bpmn-js/lib/util/ModelUtil').is,
getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject;
var entryFactory = require('../../../factory/EntryFactory');
var participantHelper = require('../../../helper/ParticipantHelper');
module.exports = function(group, element, translate) {
var bo = getBusinessObject(element);
if (!bo) {
return;
}
if (is(element, 'bpmn:Process') || (is(element, 'bpmn:Participant') && bo.get('processRef'))) {
var executableEntry = entryFactory.checkbox({
id: 'process-is-executable',
label: translate('Executable'),
modelProperty: 'isExecutable'
});
// in participants we have to change the default behavior of set and get
if (is(element, 'bpmn:Participant')) {
executableEntry.get = function(element) {
return participantHelper.getProcessBusinessObject(element, 'isExecutable');
};
executableEntry.set = function(element, values) {
return participantHelper.modifyProcessBusinessObject(element, 'isExecutable', values);
};
}
group.entries.push(executableEntry);
}
};