@camunda/task-testing 0.2.2 → 0.2.3

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.
package/dist/index.js CHANGED
@@ -392,6 +392,7 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
392
392
  const eventBus = injector.get('eventBus');
393
393
  eventBus.on(['selection.changed', 'commandStack.changed'], () => {
394
394
  if (this._status !== 'idle') {
395
+ console.log('Interrupting task execution in TaskExecution');
395
396
  this.emit('taskExecution.interrupted');
396
397
  }
397
398
  this.cancelTaskExecution();
@@ -1060,7 +1061,7 @@ function OutputBanner({
1060
1061
  } : {};
1061
1062
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
1062
1063
  title: "Task execution failed",
1063
- description: `Incident: ${output.incident.type}`,
1064
+ description: `Incident: ${output.incident.errorType}`,
1064
1065
  ...action
1065
1066
  });
1066
1067
  }
@@ -1503,16 +1504,20 @@ function TaskTesting({
1503
1504
  });
1504
1505
  onTaskExecutionFinished(element, output);
1505
1506
  };
1507
+ const handleInterrupted = () => {
1508
+ console.log('interrrrrrupted');
1509
+ onTaskExecutionInterrupted();
1510
+ };
1506
1511
  taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur = taskExecutionRef.current) === null || _taskExecutionRef$cur === void 0 || _taskExecutionRef$cur.on('taskExecution.finished', handleFinished);
1507
1512
  taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur2 = taskExecutionRef.current) === null || _taskExecutionRef$cur2 === void 0 || _taskExecutionRef$cur2.on('taskExecution.status.changed', handleStatusChange);
1508
1513
  taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur3 = taskExecutionRef.current) === null || _taskExecutionRef$cur3 === void 0 || _taskExecutionRef$cur3.on('taskExecution.error', handleError);
1509
- taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur4 = taskExecutionRef.current) === null || _taskExecutionRef$cur4 === void 0 || _taskExecutionRef$cur4.on('taskExecution.interrupted', () => onTaskExecutionInterrupted());
1514
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur4 = taskExecutionRef.current) === null || _taskExecutionRef$cur4 === void 0 || _taskExecutionRef$cur4.on('taskExecution.interrupted', handleInterrupted);
1510
1515
  return () => {
1511
1516
  if (taskExecutionRef.current) {
1512
1517
  taskExecutionRef.current.off('taskExecution.finished', handleFinished);
1513
1518
  taskExecutionRef.current.off('taskExecution.status.changed', handleStatusChange);
1514
1519
  taskExecutionRef.current.off('taskExecution.error', handleError);
1515
- taskExecutionRef.current.off('taskExecution.interrupted', () => onTaskExecutionInterrupted());
1520
+ taskExecutionRef.current.off('taskExecution.interrupted', handleInterrupted);
1516
1521
  }
1517
1522
  };
1518
1523
  }, [element]);
@@ -1546,10 +1551,10 @@ function TaskTesting({
1546
1551
  if (!isConnectionConfigured || inputError || !element || !taskExecutionRef.current || !elementConfigRef.current) {
1547
1552
  return;
1548
1553
  }
1554
+ onTaskExecutionStarted(element);
1549
1555
  const inputConfig = await elementConfigRef.current.getInputConfigForElement(element);
1550
1556
  elementConfigRef.current.setOutputConfigForElement(element, null);
1551
1557
  taskExecutionRef.current.executeTask(element.id, JSON.parse(inputConfig));
1552
- onTaskExecutionStarted(element);
1553
1558
  };
1554
1559
  const handleCancelTaskExecution = () => {
1555
1560
  var _taskExecutionRef$cur5;