BpmnDistributeElements.js 835 B

1234567891011121314151617181920212223242526272829303132333435
  1. import {
  2. filter
  3. } from 'min-dash';
  4. import {
  5. isAny
  6. } from '../modeling/util/ModelingUtil';
  7. /**
  8. * Registers element exclude filters for elements that
  9. * currently do not support distribution.
  10. */
  11. export default function BpmnDistributeElements(distributeElements) {
  12. distributeElements.registerFilter(function(elements) {
  13. return filter(elements, function(element) {
  14. var cannotDistribute = isAny(element, [
  15. 'bpmn:Association',
  16. 'bpmn:BoundaryEvent',
  17. 'bpmn:DataInputAssociation',
  18. 'bpmn:DataOutputAssociation',
  19. 'bpmn:Lane',
  20. 'bpmn:MessageFlow',
  21. 'bpmn:Participant',
  22. 'bpmn:SequenceFlow',
  23. 'bpmn:TextAnnotation'
  24. ]);
  25. return !(element.labelTarget || cannotDistribute);
  26. });
  27. });
  28. }
  29. BpmnDistributeElements.$inject = [ 'distributeElements' ];