@eclipse-glsp-examples/workflow-server-bundled 2.4.0-next.117 → 2.4.0-next.119

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp-examples/workflow-server-bundled",
3
- "version": "2.4.0-next.117+6064bdb",
3
+ "version": "2.4.0-next.119+86e89a1",
4
4
  "description": "GLSP node server for the workflow example (bundled)",
5
5
  "keywords": [
6
6
  "eclipse",
@@ -49,5 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "6064bdbe4f9590c6ce92e98914154ddfd18abdcd"
52
+ "gitHead": "86e89a196104c33a8121ecbb17390c0e3520a9bd"
53
53
  }
@@ -63425,11 +63425,16 @@ let RequestModelActionHandler = class RequestModelActionHandler {
63425
63425
  this.modelState.setAll((_a = action.options) !== null && _a !== void 0 ? _a : {});
63426
63426
  const isReconnecting = client_options_util_1.ClientOptionsUtil.isReconnecting(action.options);
63427
63427
  const progress = this.reportModelLoading('Model loading in progress');
63428
- if (isReconnecting) {
63429
- await this.handleReconnect(action);
63428
+ try {
63429
+ if (isReconnecting) {
63430
+ await this.handleReconnect(action);
63431
+ }
63432
+ else {
63433
+ await this.sourceModelStorage.loadSourceModel(action);
63434
+ }
63430
63435
  }
63431
- else {
63432
- await this.sourceModelStorage.loadSourceModel(action);
63436
+ catch (err) {
63437
+ this.handleModelLoadingError(err, progress);
63433
63438
  }
63434
63439
  this.reportModelLoadingFinished(progress);
63435
63440
  return this.submissionHandler.submitInitialModel(action);
@@ -63452,7 +63457,13 @@ let RequestModelActionHandler = class RequestModelActionHandler {
63452
63457
  }
63453
63458
  reportModelLoadingFinished(monitor) {
63454
63459
  this.actionDispatcher.dispatch(protocol_1.StatusAction.create('', { severity: 'NONE' }));
63455
- monitor.end();
63460
+ monitor === null || monitor === void 0 ? void 0 : monitor.end();
63461
+ }
63462
+ handleModelLoadingError(error, monitor) {
63463
+ // In case of an error we end progress reporting and rethrow the error so
63464
+ // that it can be handled by the default error handler
63465
+ monitor === null || monitor === void 0 ? void 0 : monitor.end();
63466
+ throw error;
63456
63467
  }
63457
63468
  };
63458
63469
  exports.RequestModelActionHandler = RequestModelActionHandler;
@@ -64542,7 +64553,22 @@ let GModelChangeBoundsOperationHandler = class GModelChangeBoundsOperationHandle
64542
64553
  this.operationType = protocol_1.ChangeBoundsOperation.KIND;
64543
64554
  }
64544
64555
  createCommand(operation) {
64545
- return this.commandOf(() => this.executeChangeBounds(operation));
64556
+ const newBounds = operation.newBounds.filter(element => this.hasChanged(element));
64557
+ if (newBounds.length === 0) {
64558
+ return undefined;
64559
+ }
64560
+ return this.commandOf(() => this.executeChangeBounds({ ...operation, newBounds }));
64561
+ }
64562
+ hasChanged(element) {
64563
+ const knownElement = this.modelState.index.find(element.elementId);
64564
+ if (!knownElement || !(0, graph_1.isGBoundsAware)(knownElement)) {
64565
+ return true;
64566
+ }
64567
+ const sizeChanged = knownElement.size ? !protocol_1.Dimension.equals(knownElement.size, element.newSize) : true;
64568
+ if (sizeChanged) {
64569
+ return true;
64570
+ }
64571
+ return knownElement.position && element.newPosition ? !protocol_1.Point.equals(knownElement.position, element.newPosition) : true;
64546
64572
  }
64547
64573
  executeChangeBounds(operation) {
64548
64574
  for (const element of operation.newBounds) {
@@ -64610,9 +64636,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
64610
64636
  };
64611
64637
  Object.defineProperty(exports, "__esModule", ({ value: true }));
64612
64638
  exports.GModelChangeRoutingPointsOperationHandler = void 0;
64639
+ const graph_1 = __webpack_require__(/*! @eclipse-glsp/graph */ "../../packages/graph/lib/index.js");
64613
64640
  const protocol_1 = __webpack_require__(/*! @eclipse-glsp/protocol */ "../../node_modules/@eclipse-glsp/protocol/lib/index.js");
64614
64641
  const inversify_1 = __webpack_require__(/*! inversify */ "../../node_modules/inversify/lib/cjs/index.js");
64615
- const glsp_server_error_1 = __webpack_require__(/*! ../utils/glsp-server-error */ "../../packages/server/lib/common/utils/glsp-server-error.js");
64616
64642
  const layout_util_1 = __webpack_require__(/*! ../utils/layout-util */ "../../packages/server/lib/common/utils/layout-util.js");
64617
64643
  const gmodel_operation_handler_1 = __webpack_require__(/*! ./gmodel-operation-handler */ "../../packages/server/lib/common/gmodel/gmodel-operation-handler.js");
64618
64644
  let GModelChangeRoutingPointsOperationHandler = class GModelChangeRoutingPointsOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
@@ -64621,12 +64647,26 @@ let GModelChangeRoutingPointsOperationHandler = class GModelChangeRoutingPointsO
64621
64647
  this.operationType = protocol_1.ChangeRoutingPointsOperation.KIND;
64622
64648
  }
64623
64649
  createCommand(operation) {
64624
- return this.commandOf(() => this.executeChangeRoutingPoints(operation));
64650
+ const newRoutingPoints = operation.newRoutingPoints.filter(newRoutingPoints => this.hasChanged(newRoutingPoints));
64651
+ if (newRoutingPoints.length === 0) {
64652
+ return undefined;
64653
+ }
64654
+ return this.commandOf(() => this.executeChangeRoutingPoints({ ...operation, newRoutingPoints }));
64625
64655
  }
64626
- executeChangeRoutingPoints(operation) {
64627
- if (!operation.newRoutingPoints) {
64628
- throw new glsp_server_error_1.GLSPServerError('Incomplete change routingPoints action');
64656
+ hasChanged(element) {
64657
+ var _a;
64658
+ const knownElement = this.modelState.index.findByClass(element.elementId, graph_1.GEdge);
64659
+ if (!knownElement || knownElement.routingPoints.length !== ((_a = element.newRoutingPoints) === null || _a === void 0 ? void 0 : _a.length)) {
64660
+ return true;
64629
64661
  }
64662
+ for (let i = 0; i < knownElement.routingPoints.length; i++) {
64663
+ if (!protocol_1.Point.equals(knownElement.routingPoints[i], element.newRoutingPoints[i])) {
64664
+ return true;
64665
+ }
64666
+ }
64667
+ return false;
64668
+ }
64669
+ executeChangeRoutingPoints(operation) {
64630
64670
  const index = this.modelState.index;
64631
64671
  operation.newRoutingPoints.forEach(routingPoints => (0, layout_util_1.applyRoutingPoints)(routingPoints, index));
64632
64672
  }
@@ -65764,7 +65804,7 @@ let CompoundOperationHandler = class CompoundOperationHandler extends operation_
65764
65804
  commands.push(command);
65765
65805
  }
65766
65806
  }
65767
- return new command_1.CompoundCommand(commands);
65807
+ return commands.length > 0 ? new command_1.CompoundCommand(commands) : undefined;
65768
65808
  }
65769
65809
  };
65770
65810
  exports.CompoundOperationHandler = CompoundOperationHandler;
@@ -66037,8 +66077,9 @@ let OperationActionHandler = OperationActionHandler_1 = class OperationActionHan
66037
66077
  const command = await handler.execute(operation);
66038
66078
  if (command) {
66039
66079
  await this.executeCommand(command);
66080
+ return this.submitModel();
66040
66081
  }
66041
- return this.modelSubmissionHandler.submitModel('operation');
66082
+ return [];
66042
66083
  }
66043
66084
  async executeCommand(command) {
66044
66085
  return this.commandStack.execute(command);