2016-06-14 06:43:38 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var filter = require('lodash/collection/filter');
|
|
|
|
|
|
|
|
var isAny = require('../modeling/util/ModelingUtil').isAny;
|
|
|
|
|
|
|
|
/**
|
2018-01-24 10:41:57 +00:00
|
|
|
* Registers element exclude filters for elements that
|
|
|
|
* currently do not support distribution.
|
2016-06-14 06:43:38 +00:00
|
|
|
*/
|
|
|
|
function BpmnDistributeElements(distributeElements) {
|
|
|
|
|
|
|
|
distributeElements.registerFilter(function(elements) {
|
|
|
|
return filter(elements, function(element) {
|
|
|
|
var cannotDistribute = isAny(element, [
|
2016-08-15 12:01:36 +00:00
|
|
|
'bpmn:Association',
|
|
|
|
'bpmn:BoundaryEvent',
|
2016-06-14 06:43:38 +00:00
|
|
|
'bpmn:DataInputAssociation',
|
|
|
|
'bpmn:DataOutputAssociation',
|
2016-08-15 12:01:36 +00:00
|
|
|
'bpmn:Lane',
|
|
|
|
'bpmn:MessageFlow',
|
2016-06-14 06:43:38 +00:00
|
|
|
'bpmn:Participant',
|
2016-08-15 12:01:36 +00:00
|
|
|
'bpmn:SequenceFlow',
|
|
|
|
'bpmn:TextAnnotation'
|
2016-06-14 06:43:38 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
return !(element.labelTarget || cannotDistribute);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
BpmnDistributeElements.$inject = [ 'distributeElements' ];
|
|
|
|
|
|
|
|
module.exports = BpmnDistributeElements;
|