bpmn-js/lib/util/DiUtil.js

26 lines
572 B
JavaScript
Raw Normal View History

'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.isEventSubProcess = function(element) {
return element && !!getBusinessObject(element).triggeredByEvent;
};