EscalationEventDefinition.js 1.9 KB

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