bpmn-js-properties-panel
Version:
A simple properties panel for bpmn-js
59 lines (45 loc) • 1.96 kB
JavaScript
'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) {
group.entries = group.entries.concat(eventDefinitionReference(element, escalationEventDefinition, bpmnFactory, {
label: 'Escalation',
elementName: 'escalation',
elementType: 'bpmn:Escalation',
referenceProperty: 'escalationRef',
newElementIdPrefix: 'Escalation_'
}));
group.entries = group.entries.concat(elementReferenceProperty(element, escalationEventDefinition, bpmnFactory, {
id: 'escalation-element-name',
label: 'Escalation Name',
referenceProperty: 'escalationRef',
modelProperty: 'name',
shouldValidate: true
}));
group.entries = group.entries.concat(elementReferenceProperty(element, escalationEventDefinition, bpmnFactory, {
id: 'escalation-element-code',
label: 'Escalation Code',
referenceProperty: 'escalationRef',
modelProperty: 'escalationCode'
}));
if (showEscalationCodeVariable) {
group.entries.push(entryFactory.textField({
id : 'escalationCodeVariable',
label : '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
});
}
}));
}
};