camunda-bpmn-js 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102223,13 +102223,13 @@
102223
102223
  }
102224
102224
 
102225
102225
  function isErrorSupported(element) {
102226
- return isAny$1(element, ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:EndEvent']) && !!getErrorEventDefinition(element);
102226
+ return isAny$1(element, ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:EndEvent']) && !!getErrorEventDefinition$1(element);
102227
102227
  }
102228
- function getErrorEventDefinition(element) {
102228
+ function getErrorEventDefinition$1(element) {
102229
102229
  return getEventDefinition$1(element, 'bpmn:ErrorEventDefinition');
102230
102230
  }
102231
102231
  function getError(element) {
102232
- const errorEventDefinition = getErrorEventDefinition(element);
102232
+ const errorEventDefinition = getErrorEventDefinition$1(element);
102233
102233
  return errorEventDefinition && errorEventDefinition.get('errorRef');
102234
102234
  }
102235
102235
  function getEventDefinition$1(element, eventType) {
@@ -102714,7 +102714,7 @@
102714
102714
  const bpmnFactory = useService('bpmnFactory');
102715
102715
  const commandStack = useService('commandStack');
102716
102716
  const translate = useService('translate');
102717
- const errorEventDefinition = getErrorEventDefinition(element);
102717
+ const errorEventDefinition = getErrorEventDefinition$1(element);
102718
102718
  const getValue = () => {
102719
102719
  const error = getError(element);
102720
102720
  if (error) {
@@ -105997,7 +105997,7 @@
105997
105997
  return !prop ? elems : (elems[0] || {})[prop] || [];
105998
105998
  }
105999
105999
  function getParameters$1(element, prop) {
106000
- const ioMapping = getIoMapping$1(element);
106000
+ const ioMapping = getIoMapping$2(element);
106001
106001
  return ioMapping && ioMapping.get(prop) || [];
106002
106002
  }
106003
106003
 
@@ -106008,7 +106008,7 @@
106008
106008
  *
106009
106009
  * @return {ModdleElement} the ioMapping object
106010
106010
  */
106011
- function getIoMapping$1(element) {
106011
+ function getIoMapping$2(element) {
106012
106012
  const bo = getBusinessObject$2(element);
106013
106013
  return (getElements$1(bo, 'zeebe:IoMapping') || [])[0];
106014
106014
  }
@@ -106040,6 +106040,9 @@
106040
106040
  return isAny$1(element, ['bpmn:UserTask', 'bpmn:SubProcess', 'bpmn:CallActivity', 'bpmn:BusinessRuleTask', 'bpmn:ScriptTask']) || isZeebeServiceTask(element) || isSignalThrowEvent(element);
106041
106041
  }
106042
106042
  function areOutputParametersSupported$1(element) {
106043
+ if (is$6(element, 'bpmn:EndEvent') && getErrorEventDefinition$1(element)) {
106044
+ return false;
106045
+ }
106043
106046
  return isAny$1(element, ['zeebe:ZeebeServiceTask', 'bpmn:UserTask', 'bpmn:SubProcess', 'bpmn:ReceiveTask', 'bpmn:CallActivity', 'bpmn:Event', 'bpmn:BusinessRuleTask']);
106044
106047
  }
106045
106048
  function createIOMapping(properties, parent, bpmnFactory) {
@@ -106098,7 +106101,7 @@
106098
106101
  return function (event) {
106099
106102
  event.stopPropagation();
106100
106103
  const commands = [];
106101
- const ioMapping = getIoMapping$1(element);
106104
+ const ioMapping = getIoMapping$2(element);
106102
106105
  if (!ioMapping) {
106103
106106
  return;
106104
106107
  }
@@ -106162,7 +106165,7 @@
106162
106165
  }
106163
106166
 
106164
106167
  // (2) ensure IoMapping
106165
- let ioMapping = getIoMapping$1(element);
106168
+ let ioMapping = getIoMapping$2(element);
106166
106169
  if (!ioMapping) {
106167
106170
  ioMapping = createIOMapping({
106168
106171
  inputParameters: [],
@@ -106786,7 +106789,7 @@
106786
106789
  return function (event) {
106787
106790
  event.stopPropagation();
106788
106791
  let commands = [];
106789
- const ioMapping = getIoMapping$1(element);
106792
+ const ioMapping = getIoMapping$2(element);
106790
106793
  if (!ioMapping) {
106791
106794
  return;
106792
106795
  }
@@ -106850,7 +106853,7 @@
106850
106853
  }
106851
106854
 
106852
106855
  // (2) ensure IoMapping
106853
- let ioMapping = getIoMapping$1(element);
106856
+ let ioMapping = getIoMapping$2(element);
106854
106857
  if (!ioMapping) {
106855
106858
  const parent = extensionElements;
106856
106859
  ioMapping = createIOMapping({
@@ -108943,6 +108946,74 @@
108943
108946
  return getExtensionElementsList$1(businessObject, 'zeebe:TaskHeaders')[ 0 ];
108944
108947
  }
108945
108948
 
108949
+ class CleanUpEndEventBehavior extends CommandInterceptor$1 {
108950
+ constructor(eventBus, modeling) {
108951
+ super(eventBus);
108952
+
108953
+ this.postExecuted('shape.replace', function(event) {
108954
+
108955
+ const {
108956
+ context
108957
+ } = event;
108958
+
108959
+ const {
108960
+ newShape
108961
+ } = context;
108962
+
108963
+ if (!is$6(newShape, 'bpmn:EndEvent') || !getErrorEventDefinition(newShape)) {
108964
+ return;
108965
+ }
108966
+
108967
+ const ioMapping = getIoMapping$1(newShape);
108968
+
108969
+ if (!ioMapping) {
108970
+ return;
108971
+ }
108972
+
108973
+ const businessObject = getBusinessObject$2(newShape),
108974
+ extensionElements = businessObject.get('extensionElements'),
108975
+ values = without(extensionElements.get('values'), ioMapping);
108976
+
108977
+ modeling.updateModdleProperties(newShape, extensionElements, { values });
108978
+ });
108979
+ }
108980
+ }
108981
+
108982
+ CleanUpEndEventBehavior.$inject = [
108983
+ 'eventBus',
108984
+ 'modeling'
108985
+ ];
108986
+
108987
+ // helpers //////////
108988
+
108989
+ function getErrorEventDefinition(element) {
108990
+ const businessObject = getBusinessObject$2(element);
108991
+
108992
+ const eventDefinitions = businessObject.get('eventDefinitions') || [];
108993
+
108994
+ return find$2(eventDefinitions, function(definition) {
108995
+ return is$6(definition, 'bpmn:ErrorEventDefinition');
108996
+ });
108997
+ }
108998
+
108999
+ function getIoMapping$1(element) {
109000
+ const bo = getBusinessObject$2(element);
109001
+
109002
+ const extensionElements = bo.get('extensionElements');
109003
+
109004
+ if (!extensionElements) {
109005
+ return null;
109006
+ }
109007
+
109008
+ const values = extensionElements.get('values');
109009
+
109010
+ if (!values) {
109011
+ return null;
109012
+ }
109013
+
109014
+ return find$2(values, value => is$6(value, 'zeebe:IoMapping'));
109015
+ }
109016
+
108946
109017
  function getTimerEventDefinition(element) {
108947
109018
  const businessObject = getBusinessObject$2(element);
108948
109019
 
@@ -109849,6 +109920,7 @@
109849
109920
  var behaviorsModule = {
109850
109921
  __init__: [
109851
109922
  'cleanUpBusinessRuleTaskBehavior',
109923
+ 'cleanUpEndEventBehavior',
109852
109924
  'cleanUpTimerExpressionBehavior',
109853
109925
  'copyPasteBehavior',
109854
109926
  'createZeebeCallActivityBehavior',
@@ -109859,6 +109931,7 @@
109859
109931
  'updatePropagateAllChildVariablesBehavior'
109860
109932
  ],
109861
109933
  cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
109934
+ cleanUpEndEventBehavior: [ 'type', CleanUpEndEventBehavior ],
109862
109935
  cleanUpTimerExpressionBehavior: [ 'type', CleanUpTimerExpressionBehavior ],
109863
109936
  copyPasteBehavior: [ 'type', ZeebeModdleExtension ],
109864
109937
  createZeebeCallActivityBehavior: [ 'type', CreateZeebeCallActivityBehavior ],