ErrorEventProps.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. var is = require('bpmn-js/lib/util/ModelUtil').is,
  3. eventDefinitionHelper = require('../../../helper/EventDefinitionHelper'),
  4. error = require('./implementation/ErrorEventDefinition');
  5. var forEach = require('lodash/forEach');
  6. module.exports = function(group, element, bpmnFactory, translate) {
  7. var errorEvents = [
  8. 'bpmn:StartEvent',
  9. 'bpmn:BoundaryEvent',
  10. 'bpmn:EndEvent'
  11. ];
  12. forEach(errorEvents, function(event) {
  13. if (is(element, event)) {
  14. var errorEventDefinition = eventDefinitionHelper.getErrorEventDefinition(element);
  15. if (errorEventDefinition) {
  16. var isCatchingErrorEvent = is(element, 'bpmn:StartEvent') || is (element, 'bpmn:BoundaryEvent');
  17. var showErrorCodeVariable = isCatchingErrorEvent,
  18. showErrorMessageVariable = isCatchingErrorEvent;
  19. error(
  20. group,
  21. element,
  22. bpmnFactory,
  23. errorEventDefinition,
  24. showErrorCodeVariable,
  25. showErrorMessageVariable,
  26. translate);
  27. }
  28. }
  29. });
  30. };