chunk-ZH5JUQV2.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import {
  2. getBusinessObject,
  3. getDi,
  4. is
  5. } from "./chunk-L5SG54UC.js";
  6. import {
  7. some
  8. } from "./chunk-4AK4GF4H.js";
  9. // node_modules/.pnpm/bpmn-js@16.3.2/node_modules/bpmn-js/lib/util/DiUtil.js
  10. function isExpanded(element, di) {
  11. if (is(element, "bpmn:CallActivity")) {
  12. return false;
  13. }
  14. if (is(element, "bpmn:SubProcess")) {
  15. di = di || getDi(element);
  16. if (di && is(di, "bpmndi:BPMNPlane")) {
  17. return true;
  18. }
  19. return di && !!di.isExpanded;
  20. }
  21. if (is(element, "bpmn:Participant")) {
  22. return !!getBusinessObject(element).processRef;
  23. }
  24. return true;
  25. }
  26. function isHorizontal(element) {
  27. if (!is(element, "bpmn:Participant") && !is(element, "bpmn:Lane")) {
  28. return void 0;
  29. }
  30. var isHorizontal2 = getDi(element).isHorizontal;
  31. if (isHorizontal2 === void 0) {
  32. return true;
  33. }
  34. return isHorizontal2;
  35. }
  36. function isInterrupting(element) {
  37. return element && getBusinessObject(element).isInterrupting !== false;
  38. }
  39. function isEventSubProcess(element) {
  40. return element && !!getBusinessObject(element).triggeredByEvent;
  41. }
  42. function hasEventDefinition(element, eventType) {
  43. var eventDefinitions = getBusinessObject(element).eventDefinitions;
  44. return some(eventDefinitions, function(event) {
  45. return is(event, eventType);
  46. });
  47. }
  48. function hasErrorEventDefinition(element) {
  49. return hasEventDefinition(element, "bpmn:ErrorEventDefinition");
  50. }
  51. function hasEscalationEventDefinition(element) {
  52. return hasEventDefinition(element, "bpmn:EscalationEventDefinition");
  53. }
  54. function hasCompensateEventDefinition(element) {
  55. return hasEventDefinition(element, "bpmn:CompensateEventDefinition");
  56. }
  57. export {
  58. isExpanded,
  59. isHorizontal,
  60. isInterrupting,
  61. isEventSubProcess,
  62. hasEventDefinition,
  63. hasErrorEventDefinition,
  64. hasEscalationEventDefinition,
  65. hasCompensateEventDefinition
  66. };
  67. //# sourceMappingURL=chunk-ZH5JUQV2.js.map