vmes-flowable
Version:
ceshibao
41 lines (30 loc) • 1.06 kB
JavaScript
;
var is = require('jeeplus-bpmn/lib/util/ModelUtil').is,
eventDefinitionHelper = require('../../../helper/EventDefinitionHelper'),
error = require('./implementation/ErrorEventDefinition');
var forEach = require('lodash/forEach');
module.exports = function(group, element, bpmnFactory, translate) {
var errorEvents = [
'bpmn:StartEvent',
'bpmn:BoundaryEvent',
'bpmn:EndEvent'
];
forEach(errorEvents, function(event) {
if (is(element, event)) {
var errorEventDefinition = eventDefinitionHelper.getErrorEventDefinition(element);
if (errorEventDefinition) {
var isCatchingErrorEvent = is(element, 'bpmn:StartEvent') || is (element, 'bpmn:BoundaryEvent');
var showErrorCodeVariable = isCatchingErrorEvent,
showErrorMessageVariable = isCatchingErrorEvent;
error(
group,
element,
bpmnFactory,
errorEventDefinition,
showErrorCodeVariable,
showErrorMessageVariable,
translate);
}
}
});
};