bpmn-js/lib/util/DiUtil.js

30 lines
701 B
JavaScript

'use strict';
var is = require('./ModelUtil').is,
getBusinessObject = require('./ModelUtil').getBusinessObject;
module.exports.isExpanded = function(element) {
if (is(element, 'bpmn:CallActivity')) {
return false;
}
if (is(element, 'bpmn:SubProcess')) {
return getBusinessObject(element).di.isExpanded;
}
if (is(element, 'bpmn:Participant')) {
return !!getBusinessObject(element).processRef;
}
return true;
};
module.exports.isInterrupting = function(element) {
return element && getBusinessObject(element).isInterrupting !== false;
};
module.exports.isEventSubProcess = function(element) {
return element && !!getBusinessObject(element).triggeredByEvent;
};