@eclipse-glsp-examples/workflow-server 1.1.0-next.e0d359d.30 → 1.1.0-next.e49c816.56

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 (273) hide show
  1. package/README.md +18 -0
  2. package/{lib/index.js → browser.d.ts} +2 -7
  3. package/{src/index.ts → browser.js} +3 -4
  4. package/lib/browser/app.d.ts +18 -0
  5. package/lib/browser/app.d.ts.map +1 -0
  6. package/lib/{app.js → browser/app.js} +12 -12
  7. package/lib/browser/app.js.map +1 -0
  8. package/lib/browser/example1.json +730 -0
  9. package/lib/browser/index.d.ts +18 -0
  10. package/lib/browser/index.d.ts.map +1 -0
  11. package/lib/browser/index.js +34 -0
  12. package/lib/browser/index.js.map +1 -0
  13. package/lib/browser/mock-model-storage.d.ts +24 -0
  14. package/lib/browser/mock-model-storage.d.ts.map +1 -0
  15. package/lib/browser/mock-model-storage.js +58 -0
  16. package/lib/browser/mock-model-storage.js.map +1 -0
  17. package/lib/{graph-extension.d.ts → common/graph-extension.d.ts} +2 -2
  18. package/lib/common/graph-extension.d.ts.map +1 -0
  19. package/lib/{graph-extension.js → common/graph-extension.js} +14 -14
  20. package/lib/common/graph-extension.js.map +1 -0
  21. package/lib/{handler → common/handler}/create-activity-node-handler.d.ts +2 -2
  22. package/lib/common/handler/create-activity-node-handler.d.ts.map +1 -0
  23. package/lib/{handler → common/handler}/create-activity-node-handler.js +5 -6
  24. package/lib/common/handler/create-activity-node-handler.js.map +1 -0
  25. package/lib/{handler → common/handler}/create-automated-task-handler.d.ts +2 -2
  26. package/lib/common/handler/create-automated-task-handler.d.ts.map +1 -0
  27. package/lib/{handler → common/handler}/create-automated-task-handler.js +2 -3
  28. package/lib/common/handler/create-automated-task-handler.js.map +1 -0
  29. package/lib/{handler → common/handler}/create-category-handler.d.ts +2 -2
  30. package/lib/common/handler/create-category-handler.d.ts.map +1 -0
  31. package/lib/{handler → common/handler}/create-category-handler.js +4 -4
  32. package/lib/common/handler/create-category-handler.js.map +1 -0
  33. package/lib/{handler → common/handler}/create-decision-node-handler.d.ts +2 -2
  34. package/lib/common/handler/create-decision-node-handler.d.ts.map +1 -0
  35. package/lib/{handler → common/handler}/create-decision-node-handler.js +2 -3
  36. package/lib/common/handler/create-decision-node-handler.js.map +1 -0
  37. package/lib/{handler → common/handler}/create-edge-handler.d.ts +2 -2
  38. package/lib/common/handler/create-edge-handler.d.ts.map +1 -0
  39. package/lib/{handler → common/handler}/create-edge-handler.js +5 -5
  40. package/lib/common/handler/create-edge-handler.js.map +1 -0
  41. package/lib/common/handler/create-fork-node-handler.d.ts.map +1 -0
  42. package/lib/{handler → common/handler}/create-fork-node-handler.js +3 -4
  43. package/lib/common/handler/create-fork-node-handler.js.map +1 -0
  44. package/lib/{handler → common/handler}/create-fork-or-join-node-handler.d.ts +2 -2
  45. package/lib/common/handler/create-fork-or-join-node-handler.d.ts.map +1 -0
  46. package/lib/{handler → common/handler}/create-fork-or-join-node-handler.js +2 -3
  47. package/lib/common/handler/create-fork-or-join-node-handler.js.map +1 -0
  48. package/lib/common/handler/create-join-node-handler.d.ts.map +1 -0
  49. package/lib/{handler → common/handler}/create-join-node-handler.js +3 -4
  50. package/lib/common/handler/create-join-node-handler.js.map +1 -0
  51. package/lib/{handler → common/handler}/create-manual-task-handler.d.ts +2 -2
  52. package/lib/common/handler/create-manual-task-handler.d.ts.map +1 -0
  53. package/lib/{handler → common/handler}/create-manual-task-handler.js +2 -3
  54. package/lib/common/handler/create-manual-task-handler.js.map +1 -0
  55. package/lib/{handler → common/handler}/create-merge-node-handler.d.ts +2 -2
  56. package/lib/common/handler/create-merge-node-handler.d.ts.map +1 -0
  57. package/lib/{handler → common/handler}/create-merge-node-handler.js +2 -3
  58. package/lib/common/handler/create-merge-node-handler.js.map +1 -0
  59. package/lib/{handler → common/handler}/create-task-handler.d.ts +2 -2
  60. package/lib/common/handler/create-task-handler.d.ts.map +1 -0
  61. package/lib/{handler → common/handler}/create-task-handler.js +3 -5
  62. package/lib/common/handler/create-task-handler.js.map +1 -0
  63. package/lib/{handler → common/handler}/create-weighted-edge-handler.d.ts +2 -2
  64. package/lib/common/handler/create-weighted-edge-handler.d.ts.map +1 -0
  65. package/lib/{handler → common/handler}/create-weighted-edge-handler.js +3 -3
  66. package/lib/common/handler/create-weighted-edge-handler.js.map +1 -0
  67. package/lib/{handler → common/handler}/create-workflow-node-operation-handler.d.ts +2 -2
  68. package/lib/common/handler/create-workflow-node-operation-handler.d.ts.map +1 -0
  69. package/lib/{handler → common/handler}/create-workflow-node-operation-handler.js +6 -7
  70. package/lib/common/handler/create-workflow-node-operation-handler.js.map +1 -0
  71. package/lib/{handler → common/handler}/grid-snapper.d.ts +2 -2
  72. package/lib/common/handler/grid-snapper.d.ts.map +1 -0
  73. package/lib/common/handler/grid-snapper.js.map +1 -0
  74. package/lib/common/index.d.ts +50 -0
  75. package/lib/common/index.d.ts.map +1 -0
  76. package/lib/common/index.js +66 -0
  77. package/lib/common/index.js.map +1 -0
  78. package/lib/{labeledit → common/labeledit}/workflow-label-edit-validator.d.ts +2 -2
  79. package/lib/common/labeledit/workflow-label-edit-validator.d.ts.map +1 -0
  80. package/lib/{labeledit → common/labeledit}/workflow-label-edit-validator.js +8 -9
  81. package/lib/common/labeledit/workflow-label-edit-validator.js.map +1 -0
  82. package/lib/{layout → common/layout}/workflow-layout-configurator.d.ts +2 -2
  83. package/lib/common/layout/workflow-layout-configurator.d.ts.map +1 -0
  84. package/lib/{layout → common/layout}/workflow-layout-configurator.js +3 -4
  85. package/lib/common/layout/workflow-layout-configurator.js.map +1 -0
  86. package/lib/{marker → common/marker}/workflow-model-validator.d.ts +2 -2
  87. package/lib/common/marker/workflow-model-validator.d.ts.map +1 -0
  88. package/lib/{marker → common/marker}/workflow-model-validator.js +13 -14
  89. package/lib/common/marker/workflow-model-validator.js.map +1 -0
  90. package/lib/{model → common/model}/workflow-navigation-target-resolver.d.ts +2 -4
  91. package/lib/common/model/workflow-navigation-target-resolver.d.ts.map +1 -0
  92. package/lib/{model → common/model}/workflow-navigation-target-resolver.js +7 -10
  93. package/lib/common/model/workflow-navigation-target-resolver.js.map +1 -0
  94. package/lib/{provider → common/provider}/abstract-next-or-previous-navigation-target-provider.d.ts +2 -3
  95. package/lib/common/provider/abstract-next-or-previous-navigation-target-provider.d.ts.map +1 -0
  96. package/lib/{provider → common/provider}/abstract-next-or-previous-navigation-target-provider.js +5 -6
  97. package/lib/common/provider/abstract-next-or-previous-navigation-target-provider.js.map +1 -0
  98. package/lib/{provider → common/provider}/next-node-navigation-target-provider.d.ts +1 -1
  99. package/lib/common/provider/next-node-navigation-target-provider.d.ts.map +1 -0
  100. package/lib/{provider → common/provider}/next-node-navigation-target-provider.js +2 -3
  101. package/lib/common/provider/next-node-navigation-target-provider.js.map +1 -0
  102. package/lib/{provider → common/provider}/node-documentation-navigation-target-provider.d.ts +2 -3
  103. package/lib/common/provider/node-documentation-navigation-target-provider.d.ts.map +1 -0
  104. package/lib/{provider → common/provider}/node-documentation-navigation-target-provider.js +5 -7
  105. package/lib/common/provider/node-documentation-navigation-target-provider.js.map +1 -0
  106. package/lib/{provider → common/provider}/previous-node-navigation-target-provider.d.ts +1 -1
  107. package/lib/common/provider/previous-node-navigation-target-provider.d.ts.map +1 -0
  108. package/lib/{provider → common/provider}/previous-node-navigation-target-provider.js +2 -3
  109. package/lib/common/provider/previous-node-navigation-target-provider.js.map +1 -0
  110. package/lib/{provider → common/provider}/workflow-command-palette-action-provider.d.ts +2 -2
  111. package/lib/common/provider/workflow-command-palette-action-provider.d.ts.map +1 -0
  112. package/lib/{provider → common/provider}/workflow-command-palette-action-provider.js +15 -16
  113. package/lib/common/provider/workflow-command-palette-action-provider.js.map +1 -0
  114. package/lib/{provider → common/provider}/workflow-context-menu-item-provider.d.ts +2 -2
  115. package/lib/common/provider/workflow-context-menu-item-provider.d.ts.map +1 -0
  116. package/lib/{provider → common/provider}/workflow-context-menu-item-provider.js +7 -8
  117. package/lib/common/provider/workflow-context-menu-item-provider.js.map +1 -0
  118. package/lib/common/taskedit/edit-task-operation-handler.d.ts +53 -0
  119. package/lib/common/taskedit/edit-task-operation-handler.d.ts.map +1 -0
  120. package/lib/common/taskedit/edit-task-operation-handler.js +96 -0
  121. package/lib/common/taskedit/edit-task-operation-handler.js.map +1 -0
  122. package/lib/common/taskedit/task-edit-context-provider.d.ts +25 -0
  123. package/lib/common/taskedit/task-edit-context-provider.d.ts.map +1 -0
  124. package/lib/common/taskedit/task-edit-context-provider.js +76 -0
  125. package/lib/common/taskedit/task-edit-context-provider.js.map +1 -0
  126. package/lib/common/taskedit/task-edit-validator.d.ts +21 -0
  127. package/lib/common/taskedit/task-edit-validator.d.ts.map +1 -0
  128. package/lib/common/taskedit/task-edit-validator.js +59 -0
  129. package/lib/common/taskedit/task-edit-validator.js.map +1 -0
  130. package/lib/{util → common/util}/model-types.d.ts +1 -1
  131. package/lib/common/util/model-types.d.ts.map +1 -0
  132. package/lib/{util → common/util}/model-types.js +2 -2
  133. package/lib/common/util/model-types.js.map +1 -0
  134. package/lib/{workflow-diagram-configuration.d.ts → common/workflow-diagram-configuration.d.ts} +2 -2
  135. package/lib/common/workflow-diagram-configuration.d.ts.map +1 -0
  136. package/lib/{workflow-diagram-configuration.js → common/workflow-diagram-configuration.js} +13 -14
  137. package/lib/common/workflow-diagram-configuration.js.map +1 -0
  138. package/lib/{workflow-diagram-module.d.ts → common/workflow-diagram-module.d.ts} +6 -3
  139. package/lib/common/workflow-diagram-module.d.ts.map +1 -0
  140. package/lib/{workflow-diagram-module.js → common/workflow-diagram-module.js} +27 -9
  141. package/lib/common/workflow-diagram-module.js.map +1 -0
  142. package/lib/{workflow-glsp-server.d.ts → common/workflow-glsp-server.d.ts} +2 -2
  143. package/lib/common/workflow-glsp-server.d.ts.map +1 -0
  144. package/lib/{workflow-glsp-server.js → common/workflow-glsp-server.js} +8 -9
  145. package/lib/common/workflow-glsp-server.js.map +1 -0
  146. package/lib/{workflow-popup-factory.d.ts → common/workflow-popup-factory.d.ts} +2 -2
  147. package/lib/common/workflow-popup-factory.d.ts.map +1 -0
  148. package/lib/{workflow-popup-factory.js → common/workflow-popup-factory.js} +8 -9
  149. package/lib/common/workflow-popup-factory.js.map +1 -0
  150. package/lib/{index.d.ts → node/app.d.ts} +2 -2
  151. package/lib/node/app.d.ts.map +1 -0
  152. package/lib/node/app.js +43 -0
  153. package/lib/node/app.js.map +1 -0
  154. package/lib/node/index.d.ts +18 -0
  155. package/lib/node/index.d.ts.map +1 -0
  156. package/lib/node/index.js +34 -0
  157. package/lib/node/index.js.map +1 -0
  158. package/lib/node/workflow-cli-parser.d.ts +21 -0
  159. package/lib/node/workflow-cli-parser.d.ts.map +1 -0
  160. package/lib/node/workflow-cli-parser.js +26 -0
  161. package/lib/node/workflow-cli-parser.js.map +1 -0
  162. package/node.d.ts +16 -0
  163. package/node.js +18 -0
  164. package/package.json +34 -20
  165. package/src/{app.ts → browser/app.ts} +19 -12
  166. package/src/browser/example1.json +730 -0
  167. package/src/browser/index.ts +17 -0
  168. package/src/browser/mock-model-storage.ts +47 -0
  169. package/src/{graph-extension.ts → common/graph-extension.ts} +3 -3
  170. package/src/{handler → common/handler}/create-activity-node-handler.ts +2 -2
  171. package/src/{handler → common/handler}/create-automated-task-handler.ts +2 -2
  172. package/src/{handler → common/handler}/create-category-handler.ts +2 -2
  173. package/src/{handler → common/handler}/create-decision-node-handler.ts +2 -2
  174. package/src/{handler → common/handler}/create-edge-handler.ts +2 -2
  175. package/src/{handler → common/handler}/create-fork-node-handler.ts +1 -1
  176. package/src/{handler → common/handler}/create-fork-or-join-node-handler.ts +2 -2
  177. package/src/{handler → common/handler}/create-join-node-handler.ts +1 -1
  178. package/src/{handler → common/handler}/create-manual-task-handler.ts +2 -2
  179. package/src/{handler → common/handler}/create-merge-node-handler.ts +2 -2
  180. package/src/{handler → common/handler}/create-task-handler.ts +2 -3
  181. package/src/{handler → common/handler}/create-weighted-edge-handler.ts +2 -2
  182. package/src/{handler → common/handler}/create-workflow-node-operation-handler.ts +2 -2
  183. package/src/{handler → common/handler}/grid-snapper.ts +2 -2
  184. package/src/common/index.ts +50 -0
  185. package/src/{labeledit → common/labeledit}/workflow-label-edit-validator.ts +2 -2
  186. package/src/{layout → common/layout}/workflow-layout-configurator.ts +2 -2
  187. package/src/{marker → common/marker}/workflow-model-validator.ts +2 -2
  188. package/src/{model → common/model}/workflow-navigation-target-resolver.ts +2 -4
  189. package/src/{provider → common/provider}/abstract-next-or-previous-navigation-target-provider.ts +2 -3
  190. package/src/{provider → common/provider}/next-node-navigation-target-provider.ts +1 -1
  191. package/src/{provider → common/provider}/node-documentation-navigation-target-provider.ts +2 -4
  192. package/src/{provider → common/provider}/previous-node-navigation-target-provider.ts +1 -1
  193. package/src/{provider → common/provider}/workflow-command-palette-action-provider.ts +2 -2
  194. package/src/{provider → common/provider}/workflow-context-menu-item-provider.ts +2 -2
  195. package/src/common/taskedit/edit-task-operation-handler.ts +118 -0
  196. package/src/common/taskedit/task-edit-context-provider.ts +66 -0
  197. package/src/common/taskedit/task-edit-validator.ts +45 -0
  198. package/src/{util → common/util}/model-types.ts +1 -1
  199. package/src/{workflow-diagram-configuration.ts → common/workflow-diagram-configuration.ts} +2 -2
  200. package/src/{workflow-diagram-module.ts → common/workflow-diagram-module.ts} +25 -4
  201. package/src/{workflow-glsp-server.ts → common/workflow-glsp-server.ts} +2 -2
  202. package/src/{workflow-popup-factory.ts → common/workflow-popup-factory.ts} +3 -3
  203. package/src/node/app.ts +45 -0
  204. package/src/node/index.ts +17 -0
  205. package/src/node/workflow-cli-parser.ts +29 -0
  206. package/lib/app.d.ts +0 -2
  207. package/lib/app.d.ts.map +0 -1
  208. package/lib/app.js.map +0 -1
  209. package/lib/graph-extension.d.ts.map +0 -1
  210. package/lib/graph-extension.js.map +0 -1
  211. package/lib/handler/create-activity-node-handler.d.ts.map +0 -1
  212. package/lib/handler/create-activity-node-handler.js.map +0 -1
  213. package/lib/handler/create-automated-task-handler.d.ts.map +0 -1
  214. package/lib/handler/create-automated-task-handler.js.map +0 -1
  215. package/lib/handler/create-category-handler.d.ts.map +0 -1
  216. package/lib/handler/create-category-handler.js.map +0 -1
  217. package/lib/handler/create-decision-node-handler.d.ts.map +0 -1
  218. package/lib/handler/create-decision-node-handler.js.map +0 -1
  219. package/lib/handler/create-edge-handler.d.ts.map +0 -1
  220. package/lib/handler/create-edge-handler.js.map +0 -1
  221. package/lib/handler/create-fork-node-handler.d.ts.map +0 -1
  222. package/lib/handler/create-fork-node-handler.js.map +0 -1
  223. package/lib/handler/create-fork-or-join-node-handler.d.ts.map +0 -1
  224. package/lib/handler/create-fork-or-join-node-handler.js.map +0 -1
  225. package/lib/handler/create-join-node-handler.d.ts.map +0 -1
  226. package/lib/handler/create-join-node-handler.js.map +0 -1
  227. package/lib/handler/create-manual-task-handler.d.ts.map +0 -1
  228. package/lib/handler/create-manual-task-handler.js.map +0 -1
  229. package/lib/handler/create-merge-node-handler.d.ts.map +0 -1
  230. package/lib/handler/create-merge-node-handler.js.map +0 -1
  231. package/lib/handler/create-task-handler.d.ts.map +0 -1
  232. package/lib/handler/create-task-handler.js.map +0 -1
  233. package/lib/handler/create-weighted-edge-handler.d.ts.map +0 -1
  234. package/lib/handler/create-weighted-edge-handler.js.map +0 -1
  235. package/lib/handler/create-workflow-node-operation-handler.d.ts.map +0 -1
  236. package/lib/handler/create-workflow-node-operation-handler.js.map +0 -1
  237. package/lib/handler/grid-snapper.d.ts.map +0 -1
  238. package/lib/handler/grid-snapper.js.map +0 -1
  239. package/lib/index.d.ts.map +0 -1
  240. package/lib/index.js.map +0 -1
  241. package/lib/labeledit/workflow-label-edit-validator.d.ts.map +0 -1
  242. package/lib/labeledit/workflow-label-edit-validator.js.map +0 -1
  243. package/lib/layout/workflow-layout-configurator.d.ts.map +0 -1
  244. package/lib/layout/workflow-layout-configurator.js.map +0 -1
  245. package/lib/marker/workflow-model-validator.d.ts.map +0 -1
  246. package/lib/marker/workflow-model-validator.js.map +0 -1
  247. package/lib/model/workflow-navigation-target-resolver.d.ts.map +0 -1
  248. package/lib/model/workflow-navigation-target-resolver.js.map +0 -1
  249. package/lib/provider/abstract-next-or-previous-navigation-target-provider.d.ts.map +0 -1
  250. package/lib/provider/abstract-next-or-previous-navigation-target-provider.js.map +0 -1
  251. package/lib/provider/next-node-navigation-target-provider.d.ts.map +0 -1
  252. package/lib/provider/next-node-navigation-target-provider.js.map +0 -1
  253. package/lib/provider/node-documentation-navigation-target-provider.d.ts.map +0 -1
  254. package/lib/provider/node-documentation-navigation-target-provider.js.map +0 -1
  255. package/lib/provider/previous-node-navigation-target-provider.d.ts.map +0 -1
  256. package/lib/provider/previous-node-navigation-target-provider.js.map +0 -1
  257. package/lib/provider/workflow-command-palette-action-provider.d.ts.map +0 -1
  258. package/lib/provider/workflow-command-palette-action-provider.js.map +0 -1
  259. package/lib/provider/workflow-context-menu-item-provider.d.ts.map +0 -1
  260. package/lib/provider/workflow-context-menu-item-provider.js.map +0 -1
  261. package/lib/util/model-types.d.ts.map +0 -1
  262. package/lib/util/model-types.js.map +0 -1
  263. package/lib/workflow-diagram-configuration.d.ts.map +0 -1
  264. package/lib/workflow-diagram-configuration.js.map +0 -1
  265. package/lib/workflow-diagram-module.d.ts.map +0 -1
  266. package/lib/workflow-diagram-module.js.map +0 -1
  267. package/lib/workflow-glsp-server.d.ts.map +0 -1
  268. package/lib/workflow-glsp-server.js.map +0 -1
  269. package/lib/workflow-popup-factory.d.ts.map +0 -1
  270. package/lib/workflow-popup-factory.js.map +0 -1
  271. /package/lib/{handler → common/handler}/create-fork-node-handler.d.ts +0 -0
  272. /package/lib/{handler → common/handler}/create-join-node-handler.d.ts +0 -0
  273. /package/lib/{handler → common/handler}/grid-snapper.js +0 -0
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022-2023 EclipseSource 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
+ export * from '../common/index';
17
+ export * from './mock-model-storage';
@@ -0,0 +1,47 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022-2023 EclipseSource 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 {
17
+ GModelSerializer,
18
+ Logger,
19
+ MaybePromise,
20
+ ModelState,
21
+ RequestModelAction,
22
+ SaveModelAction,
23
+ SourceModelStorage
24
+ } from '@eclipse-glsp/server/browser';
25
+ import { inject, injectable } from 'inversify';
26
+ import wf from './example1.json';
27
+
28
+ @injectable()
29
+ export class WorkflowMockModelStorage implements SourceModelStorage {
30
+ @inject(Logger)
31
+ protected logger: Logger;
32
+
33
+ @inject(GModelSerializer)
34
+ protected modelSerializer: GModelSerializer;
35
+
36
+ @inject(ModelState)
37
+ protected modelState: ModelState;
38
+
39
+ loadSourceModel(action: RequestModelAction): MaybePromise<void> {
40
+ const root = this.modelSerializer.createRoot(wf);
41
+ this.modelState.updateRoot(root);
42
+ }
43
+
44
+ saveSourceModel(action: SaveModelAction): MaybePromise<void> {
45
+ this.logger.warn('Saving is not supported by this mock implementation');
46
+ }
47
+ }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -24,7 +24,7 @@ import {
24
24
  GLabelBuilder,
25
25
  GNode,
26
26
  GNodeBuilder
27
- } from '@eclipse-glsp/server-node';
27
+ } from '@eclipse-glsp/server';
28
28
  import { ModelTypes } from './util/model-types';
29
29
 
30
30
  export class ActivityNode extends GNode {
@@ -49,7 +49,7 @@ export class TaskNode extends GNode {
49
49
  references: string;
50
50
 
51
51
  static override builder(): TaskNodeBuilder {
52
- return new TaskNodeBuilder(TaskNode).layout('vbox').addArgs(ArgsUtil.cornerRadius(5));
52
+ return new TaskNodeBuilder(TaskNode).layout('vbox').addArgs(ArgsUtil.cornerRadius(5)).addCssClass('task');
53
53
  }
54
54
  }
55
55
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { CreateNodeOperation, GNode, Point } from '@eclipse-glsp/server-node';
16
+ import { CreateNodeOperation, GNode, Point } from '@eclipse-glsp/server';
17
17
  import { injectable } from 'inversify';
18
18
  import { ActivityNode, ActivityNodeBuilder } from '../graph-extension';
19
19
  import { ModelTypes } from '../util/model-types';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Point } from '@eclipse-glsp/server-node';
16
+ import { Point } from '@eclipse-glsp/server';
17
17
  import { injectable } from 'inversify';
18
18
  import { TaskNodeBuilder } from '../graph-extension';
19
19
  import { ModelTypes } from '../util/model-types';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { ArgsUtil, CreateNodeOperation, GNode, Point } from '@eclipse-glsp/server-node';
16
+ import { ArgsUtil, CreateNodeOperation, GNode, Point } from '@eclipse-glsp/server';
17
17
  import { Category, CategoryNodeBuilder } from '../graph-extension';
18
18
  import { ModelTypes } from '../util/model-types';
19
19
  import { CreateWorkflowNodeOperationHandler } from './create-workflow-node-operation-handler';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Point } from '@eclipse-glsp/server-node';
16
+ import { Point } from '@eclipse-glsp/server';
17
17
  import { injectable } from 'inversify';
18
18
  import { ActivityNodeBuilder } from '../graph-extension';
19
19
  import { ModelTypes } from '../util/model-types';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { DefaultTypes, GEdge, GEdgeBuilder, GModelCreateEdgeOperationHandler, GModelElement } from '@eclipse-glsp/server-node';
16
+ import { DefaultTypes, GEdge, GEdgeBuilder, GModelCreateEdgeOperationHandler, GModelElement } from '@eclipse-glsp/server';
17
17
 
18
18
  export class CreateEdgeHandler extends GModelCreateEdgeOperationHandler {
19
19
  label = 'Edge';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Point } from '@eclipse-glsp/server-node';
16
+ import { Point } from '@eclipse-glsp/server';
17
17
  import { injectable } from 'inversify';
18
18
  import { ActivityNodeBuilder } from '../graph-extension';
19
19
  import { CreateActivityNodeHandler } from './create-activity-node-handler';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Point } from '@eclipse-glsp/server-node';
16
+ import { Point } from '@eclipse-glsp/server';
17
17
  import { injectable } from 'inversify';
18
18
  import { TaskNodeBuilder } from '../graph-extension';
19
19
  import { ModelTypes } from '../util/model-types';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Point } from '@eclipse-glsp/server-node';
16
+ import { Point } from '@eclipse-glsp/server';
17
17
  import { injectable } from 'inversify';
18
18
  import { ActivityNodeBuilder } from '../graph-extension';
19
19
  import { ModelTypes } from '../util/model-types';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -14,7 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { Point } from '@eclipse-glsp/protocol';
17
- import { CreateNodeOperation, GNode } from '@eclipse-glsp/server-node';
17
+ import { CreateNodeOperation, GNode } from '@eclipse-glsp/server';
18
18
  import { injectable } from 'inversify';
19
19
  import { TaskNode, TaskNodeBuilder } from '../graph-extension';
20
20
  import { ModelTypes } from '../util/model-types';
@@ -29,7 +29,6 @@ export abstract class CreateTaskHandler extends CreateWorkflowNodeOperationHandl
29
29
  protected builder(point: Point | undefined): TaskNodeBuilder {
30
30
  return TaskNode.builder()
31
31
  .position(point ?? Point.ORIGIN)
32
- .addCssClass('task')
33
32
  .name(this.label.replace(' ', '') + this.modelState.index.getAllByClass(TaskNode).length)
34
33
  .type(this.elementTypeIds[0])
35
34
  .taskType(ModelTypes.toNodeType(this.elementTypeIds[0]))
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { GEdge, GModelCreateEdgeOperationHandler, GModelElement } from '@eclipse-glsp/server-node';
16
+ import { GEdge, GModelCreateEdgeOperationHandler, GModelElement } from '@eclipse-glsp/server';
17
17
  import { WeightedEdge } from '../graph-extension';
18
18
  import { ModelTypes } from '../util/model-types';
19
19
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -20,7 +20,7 @@ import {
20
20
  GModelElement,
21
21
  ModelState,
22
22
  Point
23
- } from '@eclipse-glsp/server-node';
23
+ } from '@eclipse-glsp/server';
24
24
  import { inject, injectable } from 'inversify';
25
25
  import { Category } from '../graph-extension';
26
26
  import { ModelTypes } from '../util/model-types';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Point } from '@eclipse-glsp/server-node';
16
+ import { Point } from '@eclipse-glsp/server';
17
17
 
18
18
  export class GridSnapper {
19
19
  public static GRID_X = 10.0;
@@ -0,0 +1,50 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+
17
+ export * from './graph-extension';
18
+ export * from './handler/create-activity-node-handler';
19
+ export * from './handler/create-automated-task-handler';
20
+ export * from './handler/create-category-handler';
21
+ export * from './handler/create-decision-node-handler';
22
+ export * from './handler/create-edge-handler';
23
+ export * from './handler/create-fork-node-handler';
24
+ export * from './handler/create-fork-or-join-node-handler';
25
+ export * from './handler/create-join-node-handler';
26
+ export * from './handler/create-manual-task-handler';
27
+ export * from './handler/create-merge-node-handler';
28
+ export * from './handler/create-task-handler';
29
+ export * from './handler/create-weighted-edge-handler';
30
+ export * from './handler/create-workflow-node-operation-handler';
31
+ export * from './handler/grid-snapper';
32
+ export * from './index';
33
+ export * from './labeledit/workflow-label-edit-validator';
34
+ export * from './layout/workflow-layout-configurator';
35
+ export * from './marker/workflow-model-validator';
36
+ export * from './model/workflow-navigation-target-resolver';
37
+ export * from './provider/abstract-next-or-previous-navigation-target-provider';
38
+ export * from './provider/next-node-navigation-target-provider';
39
+ export * from './provider/node-documentation-navigation-target-provider';
40
+ export * from './provider/previous-node-navigation-target-provider';
41
+ export * from './provider/workflow-command-palette-action-provider';
42
+ export * from './provider/workflow-context-menu-item-provider';
43
+ export * from './taskedit/edit-task-operation-handler';
44
+ export * from './taskedit/task-edit-context-provider';
45
+ export * from './taskedit/task-edit-validator';
46
+ export * from './util/model-types';
47
+ export * from './workflow-diagram-configuration';
48
+ export * from './workflow-diagram-module';
49
+ export * from './workflow-glsp-server';
50
+ export * from './workflow-popup-factory';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { GModelElement, LabelEditValidator, ModelState, ValidationStatus } from '@eclipse-glsp/server-node';
16
+ import { GModelElement, LabelEditValidator, ModelState, ValidationStatus } from '@eclipse-glsp/server';
17
17
  import { inject, injectable } from 'inversify';
18
18
  import { TaskNode } from '../graph-extension';
19
19
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -14,7 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { AbstractLayoutConfigurator, LayoutOptions } from '@eclipse-glsp/layout-elk';
17
- import { GGraph } from '@eclipse-glsp/server-node';
17
+ import { GGraph } from '@eclipse-glsp/server';
18
18
  import { injectable } from 'inversify';
19
19
 
20
20
  @injectable()
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { GCompartment, GLabel, GModelElement, Marker, MarkerKind, ModelState, ModelValidator } from '@eclipse-glsp/server-node';
16
+ import { GCompartment, GLabel, GModelElement, Marker, MarkerKind, ModelState, ModelValidator } from '@eclipse-glsp/server';
17
17
  import { inject, injectable } from 'inversify';
18
18
  import { ActivityNode, TaskNode } from '../graph-extension';
19
19
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -14,9 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { NavigationTarget } from '@eclipse-glsp/protocol';
17
- import { ModelState } 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';
17
+ import { ModelState, NavigationTargetResolution, NavigationTargetResolver } from '@eclipse-glsp/server';
20
18
  import { inject, injectable } from 'inversify';
21
19
  import { TaskNode } from '../graph-extension';
22
20
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -14,8 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { Args, EditorContext, NavigationTarget } from '@eclipse-glsp/protocol';
17
- import { GEdge, ModelState } from '@eclipse-glsp/server-node';
18
- import { NavigationTargetProvider } from '@eclipse-glsp/server-node/lib/features/navigation/navigation-target-provider';
17
+ import { GEdge, ModelState, NavigationTargetProvider } from '@eclipse-glsp/server';
19
18
  import { inject, injectable } from 'inversify';
20
19
  import { TaskNode } from '../graph-extension';
21
20
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -14,9 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { Args, EditorContext, NavigationTarget } from '@eclipse-glsp/protocol';
17
- import { ModelState } from '@eclipse-glsp/server-node';
18
- import { JsonOpenerOptions } from '@eclipse-glsp/server-node/lib/features/navigation/json-opener-options';
19
- import { NavigationTargetProvider } from '@eclipse-glsp/server-node/lib/features/navigation/navigation-target-provider';
17
+ import { JsonOpenerOptions, ModelState, NavigationTargetProvider } from '@eclipse-glsp/server';
20
18
  import { inject, injectable } from 'inversify';
21
19
  import { TaskNode } from '../graph-extension';
22
20
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -25,7 +25,7 @@ import {
25
25
  LabeledAction,
26
26
  ModelState,
27
27
  Point
28
- } from '@eclipse-glsp/server-node';
28
+ } from '@eclipse-glsp/server';
29
29
  import { inject, injectable } from 'inversify';
30
30
  import { TaskNode } from '../graph-extension';
31
31
  import { ModelTypes } from '../util/model-types';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Args, ContextMenuItemProvider, CreateNodeOperation, MenuItem, ModelState, Point } from '@eclipse-glsp/server-node';
16
+ import { Args, ContextMenuItemProvider, CreateNodeOperation, MenuItem, ModelState, Point } from '@eclipse-glsp/server';
17
17
  import { inject, injectable } from 'inversify';
18
18
  import { GridSnapper } from '../handler/grid-snapper';
19
19
  import { ModelTypes } from '../util/model-types';
@@ -0,0 +1,118 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 EclipseSource 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
+
17
+ import { Action, Command, getOrThrow, GModelOperationHandler, hasStringProp, MaybePromise, Operation } from '@eclipse-glsp/server';
18
+ import { injectable } from 'inversify';
19
+ import { TaskNode } from '../graph-extension';
20
+ import { ModelTypes } from '../util/model-types';
21
+ /**
22
+ * Is send from the {@link TaskEditor} to the GLSP server
23
+ * to update a feature from a specified task.
24
+ */
25
+ export interface EditTaskOperation extends Operation {
26
+ kind: typeof EditTaskOperation.KIND;
27
+
28
+ /**
29
+ * Id of the task that should be edited
30
+ */
31
+ taskId: string;
32
+
33
+ /**
34
+ * The feature that is to be updated
35
+ */
36
+ feature: 'duration' | 'taskType';
37
+
38
+ /**
39
+ * The new feature value
40
+ */
41
+ value: string;
42
+ }
43
+
44
+ export namespace EditTaskOperation {
45
+ export const KIND = 'editTask';
46
+
47
+ export function is(object: any): object is EditTaskOperation {
48
+ return (
49
+ Action.hasKind(object, KIND) &&
50
+ hasStringProp(object, 'taskId') &&
51
+ hasStringProp(object, 'feature') &&
52
+ hasStringProp(object, 'value')
53
+ );
54
+ }
55
+
56
+ export function create(options: { taskId: string; feature: 'duration' | 'taskType'; value: string }): EditTaskOperation {
57
+ return {
58
+ kind: KIND,
59
+ isOperation: true,
60
+ ...options
61
+ };
62
+ }
63
+ }
64
+
65
+ @injectable()
66
+ export class EditTaskOperationHandler extends GModelOperationHandler {
67
+ readonly operationType = EditTaskOperation.KIND;
68
+
69
+ createCommand(operation: EditTaskOperation): MaybePromise<Command | undefined> {
70
+ const task = getOrThrow(
71
+ this.modelState.index.findByClass(operation.taskId, TaskNode),
72
+ `Cannot find task with id '${operation.taskId}'`
73
+ );
74
+ switch (operation.feature) {
75
+ case 'duration': {
76
+ const duration = Number.parseInt(operation.value, 10);
77
+ return duration !== task.duration //
78
+ ? this.commandOf(() => this.editDuration(task, duration))
79
+ : undefined;
80
+ }
81
+ case 'taskType': {
82
+ return task.taskType !== operation.value //
83
+ ? this.commandOf(() => this.editTaskType(task, operation.value))
84
+ : undefined;
85
+ }
86
+ }
87
+ }
88
+
89
+ protected editDuration(task: TaskNode, duration: number): void {
90
+ task.duration = duration;
91
+ }
92
+
93
+ protected editTaskType(task: TaskNode, type: string): void {
94
+ task.taskType = type;
95
+ if (type === 'manual' || type === 'automated') {
96
+ const temp = this.createTempTask(type, task);
97
+ const toAssign: Partial<TaskNode> = {
98
+ taskType: temp.taskType,
99
+ type: temp.type,
100
+ children: temp.children,
101
+ cssClasses: temp.cssClasses
102
+ };
103
+ Object.assign(task, toAssign);
104
+ return;
105
+ }
106
+ throw new Error(`Could not edit task '${task.id}'. Invalid type: ${type}`);
107
+ }
108
+
109
+ protected createTempTask(type: 'automated' | 'manual', task: TaskNode): TaskNode {
110
+ return TaskNode.builder() //
111
+ .type(type === 'automated' ? ModelTypes.AUTOMATED_TASK : ModelTypes.MANUAL_TASK)
112
+ .taskType(type)
113
+ .name(task.name)
114
+ .addCssClass(type)
115
+ .children()
116
+ .build();
117
+ }
118
+ }