@eclipse-glsp-examples/workflow-server 0.9.0-next.5ce3b9a.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.
Files changed (162) hide show
  1. package/LICENSE +277 -0
  2. package/lib/app.d.ts +2 -0
  3. package/lib/app.d.ts.map +1 -0
  4. package/lib/app.js +34 -0
  5. package/lib/app.js.map +1 -0
  6. package/lib/graph-extension.d.ts +60 -0
  7. package/lib/graph-extension.d.ts.map +1 -0
  8. package/lib/graph-extension.js +156 -0
  9. package/lib/graph-extension.js.map +1 -0
  10. package/lib/handler/create-activity-node-handler.d.ts +23 -0
  11. package/lib/handler/create-activity-node-handler.d.ts.map +1 -0
  12. package/lib/handler/create-activity-node-handler.js +45 -0
  13. package/lib/handler/create-activity-node-handler.js.map +1 -0
  14. package/lib/handler/create-automated-task-handler.d.ts +9 -0
  15. package/lib/handler/create-automated-task-handler.d.ts.map +1 -0
  16. package/lib/handler/create-automated-task-handler.js +42 -0
  17. package/lib/handler/create-automated-task-handler.js.map +1 -0
  18. package/lib/handler/create-category-handler.d.ts +25 -0
  19. package/lib/handler/create-category-handler.d.ts.map +1 -0
  20. package/lib/handler/create-category-handler.js +41 -0
  21. package/lib/handler/create-category-handler.js.map +1 -0
  22. package/lib/handler/create-decision-node-handler.d.ts +9 -0
  23. package/lib/handler/create-decision-node-handler.d.ts.map +1 -0
  24. package/lib/handler/create-decision-node-handler.js +42 -0
  25. package/lib/handler/create-decision-node-handler.js.map +1 -0
  26. package/lib/handler/create-edge-handler.d.ts +22 -0
  27. package/lib/handler/create-edge-handler.d.ts.map +1 -0
  28. package/lib/handler/create-edge-handler.js +31 -0
  29. package/lib/handler/create-edge-handler.js.map +1 -0
  30. package/lib/handler/create-fork-node-handler.d.ts +6 -0
  31. package/lib/handler/create-fork-node-handler.d.ts.map +1 -0
  32. package/lib/handler/create-fork-node-handler.js +39 -0
  33. package/lib/handler/create-fork-node-handler.js.map +1 -0
  34. package/lib/handler/create-fork-or-join-node-handler.d.ts +22 -0
  35. package/lib/handler/create-fork-or-join-node-handler.d.ts.map +1 -0
  36. package/lib/handler/create-fork-or-join-node-handler.js +21 -0
  37. package/lib/handler/create-fork-or-join-node-handler.js.map +1 -0
  38. package/lib/handler/create-join-node-handler.d.ts +6 -0
  39. package/lib/handler/create-join-node-handler.d.ts.map +1 -0
  40. package/lib/handler/create-join-node-handler.js +39 -0
  41. package/lib/handler/create-join-node-handler.js.map +1 -0
  42. package/lib/handler/create-manual-task-handler.d.ts +9 -0
  43. package/lib/handler/create-manual-task-handler.d.ts.map +1 -0
  44. package/lib/handler/create-manual-task-handler.js +42 -0
  45. package/lib/handler/create-manual-task-handler.js.map +1 -0
  46. package/lib/handler/create-merge-node-handler.d.ts +9 -0
  47. package/lib/handler/create-merge-node-handler.d.ts.map +1 -0
  48. package/lib/handler/create-merge-node-handler.js +42 -0
  49. package/lib/handler/create-merge-node-handler.js.map +1 -0
  50. package/lib/handler/create-task-handler.d.ts +24 -0
  51. package/lib/handler/create-task-handler.d.ts.map +1 -0
  52. package/lib/handler/create-task-handler.js +48 -0
  53. package/lib/handler/create-task-handler.js.map +1 -0
  54. package/lib/handler/create-weighted-edge-handler.d.ts +22 -0
  55. package/lib/handler/create-weighted-edge-handler.d.ts.map +1 -0
  56. package/lib/handler/create-weighted-edge-handler.js +33 -0
  57. package/lib/handler/create-weighted-edge-handler.js.map +1 -0
  58. package/lib/handler/create-workflow-node-operation-handler.d.ts +24 -0
  59. package/lib/handler/create-workflow-node-operation-handler.d.ts.map +1 -0
  60. package/lib/handler/create-workflow-node-operation-handler.js +62 -0
  61. package/lib/handler/create-workflow-node-operation-handler.js.map +1 -0
  62. package/lib/handler/grid-snapper.d.ts +22 -0
  63. package/lib/handler/grid-snapper.d.ts.map +1 -0
  64. package/lib/handler/grid-snapper.js +20 -0
  65. package/lib/handler/grid-snapper.js.map +1 -0
  66. package/lib/index.d.ts +17 -0
  67. package/lib/index.d.ts.map +1 -0
  68. package/lib/index.js +21 -0
  69. package/lib/index.js.map +1 -0
  70. package/lib/labeledit/workflow-label-edit-validator.d.ts +21 -0
  71. package/lib/labeledit/workflow-label-edit-validator.d.ts.map +1 -0
  72. package/lib/labeledit/workflow-label-edit-validator.js +55 -0
  73. package/lib/labeledit/workflow-label-edit-validator.js.map +1 -0
  74. package/lib/marker/workflow-model-validator.d.ts +29 -0
  75. package/lib/marker/workflow-model-validator.d.ts.map +1 -0
  76. package/lib/marker/workflow-model-validator.js +150 -0
  77. package/lib/marker/workflow-model-validator.js.map +1 -0
  78. package/lib/model/workflow-navigation-target-resolver.d.ts +24 -0
  79. package/lib/model/workflow-navigation-target-resolver.d.ts.map +1 -0
  80. package/lib/model/workflow-navigation-target-resolver.js +40 -0
  81. package/lib/model/workflow-navigation-target-resolver.js.map +1 -0
  82. package/lib/provider/abstract-next-or-previous-navigation-target-provider.d.ts +29 -0
  83. package/lib/provider/abstract-next-or-previous-navigation-target-provider.d.ts.map +1 -0
  84. package/lib/provider/abstract-next-or-previous-navigation-target-provider.js +60 -0
  85. package/lib/provider/abstract-next-or-previous-navigation-target-provider.js.map +1 -0
  86. package/lib/provider/next-node-navigation-target-provider.d.ts +24 -0
  87. package/lib/provider/next-node-navigation-target-provider.d.ts.map +1 -0
  88. package/lib/provider/next-node-navigation-target-provider.js +28 -0
  89. package/lib/provider/next-node-navigation-target-provider.js.map +1 -0
  90. package/lib/provider/node-documentation-navigation-target-provider.d.ts +24 -0
  91. package/lib/provider/node-documentation-navigation-target-provider.d.ts.map +1 -0
  92. package/lib/provider/node-documentation-navigation-target-provider.js +50 -0
  93. package/lib/provider/node-documentation-navigation-target-provider.js.map +1 -0
  94. package/lib/provider/previous-node-navigation-target-provider.d.ts +24 -0
  95. package/lib/provider/previous-node-navigation-target-provider.d.ts.map +1 -0
  96. package/lib/provider/previous-node-navigation-target-provider.js +28 -0
  97. package/lib/provider/previous-node-navigation-target-provider.js.map +1 -0
  98. package/lib/provider/workflow-command-palette-action-provider.d.ts +25 -0
  99. package/lib/provider/workflow-command-palette-action-provider.d.ts.map +1 -0
  100. package/lib/provider/workflow-command-palette-action-provider.js +92 -0
  101. package/lib/provider/workflow-command-palette-action-provider.js.map +1 -0
  102. package/lib/provider/workflow-context-menu-item-provider.d.ts +21 -0
  103. package/lib/provider/workflow-context-menu-item-provider.d.ts.map +1 -0
  104. package/lib/provider/workflow-context-menu-item-provider.js +54 -0
  105. package/lib/provider/workflow-context-menu-item-provider.js.map +1 -0
  106. package/lib/util/model-types.d.ts +35 -0
  107. package/lib/util/model-types.d.ts.map +1 -0
  108. package/lib/util/model-types.js +60 -0
  109. package/lib/util/model-types.js.map +1 -0
  110. package/lib/workflow-diagram-configuration.d.ts +28 -0
  111. package/lib/workflow-diagram-configuration.d.ts.map +1 -0
  112. package/lib/workflow-diagram-configuration.js +125 -0
  113. package/lib/workflow-diagram-configuration.js.map +1 -0
  114. package/lib/workflow-diagram-module.d.ts +28 -0
  115. package/lib/workflow-diagram-module.d.ts.map +1 -0
  116. package/lib/workflow-diagram-module.js +100 -0
  117. package/lib/workflow-diagram-module.js.map +1 -0
  118. package/lib/workflow-glsp-server.d.ts +23 -0
  119. package/lib/workflow-glsp-server.d.ts.map +1 -0
  120. package/lib/workflow-glsp-server.js +54 -0
  121. package/lib/workflow-glsp-server.js.map +1 -0
  122. package/lib/workflow-model-index.d.ts +20 -0
  123. package/lib/workflow-model-index.d.ts.map +1 -0
  124. package/lib/workflow-model-index.js +43 -0
  125. package/lib/workflow-model-index.js.map +1 -0
  126. package/lib/workflow-popup-factory.d.ts +21 -0
  127. package/lib/workflow-popup-factory.d.ts.map +1 -0
  128. package/lib/workflow-popup-factory.js +54 -0
  129. package/lib/workflow-popup-factory.js.map +1 -0
  130. package/package.json +63 -0
  131. package/src/app.ts +32 -0
  132. package/src/graph-extension.ts +186 -0
  133. package/src/handler/create-activity-node-handler.ts +34 -0
  134. package/src/handler/create-automated-task-handler.ts +30 -0
  135. package/src/handler/create-category-handler.ts +36 -0
  136. package/src/handler/create-decision-node-handler.ts +30 -0
  137. package/src/handler/create-edge-handler.ts +25 -0
  138. package/src/handler/create-fork-node-handler.ts +24 -0
  139. package/src/handler/create-fork-or-join-node-handler.ts +26 -0
  140. package/src/handler/create-join-node-handler.ts +24 -0
  141. package/src/handler/create-manual-task-handler.ts +30 -0
  142. package/src/handler/create-merge-node-handler.ts +30 -0
  143. package/src/handler/create-task-handler.ts +38 -0
  144. package/src/handler/create-weighted-edge-handler.ts +27 -0
  145. package/src/handler/create-workflow-node-operation-handler.ts +56 -0
  146. package/src/handler/grid-snapper.ts +32 -0
  147. package/src/index.ts +19 -0
  148. package/src/labeledit/workflow-label-edit-validator.ts +39 -0
  149. package/src/marker/workflow-model-validator.ts +137 -0
  150. package/src/model/workflow-navigation-target-resolver.ts +40 -0
  151. package/src/provider/abstract-next-or-previous-navigation-target-provider.ts +53 -0
  152. package/src/provider/next-node-navigation-target-provider.ts +31 -0
  153. package/src/provider/node-documentation-navigation-target-provider.ts +52 -0
  154. package/src/provider/previous-node-navigation-target-provider.ts +31 -0
  155. package/src/provider/workflow-command-palette-action-provider.ts +124 -0
  156. package/src/provider/workflow-context-menu-item-provider.ts +38 -0
  157. package/src/util/model-types.ts +55 -0
  158. package/src/workflow-diagram-configuration.ts +122 -0
  159. package/src/workflow-diagram-module.ts +107 -0
  160. package/src/workflow-glsp-server.ts +37 -0
  161. package/src/workflow-model-index.ts +31 -0
  162. package/src/workflow-popup-factory.ts +46 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-task-handler.js","sourceRoot":"","sources":["../../src/handler/create-task-handler.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qGAA8F;AAC9F,yCAAuC;AACvC,qDAAmE;AAEnE,wDAA+D;AAC/D,qDAAiD;AAGjD,IAAsB,iBAAiB,GAAvC,MAAsB,iBAAkB,SAAQ,2EAAkC;IAC9E,UAAU,CAAC,gBAAmC,EAAE,IAAsB;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC;IACnE,CAAC;IAES,OAAO,CAAC,KAAwB,EAAE,UAAuB;QAC/D,OAAO,0BAAQ,CAAC,OAAO,EAAE;aACpB,QAAQ,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,uBAAY,CAAC;aAC/B,WAAW,CAAC,MAAM,CAAC;aACnB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,0BAAQ,CAAC,CAAC,MAAM,CAAC;aACxF,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;aAC5B,QAAQ,CAAC,wBAAU,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;aACvD,QAAQ,EAAE,CAAC;IACpB,CAAC;CACJ,CAAA;AAdqB,iBAAiB;IADtC,sBAAU,EAAE;GACS,iBAAiB,CActC;AAdqB,8CAAiB"}
@@ -0,0 +1,22 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { CreateEdgeOperationHandler, GEdge, GModelElement, GModelState } from '@eclipse-glsp/server-node';
17
+ export declare class CreateWeightedEdgeHandler extends CreateEdgeOperationHandler {
18
+ elementTypeIds: string[];
19
+ label: string;
20
+ createEdge(source: GModelElement, target: GModelElement, modelState: GModelState): GEdge | undefined;
21
+ }
22
+ //# sourceMappingURL=create-weighted-edge-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-weighted-edge-handler.d.ts","sourceRoot":"","sources":["../../src/handler/create-weighted-edge-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAI1G,qBAAa,yBAA0B,SAAQ,0BAA0B;IACrE,cAAc,WAA8B;IAC5C,KAAK,SAAmB;IAExB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,GAAG,KAAK,GAAG,SAAS;CAGvG"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateWeightedEdgeHandler = void 0;
4
+ /********************************************************************************
5
+ * Copyright (c) 2022 STMicroelectronics and others.
6
+ *
7
+ * This program and the accompanying materials are made available under the
8
+ * terms of the Eclipse Public License v. 2.0 which is available at
9
+ * http://www.eclipse.org/legal/epl-2.0.
10
+ *
11
+ * This Source Code may also be made available under the following Secondary
12
+ * Licenses when the conditions for such availability set forth in the Eclipse
13
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
+ * with the GNU Classpath Exception which is available at
15
+ * https://www.gnu.org/software/classpath/license.html.
16
+ *
17
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
+ ********************************************************************************/
19
+ const server_node_1 = require("@eclipse-glsp/server-node");
20
+ const graph_extension_1 = require("../graph-extension");
21
+ const model_types_1 = require("../util/model-types");
22
+ class CreateWeightedEdgeHandler extends server_node_1.CreateEdgeOperationHandler {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.elementTypeIds = [model_types_1.ModelTypes.WEIGHTED_EDGE];
26
+ this.label = 'Weighted edge';
27
+ }
28
+ createEdge(source, target, modelState) {
29
+ return graph_extension_1.WeightedEdge.builder().sourceId(source.id).targetId(target.id).probability('medium').addCssClass('medium').build();
30
+ }
31
+ }
32
+ exports.CreateWeightedEdgeHandler = CreateWeightedEdgeHandler;
33
+ //# sourceMappingURL=create-weighted-edge-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-weighted-edge-handler.js","sourceRoot":"","sources":["../../src/handler/create-weighted-edge-handler.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAA0G;AAC1G,wDAAkD;AAClD,qDAAiD;AAEjD,MAAa,yBAA0B,SAAQ,wCAA0B;IAAzE;;QACI,mBAAc,GAAG,CAAC,wBAAU,CAAC,aAAa,CAAC,CAAC;QAC5C,UAAK,GAAG,eAAe,CAAC;IAK5B,CAAC;IAHG,UAAU,CAAC,MAAqB,EAAE,MAAqB,EAAE,UAAuB;QAC5E,OAAO,8BAAY,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;IAC9H,CAAC;CACJ;AAPD,8DAOC"}
@@ -0,0 +1,24 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { CreateNodeOperation, CreateNodeOperationHandler, GCompartment, GModelElement, GModelState, Point } from '@eclipse-glsp/server-node';
17
+ import { Category } from '../graph-extension';
18
+ export declare abstract class CreateWorkflowNodeOperationHandler extends CreateNodeOperationHandler {
19
+ protected modelState: GModelState;
20
+ getLocation(operation: CreateNodeOperation): Point | undefined;
21
+ getContainer(operation: CreateNodeOperation): GModelElement | undefined;
22
+ getCategoryCompartment(category: Category): GCompartment | undefined;
23
+ }
24
+ //# sourceMappingURL=create-workflow-node-operation-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-workflow-node-operation-handler.d.ts","sourceRoot":"","sources":["../../src/handler/create-workflow-node-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,aAAa,EACb,WAAW,EACX,KAAK,EACR,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C,8BACsB,kCAAmC,SAAQ,0BAA0B;IAEvF,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;IAElC,WAAW,CAAC,SAAS,EAAE,mBAAmB,GAAG,KAAK,GAAG,SAAS;IAI9D,YAAY,CAAC,SAAS,EAAE,mBAAmB,GAAG,aAAa,GAAG,SAAS;IAYvE,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS;CAMvE"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateWorkflowNodeOperationHandler = void 0;
13
+ /********************************************************************************
14
+ * Copyright (c) 2022 STMicroelectronics and others.
15
+ *
16
+ * This program and the accompanying materials are made available under the
17
+ * terms of the Eclipse Public License v. 2.0 which is available at
18
+ * http://www.eclipse.org/legal/epl-2.0.
19
+ *
20
+ * This Source Code may also be made available under the following Secondary
21
+ * Licenses when the conditions for such availability set forth in the Eclipse
22
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
+ * with the GNU Classpath Exception which is available at
24
+ * https://www.gnu.org/software/classpath/license.html.
25
+ *
26
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
27
+ ********************************************************************************/
28
+ const server_node_1 = require("@eclipse-glsp/server-node");
29
+ const inversify_1 = require("inversify");
30
+ const graph_extension_1 = require("../graph-extension");
31
+ const model_types_1 = require("../util/model-types");
32
+ const grid_snapper_1 = require("./grid-snapper");
33
+ let CreateWorkflowNodeOperationHandler = class CreateWorkflowNodeOperationHandler extends server_node_1.CreateNodeOperationHandler {
34
+ getLocation(operation) {
35
+ return grid_snapper_1.GridSnapper.snap(operation.location);
36
+ }
37
+ getContainer(operation) {
38
+ const container = super.getContainer(operation);
39
+ if (container instanceof graph_extension_1.Category) {
40
+ const structComp = this.getCategoryCompartment(container);
41
+ if (structComp) {
42
+ return structComp;
43
+ }
44
+ }
45
+ return container;
46
+ }
47
+ getCategoryCompartment(category) {
48
+ return category.children
49
+ .filter(child => child instanceof server_node_1.GCompartment)
50
+ .map(child => child)
51
+ .find(comp => model_types_1.ModelTypes.STRUCTURE === comp.type);
52
+ }
53
+ };
54
+ __decorate([
55
+ inversify_1.inject(server_node_1.GModelState),
56
+ __metadata("design:type", server_node_1.GModelState)
57
+ ], CreateWorkflowNodeOperationHandler.prototype, "modelState", void 0);
58
+ CreateWorkflowNodeOperationHandler = __decorate([
59
+ inversify_1.injectable()
60
+ ], CreateWorkflowNodeOperationHandler);
61
+ exports.CreateWorkflowNodeOperationHandler = CreateWorkflowNodeOperationHandler;
62
+ //# sourceMappingURL=create-workflow-node-operation-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-workflow-node-operation-handler.js","sourceRoot":"","sources":["../../src/handler/create-workflow-node-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAOmC;AACnC,yCAA+C;AAC/C,wDAA8C;AAC9C,qDAAiD;AACjD,iDAA6C;AAG7C,IAAsB,kCAAkC,GAAxD,MAAsB,kCAAmC,SAAQ,wCAA0B;IAIvF,WAAW,CAAC,SAA8B;QACtC,OAAO,0BAAW,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,YAAY,CAAC,SAA8B;QACvC,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,SAAS,YAAY,0BAAQ,EAAE;YAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;YAC1D,IAAI,UAAU,EAAE;gBACZ,OAAO,UAAU,CAAC;aACrB;SACJ;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,sBAAsB,CAAC,QAAkB;QACrC,OAAO,QAAQ,CAAC,QAAQ;aACnB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,YAAY,0BAAY,CAAC;aAC9C,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAqB,CAAC;aACnC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,wBAAU,CAAC,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;CACJ,CAAA;AAxBG;IADC,kBAAM,CAAC,yBAAW,CAAC;8BACE,yBAAW;sEAAC;AAFhB,kCAAkC;IADvD,sBAAU,EAAE;GACS,kCAAkC,CA0BvD;AA1BqB,gFAAkC"}
@@ -0,0 +1,22 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { Point } from '@eclipse-glsp/server-node';
17
+ export declare class GridSnapper {
18
+ static GRID_X: number;
19
+ static GRID_Y: number;
20
+ static snap(originalPoint: Point | undefined): Point | undefined;
21
+ }
22
+ //# sourceMappingURL=grid-snapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-snapper.d.ts","sourceRoot":"","sources":["../../src/handler/grid-snapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,qBAAa,WAAW;IACpB,OAAc,MAAM,SAAQ;IAC5B,OAAc,MAAM,SAAQ;WAEd,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS;CAU1E"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridSnapper = void 0;
4
+ class GridSnapper {
5
+ static snap(originalPoint) {
6
+ if (originalPoint) {
7
+ return {
8
+ x: Math.round(originalPoint.x / this.GRID_X) * this.GRID_X,
9
+ y: Math.round(originalPoint.y / this.GRID_Y) * this.GRID_Y
10
+ };
11
+ }
12
+ else {
13
+ return undefined;
14
+ }
15
+ }
16
+ }
17
+ exports.GridSnapper = GridSnapper;
18
+ GridSnapper.GRID_X = 10.0;
19
+ GridSnapper.GRID_Y = 10.0;
20
+ //# sourceMappingURL=grid-snapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-snapper.js","sourceRoot":"","sources":["../../src/handler/grid-snapper.ts"],"names":[],"mappings":";;;AAiBA,MAAa,WAAW;IAIb,MAAM,CAAC,IAAI,CAAC,aAAgC;QAC/C,IAAI,aAAa,EAAE;YACf,OAAO;gBACH,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM;gBAC1D,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM;aAC7D,CAAC;SACL;aAAM;YACH,OAAO,SAAS,CAAC;SACpB;IACL,CAAC;;AAbL,kCAcC;AAbiB,kBAAM,GAAG,IAAI,CAAC;AACd,kBAAM,GAAG,IAAI,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import 'reflect-metadata';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,kBAAkB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /********************************************************************************
4
+ * Copyright (c) 2022 STMicroelectronics and others.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Public License v. 2.0 which is available at
8
+ * http://www.eclipse.org/legal/epl-2.0.
9
+ *
10
+ * This Source Code may also be made available under the following Secondary
11
+ * Licenses when the conditions for such availability set forth in the Eclipse
12
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
13
+ * with the GNU Classpath Exception which is available at
14
+ * https://www.gnu.org/software/classpath/license.html.
15
+ *
16
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17
+ ********************************************************************************/
18
+ require("reflect-metadata");
19
+ const app_1 = require("./app");
20
+ app_1.launch();
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4BAA0B;AAC1B,+BAA+B;AAE/B,YAAM,EAAE,CAAC"}
@@ -0,0 +1,21 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { GModelElement, GModelState, LabelEditValidator, ValidationStatus } from '@eclipse-glsp/server-node';
17
+ export declare class WorkflowLabelEditValidator implements LabelEditValidator {
18
+ protected modelState: GModelState;
19
+ validate(label: string, element: GModelElement): ValidationStatus;
20
+ }
21
+ //# sourceMappingURL=workflow-label-edit-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-label-edit-validator.d.ts","sourceRoot":"","sources":["../../src/labeledit/workflow-label-edit-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAI7G,qBACa,0BAA2B,YAAW,kBAAkB;IAEjE,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;IAElC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,gBAAgB;CAcpE"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WorkflowLabelEditValidator = void 0;
13
+ /********************************************************************************
14
+ * Copyright (c) 2022 STMicroelectronics and others.
15
+ *
16
+ * This program and the accompanying materials are made available under the
17
+ * terms of the Eclipse Public License v. 2.0 which is available at
18
+ * http://www.eclipse.org/legal/epl-2.0.
19
+ *
20
+ * This Source Code may also be made available under the following Secondary
21
+ * Licenses when the conditions for such availability set forth in the Eclipse
22
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
+ * with the GNU Classpath Exception which is available at
24
+ * https://www.gnu.org/software/classpath/license.html.
25
+ *
26
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
27
+ ********************************************************************************/
28
+ const server_node_1 = require("@eclipse-glsp/server-node");
29
+ const inversify_1 = require("inversify");
30
+ const graph_extension_1 = require("../graph-extension");
31
+ let WorkflowLabelEditValidator = class WorkflowLabelEditValidator {
32
+ validate(label, element) {
33
+ if (label.length < 1) {
34
+ return { severity: server_node_1.ValidationStatus.Severity.ERROR, message: 'Name must not be empty' };
35
+ }
36
+ const taskNodes = this.modelState.index.getAllByClass(graph_extension_1.TaskNode);
37
+ const hasDuplicate = taskNodes
38
+ .filter(e => !(e.id === element.id))
39
+ .map(task => task.name)
40
+ .some(name => name === label);
41
+ if (hasDuplicate) {
42
+ return { severity: server_node_1.ValidationStatus.Severity.WARNING, message: 'Name should be unique' };
43
+ }
44
+ return { severity: server_node_1.ValidationStatus.Severity.OK };
45
+ }
46
+ };
47
+ __decorate([
48
+ inversify_1.inject(server_node_1.GModelState),
49
+ __metadata("design:type", server_node_1.GModelState)
50
+ ], WorkflowLabelEditValidator.prototype, "modelState", void 0);
51
+ WorkflowLabelEditValidator = __decorate([
52
+ inversify_1.injectable()
53
+ ], WorkflowLabelEditValidator);
54
+ exports.WorkflowLabelEditValidator = WorkflowLabelEditValidator;
55
+ //# sourceMappingURL=workflow-label-edit-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-label-edit-validator.js","sourceRoot":"","sources":["../../src/labeledit/workflow-label-edit-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAA6G;AAC7G,yCAA+C;AAC/C,wDAA8C;AAG9C,IAAa,0BAA0B,GAAvC,MAAa,0BAA0B;IAInC,QAAQ,CAAC,KAAa,EAAE,OAAsB;QAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YAClB,OAAO,EAAE,QAAQ,EAAE,8BAAgB,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;SAC3F;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAW,0BAAQ,CAAC,CAAC;QAC1E,MAAM,YAAY,GAAG,SAAS;aACzB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC;aACnC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;aACtB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;QAClC,IAAI,YAAY,EAAE;YACd,OAAO,EAAE,QAAQ,EAAE,8BAAgB,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;SAC5F;QACD,OAAO,EAAE,QAAQ,EAAE,8BAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;IACtD,CAAC;CACJ,CAAA;AAhBG;IADC,kBAAM,CAAC,yBAAW,CAAC;8BACE,yBAAW;8DAAC;AAFzB,0BAA0B;IADtC,sBAAU,EAAE;GACA,0BAA0B,CAkBtC;AAlBY,gEAA0B"}
@@ -0,0 +1,29 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { GModelElement, Marker, ModelValidator, GModelState } from '@eclipse-glsp/server-node';
17
+ import { ActivityNode, TaskNode } from '../graph-extension';
18
+ export declare class WorkflowModelValidator implements ModelValidator {
19
+ protected readonly modelState: GModelState;
20
+ validate(elements: GModelElement[]): Marker[];
21
+ protected validateTaskNode(taskNode: TaskNode): Marker[];
22
+ protected validateTaskNode_isAutomated(taskNode: TaskNode): Marker | undefined;
23
+ protected validateTaskNode_labelStartsUpperCase(taskNode: TaskNode): Marker | undefined;
24
+ protected validateDecisionNode(decisionNode: ActivityNode): Marker[];
25
+ protected validateDecisionNode_hasOneIncomingEdge(decisionNode: ActivityNode): Marker | undefined;
26
+ protected validateMergeNode(mergeNode: ActivityNode): Marker[];
27
+ protected validateMergeNode_hasOneOutgoingEdge(mergeNode: ActivityNode): Marker | undefined;
28
+ }
29
+ //# sourceMappingURL=workflow-model-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-model-validator.d.ts","sourceRoot":"","sources":["../../src/marker/workflow-model-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAoC,MAAM,2BAA2B,CAAC;AAEjI,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE5D,qBACa,sBAAuB,YAAW,cAAc;IAEzD,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IAE3C,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE;IAmB7C,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE;IAaxD,SAAS,CAAC,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS;IAO9E,SAAS,CAAC,qCAAqC,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS;IAgBvF,SAAS,CAAC,oBAAoB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,EAAE;IASpE,SAAS,CAAC,uCAAuC,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS;IAoBjG,SAAS,CAAC,iBAAiB,CAAC,SAAS,EAAE,YAAY,GAAG,MAAM,EAAE;IAS9D,SAAS,CAAC,oCAAoC,CAAC,SAAS,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS;CAmB9F"}
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WorkflowModelValidator = void 0;
13
+ /********************************************************************************
14
+ * Copyright (c) 2022 STMicroelectronics and others.
15
+ *
16
+ * This program and the accompanying materials are made available under the
17
+ * terms of the Eclipse Public License v. 2.0 which is available at
18
+ * http://www.eclipse.org/legal/epl-2.0.
19
+ *
20
+ * This Source Code may also be made available under the following Secondary
21
+ * Licenses when the conditions for such availability set forth in the Eclipse
22
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
+ * with the GNU Classpath Exception which is available at
24
+ * https://www.gnu.org/software/classpath/license.html.
25
+ *
26
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
27
+ ********************************************************************************/
28
+ const server_node_1 = require("@eclipse-glsp/server-node");
29
+ const inversify_1 = require("inversify");
30
+ const graph_extension_1 = require("../graph-extension");
31
+ let WorkflowModelValidator = class WorkflowModelValidator {
32
+ validate(elements) {
33
+ const markers = [];
34
+ for (const element of elements) {
35
+ if (element instanceof graph_extension_1.TaskNode) {
36
+ markers.push(...this.validateTaskNode(element));
37
+ }
38
+ else if (element instanceof graph_extension_1.ActivityNode) {
39
+ if (element.nodeType === 'decisionNode') {
40
+ markers.push(...this.validateDecisionNode(element));
41
+ }
42
+ else if (element.nodeType === 'mergeNode') {
43
+ markers.push(...this.validateMergeNode(element));
44
+ }
45
+ }
46
+ if (element.children) {
47
+ markers.push(...this.validate(element.children));
48
+ }
49
+ }
50
+ return markers;
51
+ }
52
+ validateTaskNode(taskNode) {
53
+ const markers = [];
54
+ const automated = this.validateTaskNode_isAutomated(taskNode);
55
+ if (automated) {
56
+ markers.push(automated);
57
+ }
58
+ const upperCase = this.validateTaskNode_labelStartsUpperCase(taskNode);
59
+ if (upperCase) {
60
+ markers.push(upperCase);
61
+ }
62
+ return markers;
63
+ }
64
+ validateTaskNode_isAutomated(taskNode) {
65
+ if (taskNode.taskType === 'automated') {
66
+ return { kind: server_node_1.MarkerKind.INFO, description: 'This is an automated task', elementId: taskNode.id, label: 'Automated task' };
67
+ }
68
+ return undefined;
69
+ }
70
+ validateTaskNode_labelStartsUpperCase(taskNode) {
71
+ const gCompartment = taskNode.children.find(child => child instanceof server_node_1.GCompartment);
72
+ if (gCompartment) {
73
+ const gLabels = gCompartment.children.filter(child => child instanceof server_node_1.GLabel).map(element => element);
74
+ if (gLabels.length > 0 && gLabels[0].text.charAt(0) === gLabels[0].text.charAt(0).toLowerCase()) {
75
+ return {
76
+ kind: server_node_1.MarkerKind.WARNING,
77
+ description: 'Task node names should start with upper case letters',
78
+ elementId: taskNode.id,
79
+ label: 'Task node label in upper case'
80
+ };
81
+ }
82
+ }
83
+ return undefined;
84
+ }
85
+ validateDecisionNode(decisionNode) {
86
+ const markers = [];
87
+ const oneIncoming = this.validateDecisionNode_hasOneIncomingEdge(decisionNode);
88
+ if (oneIncoming) {
89
+ markers.push(oneIncoming);
90
+ }
91
+ return markers;
92
+ }
93
+ validateDecisionNode_hasOneIncomingEdge(decisionNode) {
94
+ const edges = this.modelState.index.getIncomingEdges(decisionNode);
95
+ if (edges.length > 1) {
96
+ return {
97
+ kind: server_node_1.MarkerKind.ERROR,
98
+ description: 'Decision node may only have one incoming edge.',
99
+ elementId: decisionNode.id,
100
+ label: 'Too many incoming edges'
101
+ };
102
+ }
103
+ else if (edges.length === 0) {
104
+ return {
105
+ kind: server_node_1.MarkerKind.ERROR,
106
+ description: 'Decision node must have one incoming edge.',
107
+ elementId: decisionNode.id,
108
+ label: 'Missing incoming edge'
109
+ };
110
+ }
111
+ return undefined;
112
+ }
113
+ validateMergeNode(mergeNode) {
114
+ const markers = [];
115
+ const oneOutgoing = this.validateMergeNode_hasOneOutgoingEdge(mergeNode);
116
+ if (oneOutgoing) {
117
+ markers.push(oneOutgoing);
118
+ }
119
+ return markers;
120
+ }
121
+ validateMergeNode_hasOneOutgoingEdge(mergeNode) {
122
+ const edges = this.modelState.index.getOutgoingEdges(mergeNode);
123
+ if (edges.length > 1) {
124
+ return {
125
+ kind: server_node_1.MarkerKind.ERROR,
126
+ description: 'Merge node may only have one outgoing edge.',
127
+ elementId: mergeNode.id,
128
+ label: 'Too many outgoing edges'
129
+ };
130
+ }
131
+ else if (edges.length === 0) {
132
+ return {
133
+ kind: server_node_1.MarkerKind.ERROR,
134
+ description: 'Merge node must have one outgoing edge.',
135
+ elementId: mergeNode.id,
136
+ label: 'Missing outgoing edge'
137
+ };
138
+ }
139
+ return undefined;
140
+ }
141
+ };
142
+ __decorate([
143
+ inversify_1.inject(server_node_1.GModelState),
144
+ __metadata("design:type", server_node_1.GModelState)
145
+ ], WorkflowModelValidator.prototype, "modelState", void 0);
146
+ WorkflowModelValidator = __decorate([
147
+ inversify_1.injectable()
148
+ ], WorkflowModelValidator);
149
+ exports.WorkflowModelValidator = WorkflowModelValidator;
150
+ //# sourceMappingURL=workflow-model-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-model-validator.js","sourceRoot":"","sources":["../../src/marker/workflow-model-validator.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,24 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { NavigationTarget } from '@eclipse-glsp/protocol';
17
+ import { GModelState } from '@eclipse-glsp/server-node';
18
+ import { NavigationTargetResolution } from '@eclipse-glsp/server-node/lib/features/navigation/navigation-target-resolution';
19
+ import { NavigationTargetResolver } from '@eclipse-glsp/server-node/lib/features/navigation/navigation-target-resolver';
20
+ export declare class WorkflowNavigationTargetResolver extends NavigationTargetResolver {
21
+ protected readonly modelState: GModelState;
22
+ resolve(navigationTarget: NavigationTarget): Promise<NavigationTargetResolution>;
23
+ }
24
+ //# sourceMappingURL=workflow-navigation-target-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-navigation-target-resolver.d.ts","sourceRoot":"","sources":["../../src/model/workflow-navigation-target-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gFAAgF,CAAC;AAC5H,OAAO,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AAIxH,qBACa,gCAAiC,SAAQ,wBAAwB;IAE1E,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IAErC,OAAO,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAYzF"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WorkflowNavigationTargetResolver = void 0;
13
+ const server_node_1 = require("@eclipse-glsp/server-node");
14
+ const navigation_target_resolution_1 = require("@eclipse-glsp/server-node/lib/features/navigation/navigation-target-resolution");
15
+ const navigation_target_resolver_1 = require("@eclipse-glsp/server-node/lib/features/navigation/navigation-target-resolver");
16
+ const inversify_1 = require("inversify");
17
+ const graph_extension_1 = require("../graph-extension");
18
+ let WorkflowNavigationTargetResolver = class WorkflowNavigationTargetResolver extends navigation_target_resolver_1.NavigationTargetResolver {
19
+ async resolve(navigationTarget) {
20
+ if (navigationTarget.args && navigationTarget.args['name']) {
21
+ const name = navigationTarget.args['name'];
22
+ const taskNodes = this.modelState.index.getAllByClass(graph_extension_1.TaskNode);
23
+ const element = taskNodes.find(node => name === node.name);
24
+ if (element) {
25
+ return new navigation_target_resolution_1.NavigationTargetResolution([element.id]);
26
+ }
27
+ return new navigation_target_resolution_1.NavigationTargetResolution([], this.createArgsWithWarning(`Couldn't find element with name ${name}`));
28
+ }
29
+ return navigation_target_resolution_1.NavigationTargetResolution.EMPTY;
30
+ }
31
+ };
32
+ __decorate([
33
+ inversify_1.inject(server_node_1.GModelState),
34
+ __metadata("design:type", server_node_1.GModelState)
35
+ ], WorkflowNavigationTargetResolver.prototype, "modelState", void 0);
36
+ WorkflowNavigationTargetResolver = __decorate([
37
+ inversify_1.injectable()
38
+ ], WorkflowNavigationTargetResolver);
39
+ exports.WorkflowNavigationTargetResolver = WorkflowNavigationTargetResolver;
40
+ //# sourceMappingURL=workflow-navigation-target-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-navigation-target-resolver.js","sourceRoot":"","sources":["../../src/model/workflow-navigation-target-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,2DAAwD;AACxD,iIAA4H;AAC5H,6HAAwH;AACxH,yCAA+C;AAC/C,wDAA8C;AAG9C,IAAa,gCAAgC,GAA7C,MAAa,gCAAiC,SAAQ,qDAAwB;IAI1E,KAAK,CAAC,OAAO,CAAC,gBAAkC;QAC5C,IAAI,gBAAgB,CAAC,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACxD,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAW,0BAAQ,CAAC,CAAC;YAC1E,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3D,IAAI,OAAO,EAAE;gBACT,OAAO,IAAI,yDAA0B,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;aACvD;YACD,OAAO,IAAI,yDAA0B,CAAC,EAAE,EAAE,IAAI,CAAC,qBAAqB,CAAC,mCAAmC,IAAI,EAAE,CAAC,CAAC,CAAC;SACpH;QACD,OAAO,yDAA0B,CAAC,KAAK,CAAC;IAC5C,CAAC;CACJ,CAAA;AAdG;IADC,kBAAM,CAAC,yBAAW,CAAC;8BACW,yBAAW;oEAAC;AAFlC,gCAAgC;IAD5C,sBAAU,EAAE;GACA,gCAAgC,CAgB5C;AAhBY,4EAAgC"}