@eclipse-glsp-examples/workflow-server 1.1.0-next.3d7585d.42 → 1.1.0-next.44aae0c.44

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 (28) hide show
  1. package/lib/common/graph-extension.js +1 -1
  2. package/lib/common/graph-extension.js.map +1 -1
  3. package/lib/common/handler/create-task-handler.d.ts.map +1 -1
  4. package/lib/common/handler/create-task-handler.js +0 -1
  5. package/lib/common/handler/create-task-handler.js.map +1 -1
  6. package/lib/common/taskedit/edit-task-operation-handler.d.ts +53 -0
  7. package/lib/common/taskedit/edit-task-operation-handler.d.ts.map +1 -0
  8. package/lib/common/taskedit/edit-task-operation-handler.js +97 -0
  9. package/lib/common/taskedit/edit-task-operation-handler.js.map +1 -0
  10. package/lib/common/taskedit/task-edit-context-provider.d.ts +25 -0
  11. package/lib/common/taskedit/task-edit-context-provider.d.ts.map +1 -0
  12. package/lib/common/taskedit/task-edit-context-provider.js +77 -0
  13. package/lib/common/taskedit/task-edit-context-provider.js.map +1 -0
  14. package/lib/common/taskedit/task-edit-validator.d.ts +21 -0
  15. package/lib/common/taskedit/task-edit-validator.d.ts.map +1 -0
  16. package/lib/common/taskedit/task-edit-validator.js +60 -0
  17. package/lib/common/taskedit/task-edit-validator.js.map +1 -0
  18. package/lib/common/workflow-diagram-module.d.ts +3 -1
  19. package/lib/common/workflow-diagram-module.d.ts.map +1 -1
  20. package/lib/common/workflow-diagram-module.js +12 -0
  21. package/lib/common/workflow-diagram-module.js.map +1 -1
  22. package/package.json +4 -4
  23. package/src/common/graph-extension.ts +1 -1
  24. package/src/common/handler/create-task-handler.ts +0 -1
  25. package/src/common/taskedit/edit-task-operation-handler.ts +118 -0
  26. package/src/common/taskedit/task-edit-context-provider.ts +66 -0
  27. package/src/common/taskedit/task-edit-validator.ts +45 -0
  28. package/src/common/workflow-diagram-module.ts +16 -0
@@ -33,7 +33,7 @@ class ActivityNodeBuilder extends server_1.GNodeBuilder {
33
33
  exports.ActivityNodeBuilder = ActivityNodeBuilder;
34
34
  class TaskNode extends server_1.GNode {
35
35
  static builder() {
36
- return new TaskNodeBuilder(TaskNode).layout('vbox').addArgs(server_1.ArgsUtil.cornerRadius(5));
36
+ return new TaskNodeBuilder(TaskNode).layout('vbox').addArgs(server_1.ArgsUtil.cornerRadius(5)).addCssClass('task');
37
37
  }
38
38
  }
39
39
  exports.TaskNode = TaskNode;
@@ -1 +1 @@
1
- {"version":3,"file":"graph-extension.js","sourceRoot":"","sources":["../../src/common/graph-extension.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAW8B;AAC9B,oDAAgD;AAEhD,MAAa,YAAa,SAAQ,cAAK;IAGnC,MAAM,CAAU,OAAO;QACnB,OAAO,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;IACjD,CAAC;CACJ;AAND,oCAMC;AAED,MAAa,mBAA2D,SAAQ,qBAAe;IAC3F,QAAQ,CAAC,QAAgB;QACrB,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AALD,kDAKC;AAED,MAAa,QAAS,SAAQ,cAAK;IAM/B,MAAM,CAAU,OAAO;QACnB,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,iBAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1F,CAAC;CACJ;AATD,4BASC;AAED,MAAa,eAA+C,SAAQ,qBAAe;IAC/E,IAAI,CAAC,IAAY;QACb,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,QAAQ,CAAC,QAAgB;QACrB,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,Q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AAC;AAE9F,8BACsB,iBAAkB,SAAQ,kCAAkC;IAC9E,UAAU,CAAC,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS;IAIvF,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,eAAe;CAS/D"}
1
+ {"version":3,"file":"create-task-handler.d.ts","sourceRoot":"","sources":["../../../src/common/handler/create-task-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAY,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAE9F,8BACsB,iBAAkB,SAAQ,kCAAkC;IAC9E,UAAU,CAAC,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS;IAIvF,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,eAAe;CAQ/D"}
@@ -34,7 +34,6 @@ let CreateTaskHandler = class CreateTaskHandler extends create_workflow_node_ope
34
34
  builder(point) {
35
35
  return graph_extension_1.TaskNode.builder()
36
36
  .position(point !== null && point !== void 0 ? point : protocol_1.Point.ORIGIN)
37
- .addCssClass('task')
38
37
  .name(this.label.replace(' ', '') + this.modelState.index.getAllByClass(graph_extension_1.TaskNode).length)
39
38
  .type(this.elementTypeIds[0])
40
39
  .taskType(model_types_1.ModelTypes.toNodeType(this.elementTypeIds[0]))
@@ -1 +1 @@
1
- {"version":3,"file":"create-task-handler.js","sourceRoot":"","sources":["../../../src/common/handler/create-task-handler.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA+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E,CAAC;IAClD,CAAC;IAES,OAAO,CAAC,KAAwB;QACtC,OAAO,0BAAQ,CAAC,OAAO,EAAE;aACpB,QAAQ,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,gBAAK,CAAC,MAAM,CAAC;aAC/B,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;AAbqB,iBAAiB;IADtC,IAAA,sBAAU,GAAE;GACS,iBAAiB,CAatC;AAbqB,8CAAiB"}
@@ -0,0 +1,53 @@
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
+ import { Command, GModelOperationHandler, MaybePromise, Operation } from '@eclipse-glsp/server';
17
+ import { TaskNode } from '../graph-extension';
18
+ /**
19
+ * Is send from the {@link TaskEditor} to the GLSP server
20
+ * to update a feature from a specified task.
21
+ */
22
+ export interface EditTaskOperation extends Operation {
23
+ kind: typeof EditTaskOperation.KIND;
24
+ /**
25
+ * Id of the task that should be edited
26
+ */
27
+ taskId: string;
28
+ /**
29
+ * The feature that is to be updated
30
+ */
31
+ feature: 'duration' | 'taskType';
32
+ /**
33
+ * The new feature value
34
+ */
35
+ value: string;
36
+ }
37
+ export declare namespace EditTaskOperation {
38
+ const KIND = "editTask";
39
+ function is(object: any): object is EditTaskOperation;
40
+ function create(options: {
41
+ taskId: string;
42
+ feature: 'duration' | 'taskType';
43
+ value: string;
44
+ }): EditTaskOperation;
45
+ }
46
+ export declare class EditTaskOperationHandler extends GModelOperationHandler {
47
+ readonly operationType = "editTask";
48
+ createCommand(operation: EditTaskOperation): MaybePromise<Command | undefined>;
49
+ protected editDuration(task: TaskNode, duration: number): void;
50
+ protected editTaskType(task: TaskNode, type: string): void;
51
+ protected createTempTask(type: 'automated' | 'manual', task: TaskNode): TaskNode;
52
+ }
53
+ //# sourceMappingURL=edit-task-operation-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-task-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/taskedit/edit-task-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAU,OAAO,EAAc,sBAAsB,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEnI,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAChD,IAAI,EAAE,OAAO,iBAAiB,CAAC,IAAI,CAAC;IAEpC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,IAAI,aAAa,CAAC;IAE/B,SAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,iBAAiB,CAO3D;IAED,SAAgB,MAAM,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,iBAAiB,CAMtH;CACJ;AAED,qBACa,wBAAyB,SAAQ,sBAAsB;IAChE,QAAQ,CAAC,aAAa,cAA0B;IAEhD,aAAa,CAAC,SAAS,EAAE,iBAAiB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAoB9E,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI9D,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAgB1D,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ;CASnF"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2023 EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ 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;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.EditTaskOperationHandler = exports.EditTaskOperation = void 0;
25
+ const server_1 = require("@eclipse-glsp/server");
26
+ const inversify_1 = require("inversify");
27
+ const graph_extension_1 = require("../graph-extension");
28
+ const model_types_1 = require("../util/model-types");
29
+ var EditTaskOperation;
30
+ (function (EditTaskOperation) {
31
+ EditTaskOperation.KIND = 'editTask';
32
+ function is(object) {
33
+ return (server_1.Action.hasKind(object, EditTaskOperation.KIND) &&
34
+ (0, server_1.hasStringProp)(object, 'taskId') &&
35
+ (0, server_1.hasStringProp)(object, 'feature') &&
36
+ (0, server_1.hasStringProp)(object, 'value'));
37
+ }
38
+ EditTaskOperation.is = is;
39
+ function create(options) {
40
+ return Object.assign({ kind: EditTaskOperation.KIND, isOperation: true }, options);
41
+ }
42
+ EditTaskOperation.create = create;
43
+ })(EditTaskOperation = exports.EditTaskOperation || (exports.EditTaskOperation = {}));
44
+ let EditTaskOperationHandler = class EditTaskOperationHandler extends server_1.GModelOperationHandler {
45
+ constructor() {
46
+ super(...arguments);
47
+ this.operationType = EditTaskOperation.KIND;
48
+ }
49
+ createCommand(operation) {
50
+ const task = (0, server_1.getOrThrow)(this.modelState.index.findByClass(operation.taskId, graph_extension_1.TaskNode), `Cannot find task with id '${operation.taskId}'`);
51
+ switch (operation.feature) {
52
+ case 'duration': {
53
+ const duration = Number.parseInt(operation.value, 10);
54
+ return duration !== task.duration //
55
+ ? this.commandOf(() => this.editDuration(task, duration))
56
+ : undefined;
57
+ }
58
+ case 'taskType': {
59
+ return task.taskType !== operation.value //
60
+ ? this.commandOf(() => this.editTaskType(task, operation.value))
61
+ : undefined;
62
+ }
63
+ }
64
+ }
65
+ editDuration(task, duration) {
66
+ task.duration = duration;
67
+ }
68
+ editTaskType(task, type) {
69
+ task.taskType = type;
70
+ if (type === 'manual' || type === 'automated') {
71
+ const temp = this.createTempTask(type, task);
72
+ const toAssign = {
73
+ taskType: temp.taskType,
74
+ type: temp.type,
75
+ children: temp.children,
76
+ cssClasses: temp.cssClasses
77
+ };
78
+ Object.assign(task, toAssign);
79
+ return;
80
+ }
81
+ throw new Error(`Could not edit task '${task.id}'. Invalid type: ${type}`);
82
+ }
83
+ createTempTask(type, task) {
84
+ return graph_extension_1.TaskNode.builder() //
85
+ .type(type === 'automated' ? model_types_1.ModelTypes.AUTOMATED_TASK : model_types_1.ModelTypes.MANUAL_TASK)
86
+ .taskType(type)
87
+ .name(task.name)
88
+ .addCssClass(type)
89
+ .children()
90
+ .build();
91
+ }
92
+ };
93
+ EditTaskOperationHandler = __decorate([
94
+ (0, inversify_1.injectable)()
95
+ ], EditTaskOperationHandler);
96
+ exports.EditTaskOperationHandler = EditTaskOperationHandler;
97
+ //# sourceMappingURL=edit-task-operation-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-task-operation-handler.js","sourceRoot":"","sources":["../../../src/common/taskedit/edit-task-operation-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,iDAAmI;AACnI,yCAAuC;AACvC,wDAA8C;AAC9C,qDAAiD;AAwBjD,IAAiB,iBAAiB,CAmBjC;AAnBD,WAAiB,iBAAiB;IACjB,sBAAI,GAAG,UAAU,CAAC;IAE/B,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,CACH,eAAM,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAA,IAAI,CAAC;YAC5B,IAAA,sBAAa,EAAC,MAAM,EAAE,QAAQ,CAAC;YAC/B,IAAA,sBAAa,EAAC,MAAM,EAAE,SAAS,CAAC;YAChC,IAAA,sBAAa,EAAC,MAAM,EAAE,OAAO,CAAC,CACjC,CAAC;IACN,CAAC;IAPe,oBAAE,KAOjB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AAgB;QACnD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAES,YAAY,CAAC,IAAc,EAAE,IAAY;QAC/C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,WAAW,EAAE;YAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7C,MAAM,QAAQ,GAAsB;gBAChC,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,UAAU,EAAE,IAAI,CAAC,UAAU;aAC9B,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC9B,OAAO;SACV;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,IAAI,CAAC,EAAE,oBAAoB,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;IAES,cAAc,CAAC,IAA4B,EAAE,IAAc;QACjE,OAAO,0BAAQ,CAAC,OAAO,EAAE,CAAC,EAAE;aACvB,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,wBAAU,CAAC,cAAc,CAAC,CAAC,CAAC,wBAAU,CAAC,WAAW,CAAC;aAC/E,QAAQ,CAAC,IAAI,CAAC;aACd,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;aACf,WAAW,CAAC,IAAI,CAAC;aACjB,QAAQ,EAAE;aACV,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ,CAAA;AApDY,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAoDpC;AApDY,4DAAwB"}
@@ -0,0 +1,25 @@
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
+ import { ContextActionsProvider, EditorContext, LabeledAction, MaybePromise, ModelState } from '@eclipse-glsp/server';
17
+ export declare class TaskEditContextActionProvider implements ContextActionsProvider {
18
+ static readonly DURATION_PREFIX = "duration:";
19
+ static readonly TYPE_PREFIX = "type:";
20
+ static readonly TASK_PREFIX = "task:";
21
+ readonly contextId = "task-editor";
22
+ protected modelState: ModelState;
23
+ getActions(editorContext: EditorContext): MaybePromise<LabeledAction[]>;
24
+ }
25
+ //# sourceMappingURL=task-edit-context-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-edit-context-provider.d.ts","sourceRoot":"","sources":["../../../src/common/taskedit/task-edit-context-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAe,MAAM,sBAAsB,CAAC;AAKnI,qBACa,6BAA8B,YAAW,sBAAsB;IACxE,MAAM,CAAC,QAAQ,CAAC,eAAe,eAAe;IAC9C,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAW;IACtC,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAW;IAEtC,QAAQ,CAAC,SAAS,iBAAiB;IAGnC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,UAAU,CAAC,aAAa,EAAE,aAAa,GAAG,YAAY,CAAC,aAAa,EAAE,CAAC;CA8B1E"}
@@ -0,0 +1,77 @@
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
+ var TaskEditContextActionProvider_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.TaskEditContextActionProvider = void 0;
14
+ /********************************************************************************
15
+ * Copyright (c) 2023 EclipseSource and others.
16
+ *
17
+ * This program and the accompanying materials are made available under the
18
+ * terms of the Eclipse Public License v. 2.0 which is available at
19
+ * http://www.eclipse.org/legal/epl-2.0.
20
+ *
21
+ * This Source Code may also be made available under the following Secondary
22
+ * Licenses when the conditions for such availability set forth in the Eclipse
23
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
24
+ * with the GNU Classpath Exception which is available at
25
+ * https://www.gnu.org/software/classpath/license.html.
26
+ *
27
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
28
+ ********************************************************************************/
29
+ const server_1 = require("@eclipse-glsp/server");
30
+ const inversify_1 = require("inversify");
31
+ const graph_extension_1 = require("../graph-extension");
32
+ const edit_task_operation_handler_1 = require("./edit-task-operation-handler");
33
+ let TaskEditContextActionProvider = TaskEditContextActionProvider_1 = class TaskEditContextActionProvider {
34
+ constructor() {
35
+ this.contextId = 'task-editor';
36
+ }
37
+ getActions(editorContext) {
38
+ var _a, _b;
39
+ const text = (_b = (_a = editorContext.args) === null || _a === void 0 ? void 0 : _a['text'].toString()) !== null && _b !== void 0 ? _b : '';
40
+ const taskNode = this.modelState.index.findParentElement(editorContext.selectedElementIds[0], (0, server_1.toTypeGuard)(graph_extension_1.TaskNode));
41
+ if (!taskNode) {
42
+ return [];
43
+ }
44
+ if (text.startsWith(TaskEditContextActionProvider_1.TYPE_PREFIX)) {
45
+ const taskId = taskNode.id;
46
+ return [
47
+ { label: 'type:automated', actions: [edit_task_operation_handler_1.EditTaskOperation.create({ taskId, feature: 'taskType', value: 'automated' })] },
48
+ { label: 'type:manual', actions: [edit_task_operation_handler_1.EditTaskOperation.create({ taskId, feature: 'taskType', value: 'manual' })] }
49
+ ];
50
+ }
51
+ if (text.startsWith(TaskEditContextActionProvider_1.DURATION_PREFIX)) {
52
+ return [];
53
+ }
54
+ const taskType = taskNode.type.substring(TaskEditContextActionProvider_1.TASK_PREFIX.length);
55
+ const duration = taskNode.duration;
56
+ return [
57
+ { label: 'type:', actions: [], text: `${TaskEditContextActionProvider_1.TYPE_PREFIX}${taskType}` },
58
+ {
59
+ label: 'duration:',
60
+ actions: [],
61
+ text: `${TaskEditContextActionProvider_1.DURATION_PREFIX}${duration !== null && duration !== void 0 ? duration : 0}`
62
+ }
63
+ ];
64
+ }
65
+ };
66
+ TaskEditContextActionProvider.DURATION_PREFIX = 'duration:';
67
+ TaskEditContextActionProvider.TYPE_PREFIX = 'type:';
68
+ TaskEditContextActionProvider.TASK_PREFIX = 'task:';
69
+ __decorate([
70
+ (0, inversify_1.inject)(server_1.ModelState),
71
+ __metadata("design:type", Object)
72
+ ], TaskEditContextActionProvider.prototype, "modelState", void 0);
73
+ TaskEditContextActionProvider = TaskEditContextActionProvider_1 = __decorate([
74
+ (0, inversify_1.injectable)()
75
+ ], TaskEditContextActionProvider);
76
+ exports.TaskEditContextActionProvider = TaskEditContextActionProvider;
77
+ //# sourceMappingURL=task-edit-context-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-edit-context-provider.js","sourceRoot":"","sources":["../../../src/common/taskedit/task-edit-context-provider.ts"],"names":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AC,MAAM,CAAC,CAAC;QAC3F,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACnC,OAAO;YACyB,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,+BAA6B,CAAC,WAAW,GAAG,QAAQ,EAAE,EAAE;YAChG;gBACxB,KAAK,EAAE,WAAW;gBAClB,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,GAAG,+BAA6B,CAAC,eAAe,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,EAAE;aAC3E;SACJ,CAAC;IACN,CAAC;;AAtCe,6CAAe,GAAG,WAAW,CAAC;AAC9B,yCAAW,GAAG,OAAO,CAAC;AACtB,yCAAW,GAAG,OAAO,CAAC;AAItC;IAAC,IAAA,kBAAM,EAAC,mBAAU,CAAC;;iEACc;AARxB,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAwCzC;AAxCY,sEAA6B"}
@@ -0,0 +1,21 @@
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
+ import { ContextEditValidator, RequestEditValidationAction, ValidationStatus } from '@eclipse-glsp/server';
17
+ export declare class TaskEditValidator implements ContextEditValidator {
18
+ readonly contextId = "task-editor";
19
+ validate(action: RequestEditValidationAction): ValidationStatus;
20
+ }
21
+ //# sourceMappingURL=task-edit-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-edit-validator.d.ts","sourceRoot":"","sources":["../../../src/common/taskedit/task-edit-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI3G,qBACa,iBAAkB,YAAW,oBAAoB;IAC1D,QAAQ,CAAC,SAAS,iBAAiB;IAEnC,QAAQ,CAAC,MAAM,EAAE,2BAA2B,GAAG,gBAAgB;CAqBlE"}
@@ -0,0 +1,60 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.TaskEditValidator = void 0;
10
+ /********************************************************************************
11
+ * Copyright (c) 2023 EclipseSource and others.
12
+ *
13
+ * This program and the accompanying materials are made available under the
14
+ * terms of the Eclipse Public License v. 2.0 which is available at
15
+ * http://www.eclipse.org/legal/epl-2.0.
16
+ *
17
+ * This Source Code may also be made available under the following Secondary
18
+ * Licenses when the conditions for such availability set forth in the Eclipse
19
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
20
+ * with the GNU Classpath Exception which is available at
21
+ * https://www.gnu.org/software/classpath/license.html.
22
+ *
23
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
24
+ ********************************************************************************/
25
+ const server_1 = require("@eclipse-glsp/server");
26
+ const inversify_1 = require("inversify");
27
+ const task_edit_context_provider_1 = require("./task-edit-context-provider");
28
+ let TaskEditValidator = class TaskEditValidator {
29
+ constructor() {
30
+ this.contextId = 'task-editor';
31
+ }
32
+ validate(action) {
33
+ const text = action.text;
34
+ if (text.startsWith(task_edit_context_provider_1.TaskEditContextActionProvider.DURATION_PREFIX)) {
35
+ const durationString = text.substring(task_edit_context_provider_1.TaskEditContextActionProvider.DURATION_PREFIX.length);
36
+ const duration = Number.parseInt(durationString, 10);
37
+ if (Number.isNaN(duration)) {
38
+ return { severity: server_1.ValidationStatus.Severity.ERROR, message: `'${durationString}' is not a valid number.` };
39
+ }
40
+ else if (duration < 0 || duration > 100) {
41
+ return { severity: server_1.ValidationStatus.Severity.WARNING, message: `'${durationString}' should be between 0 and 100` };
42
+ }
43
+ }
44
+ else if (text.startsWith(task_edit_context_provider_1.TaskEditContextActionProvider.TYPE_PREFIX)) {
45
+ const typeString = text.substring(task_edit_context_provider_1.TaskEditContextActionProvider.TYPE_PREFIX.length);
46
+ if (typeString !== 'automated' && typeString !== 'manual') {
47
+ return {
48
+ severity: server_1.ValidationStatus.Severity.ERROR,
49
+ message: `'Type of task can only be manual or automatic. You entered '${typeString}'.`
50
+ };
51
+ }
52
+ }
53
+ return server_1.ValidationStatus.NONE;
54
+ }
55
+ };
56
+ TaskEditValidator = __decorate([
57
+ (0, inversify_1.injectable)()
58
+ ], TaskEditValidator);
59
+ exports.TaskEditValidator = TaskEditValidator;
60
+ //# sourceMappingURL=task-edit-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-edit-validator.js","sourceRoot":"","sources":["../../../src/common/taskedit/task-edit-validator.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAA2G;AAC3G,yCAAuC;AACvC,6EAA6E;AAGtE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAAvB;QACM,cAAS,GAAG,aAAa,CAAC;IAuBvC,CAAC;IArBG,QAAQ,CAAC,MAAmC;QAC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classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { BindingTarget, CommandPaletteActionProvider, ContextMenuItemProvider, DiagramConfiguration, GLSPServer, GModelDiagramModule, InstanceMultiBinding, LabelEditValidator, ModelValidator, MultiBinding, NavigationTargetProvider, NavigationTargetResolver, OperationHandlerConstructor, PopupModelFactory, ServerModule, SourceModelStorage } from '@eclipse-glsp/server';
16
+ import { BindingTarget, CommandPaletteActionProvider, ContextActionsProvider, ContextEditValidator, ContextMenuItemProvider, DiagramConfiguration, GLSPServer, GModelDiagramModule, InstanceMultiBinding, LabelEditValidator, ModelValidator, MultiBinding, NavigationTargetProvider, NavigationTargetResolver, OperationHandlerConstructor, PopupModelFactory, ServerModule, SourceModelStorage } from '@eclipse-glsp/server';
17
17
  export declare class WorkflowServerModule extends ServerModule {
18
18
  protected bindGLSPServer(): BindingTarget<GLSPServer>;
19
19
  }
@@ -30,5 +30,7 @@ export declare class WorkflowDiagramModule extends GModelDiagramModule {
30
30
  protected bindPopupModelFactory(): BindingTarget<PopupModelFactory> | undefined;
31
31
  protected bindModelValidator(): BindingTarget<ModelValidator> | undefined;
32
32
  protected configureNavigationTargetProviders(binding: MultiBinding<NavigationTargetProvider>): void;
33
+ protected configureContextActionProviders(binding: MultiBinding<ContextActionsProvider>): void;
34
+ protected configureContextEditValidators(binding: MultiBinding<ContextEditValidator>): void;
33
35
  }
34
36
  //# sourceMappingURL=workflow-diagram-module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-diagram-module.d.ts","sourceRoot":"","sources":["../../src/common/workflow-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,aAAa,EACb,4BAA4B,EAC5B,uBAAuB,EACvB,oBAAoB,EACpB,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,EACjB,YAA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ACjB,YAAY,EACZ,kBAAkB,EACrB,MAAM,sBAAsB,CAAC;AA0B9B,qBACa,oBAAqB,SAAQ,YAAY;cAC/B,cAAc,IAAI,aAAa,CAAC,UAAU,CAAC;CAGjE;AAED,qBACa,qBAAsB,SAAQ,mBAAmB;IACvC,sBAAsB,EAAE,MAAM,aAAa,CAAC,kBAAkB,CAAC;gBAA/D,sBAAsB,EAAE,MAAM,aAAa,CAAC,kBAAkB,CAAC;IAIlF,IAAI,WAAW,IAAI,MAAM,CAExB;cAEkB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,CAAC,2BAA2B,CAAC,GAAG,IAAI;IAc/G,SAAS,CAAC,wBAAwB,IAAI,aAAa,CAAC,oBAAoB,CAAC;cAItD,4BAA4B,IAAI,aAAa,CAAC,wBAAwB,CAAC,GAAG,SAAS;cAInF,2BAA2B,IAAI,aAAa,CAAC,uBAAuB,CAAC,GAAG,SAAS;cAIjF,gCAAgC,IAAI,aAAa,CAAC,4BAA4B,CAAC,GAAG,SAAS;cAI3F,sBAAsB,IAAI,aAAa,CAAC,kBAAkB,CAAC,GAAG,SAAS;cAIvE,qBAAqB,IAAI,aAAa,CAAC,iBAAiB,CAAC,GAAG,SAAS;cAIrE,kBAAkB,IAAI,aAAa,CAAC,cAAc,CAAC,GAAG,SAAS;cAI/D,kCAAkC,CAAC,OAAO,EAAE,YAAY,CAAC,wBAAwB,CAAC,GAAG,IAAI;cAOzF,+BAA+B,CAAC,OAAO,EAAE,YAAY,CAAC,sBAAsB,CAAC,GAAG,IAAI;cAKpF,8BAA8B,CAAC,OAAO,EAAE,YAAY,CAAC,oBAAoB,CAAC,GAAG,IAAI;CAIvG"}
@@ -44,6 +44,9 @@ const node_documentation_navigation_target_provider_1 = require("./provider/node
44
44
  const previous_node_navigation_target_provider_1 = require("./provider/previous-node-navigation-target-provider");
45
45
  const workflow_command_palette_action_provider_1 = require("./provider/workflow-command-palette-action-provider");
46
46
  const workflow_context_menu_item_provider_1 = require("./provider/workflow-context-menu-item-provider");
47
+ const edit_task_operation_handler_1 = require("./taskedit/edit-task-operation-handler");
48
+ const task_edit_context_provider_1 = require("./taskedit/task-edit-context-provider");
49
+ const task_edit_validator_1 = require("./taskedit/task-edit-validator");
47
50
  const workflow_diagram_configuration_1 = require("./workflow-diagram-configuration");
48
51
  const workflow_glsp_server_1 = require("./workflow-glsp-server");
49
52
  const workflow_popup_factory_1 = require("./workflow-popup-factory");
@@ -75,6 +78,7 @@ let WorkflowDiagramModule = class WorkflowDiagramModule extends server_1.GModelD
75
78
  binding.add(create_merge_node_handler_1.CreateMergeNodeHandler);
76
79
  binding.add(create_decision_node_handler_1.CreateDecisionNodeHandler);
77
80
  binding.add(create_category_handler_1.CreateCategoryHandler);
81
+ binding.add(edit_task_operation_handler_1.EditTaskOperationHandler);
78
82
  }
79
83
  bindDiagramConfiguration() {
80
84
  return workflow_diagram_configuration_1.WorkflowDiagramConfiguration;
@@ -103,6 +107,14 @@ let WorkflowDiagramModule = class WorkflowDiagramModule extends server_1.GModelD
103
107
  binding.add(previous_node_navigation_target_provider_1.PreviousNodeNavigationTargetProvider);
104
108
  binding.add(node_documentation_navigation_target_provider_1.NodeDocumentationNavigationTargetProvider);
105
109
  }
110
+ configureContextActionProviders(binding) {
111
+ super.configureContextActionProviders(binding);
112
+ binding.add(task_edit_context_provider_1.TaskEditContextActionProvider);
113
+ }
114
+ configureContextEditValidators(binding) {
115
+ super.configureContextEditValidators(binding);
116
+ binding.add(task_edit_validator_1.TaskEditValidator);
117
+ }
106
118
  };
107
119
  WorkflowDiagramModule = __decorate([
108
120
  (0, inversify_1.injectable)(),
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-diagram-module.js","sourceRoot":"","sources":["../../src/common/workflow-diagram-module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAiB8B;AAC9B,yCAAuC;AACvC,2FAAqF;AACrF,+EAA0E;AAC1E,yFAAmF;AACnF,uEAAkE;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B,CAAC;IACxC,CAAC;IAEkB,4BAA4B;QAC3C,OAAO,sEAAgC,CAAC;IAC5C,CAAC;IAEkB,2BAA2B;QAC1C,OAAO,qEAA+B,CAAC;IAC3C,CAAC;IAEkB,gCAAgC;QAC/C,OAAO,+EAAoC,CAAC;IAChD,CAAC;IAEkB,sBAAsB;QACrC,OAAO,0DAA0B,CAAC;IACtC,CAAC;IAEkB,qBAAqB;QACpC,OAAO,6CAAoB,CAAC;IAChC,CAAC;IAEkB,kBAAkB;QACjC,OAAO,iDAAsB,CAAC;IAClC,CAAC;IAEkB,kCAAkC,CAAC,OAA+C;QACjG,KAAK,CAAC,kCAAkC,CAAC,OAAO,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,uEAAgC,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,+EAAoC,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,yFAAyC,CAAC,CAAC;IAC3D,CAAC;CACJ,CAAA;AAxDY,qBAAqB;IADjC,IAAA,sBAAU,GAAE;;GACA,qBAAqB,CAwDjC;AAxDY,sDAAqB"}
1
+ {"version":3,"file":"workflow-diagram-module.js","sourceRoot":"","sources":["../../src/common/workflow-diagram-module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAmB8B;AAC9B,yCAAuC;AACvC,2FAAqF;AACrF,+EAA0E;AAC1E,yFAAmF;AACnF,uEAAkE;AAClE,iFAA2E;AAC3E,iFAA2E;AAC3E,qFAA+E;AAC/E,mFAA6E;AAC7E,yFAAmF;AACnF,6FAAuF;AACvF,gFAA2E;AAC3E,qGAA+F;AAC/F,0GAAmG;AACnG,4HAAqH;AACrH,kHAA2G;AAC3G,kHAA2G;AAC3G,wGAAiG;AACjG,wFAAkF;AAClF,sFAAsF;AACtF,wEAAmE;AACnE,qFAAgF;AAChF,iEAA4D;AAC5D,qEAAgE;AAGzD,IAAM,oBAAoB,GAA1B,MAAM,oBAA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;IACtC,CAAC;IAEkB,qBAAqB;QACpC,OAAO,6CAAoB,CAAC;IAChC,CAAC;IAEkB,kBAAkB;QACjC,OAAO,iDAAsB,CAAC;IAClC,CAAC;IAEkB,kCAAkC,CAAC,OAA+C;QACjG,KAAK,CAAC,kCAAkC,CAAC,OAAO,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,uEAAgC,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,+EAAoC,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,yFAAyC,CAAC,CAAC;IAC3D,CAAC;IAEkB,+BAA+B,CAAC,OAA6C;QAC5F,KAAK,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,0DAA6B,CAAC,CAAC;IAC/C,CAAC;IAEkB,8BAA8B,CAAC,OAA2C;QACzF,KAAK,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,uCAAiB,CAAC,CAAC;IACnC,CAAC;CACJ,CAAA;AAnEY,qBAAqB;IADjC,IAAA,sBAAU,GAAE;;GACA,qBAAqB,CAmEjC;AAnEY,sDAAqB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp-examples/workflow-server",
3
- "version": "1.1.0-next.3d7585d.42+3d7585d",
3
+ "version": "1.1.0-next.44aae0c.44+44aae0c",
4
4
  "description": "GLSP node server for the workflow example",
5
5
  "keywords": [
6
6
  "eclipse",
@@ -53,8 +53,8 @@
53
53
  "watch": "tsc -w"
54
54
  },
55
55
  "dependencies": {
56
- "@eclipse-glsp/layout-elk": "1.1.0-next.3d7585d.42+3d7585d",
57
- "@eclipse-glsp/server": "1.1.0-next.3d7585d.42+3d7585d"
56
+ "@eclipse-glsp/layout-elk": "1.1.0-next.44aae0c.44+44aae0c",
57
+ "@eclipse-glsp/server": "1.1.0-next.44aae0c.44+44aae0c"
58
58
  },
59
59
  "devDependencies": {
60
60
  "source-map-loader": "^4.0.1",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "3d7585df49f6df95ea707e55cfc8e435b578cea3"
67
+ "gitHead": "44aae0ca2380fe42eb95aac54d2d4e45e187d14f"
68
68
  }
@@ -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
 
@@ -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]))
@@ -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
+ }
@@ -0,0 +1,66 @@
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
+ import { ContextActionsProvider, EditorContext, LabeledAction, MaybePromise, ModelState, toTypeGuard } from '@eclipse-glsp/server';
17
+ import { inject, injectable } from 'inversify';
18
+ import { TaskNode } from '../graph-extension';
19
+ import { EditTaskOperation } from './edit-task-operation-handler';
20
+
21
+ @injectable()
22
+ export class TaskEditContextActionProvider implements ContextActionsProvider {
23
+ static readonly DURATION_PREFIX = 'duration:';
24
+ static readonly TYPE_PREFIX = 'type:';
25
+ static readonly TASK_PREFIX = 'task:';
26
+
27
+ readonly contextId = 'task-editor';
28
+
29
+ @inject(ModelState)
30
+ protected modelState: ModelState;
31
+
32
+ getActions(editorContext: EditorContext): MaybePromise<LabeledAction[]> {
33
+ const text = editorContext.args?.['text'].toString() ?? '';
34
+ const taskNode = this.modelState.index.findParentElement(editorContext.selectedElementIds[0], toTypeGuard(TaskNode));
35
+ if (!taskNode) {
36
+ return [];
37
+ }
38
+
39
+ if (text.startsWith(TaskEditContextActionProvider.TYPE_PREFIX)) {
40
+ const taskId = taskNode.id;
41
+ return [
42
+ { label: 'type:automated', actions: [EditTaskOperation.create({ taskId, feature: 'taskType', value: 'automated' })] },
43
+ { label: 'type:manual', actions: [EditTaskOperation.create({ taskId, feature: 'taskType', value: 'manual' })] }
44
+ ];
45
+ }
46
+
47
+ if (text.startsWith(TaskEditContextActionProvider.DURATION_PREFIX)) {
48
+ return [];
49
+ }
50
+
51
+ const taskType = taskNode.type.substring(TaskEditContextActionProvider.TASK_PREFIX.length);
52
+ const duration = taskNode.duration;
53
+ return [
54
+ <SetAutocompleteValueAction>{ label: 'type:', actions: [], text: `${TaskEditContextActionProvider.TYPE_PREFIX}${taskType}` },
55
+ <SetAutocompleteValueAction>{
56
+ label: 'duration:',
57
+ actions: [],
58
+ text: `${TaskEditContextActionProvider.DURATION_PREFIX}${duration ?? 0}`
59
+ }
60
+ ];
61
+ }
62
+ }
63
+
64
+ interface SetAutocompleteValueAction extends LabeledAction {
65
+ text: string;
66
+ }
@@ -0,0 +1,45 @@
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
+ import { ContextEditValidator, RequestEditValidationAction, ValidationStatus } from '@eclipse-glsp/server';
17
+ import { injectable } from 'inversify';
18
+ import { TaskEditContextActionProvider } from './task-edit-context-provider';
19
+
20
+ @injectable()
21
+ export class TaskEditValidator implements ContextEditValidator {
22
+ readonly contextId = 'task-editor';
23
+
24
+ validate(action: RequestEditValidationAction): ValidationStatus {
25
+ const text = action.text;
26
+ if (text.startsWith(TaskEditContextActionProvider.DURATION_PREFIX)) {
27
+ const durationString = text.substring(TaskEditContextActionProvider.DURATION_PREFIX.length);
28
+ const duration = Number.parseInt(durationString, 10);
29
+ if (Number.isNaN(duration)) {
30
+ return { severity: ValidationStatus.Severity.ERROR, message: `'${durationString}' is not a valid number.` };
31
+ } else if (duration < 0 || duration > 100) {
32
+ return { severity: ValidationStatus.Severity.WARNING, message: `'${durationString}' should be between 0 and 100` };
33
+ }
34
+ } else if (text.startsWith(TaskEditContextActionProvider.TYPE_PREFIX)) {
35
+ const typeString = text.substring(TaskEditContextActionProvider.TYPE_PREFIX.length);
36
+ if (typeString !== 'automated' && typeString !== 'manual') {
37
+ return {
38
+ severity: ValidationStatus.Severity.ERROR,
39
+ message: `'Type of task can only be manual or automatic. You entered '${typeString}'.`
40
+ };
41
+ }
42
+ }
43
+ return ValidationStatus.NONE;
44
+ }
45
+ }
@@ -16,6 +16,8 @@
16
16
  import {
17
17
  BindingTarget,
18
18
  CommandPaletteActionProvider,
19
+ ContextActionsProvider,
20
+ ContextEditValidator,
19
21
  ContextMenuItemProvider,
20
22
  DiagramConfiguration,
21
23
  GLSPServer,
@@ -49,6 +51,9 @@ import { NodeDocumentationNavigationTargetProvider } from './provider/node-docum
49
51
  import { PreviousNodeNavigationTargetProvider } from './provider/previous-node-navigation-target-provider';
50
52
  import { WorkflowCommandPaletteActionProvider } from './provider/workflow-command-palette-action-provider';
51
53
  import { WorkflowContextMenuItemProvider } from './provider/workflow-context-menu-item-provider';
54
+ import { EditTaskOperationHandler } from './taskedit/edit-task-operation-handler';
55
+ import { TaskEditContextActionProvider } from './taskedit/task-edit-context-provider';
56
+ import { TaskEditValidator } from './taskedit/task-edit-validator';
52
57
  import { WorkflowDiagramConfiguration } from './workflow-diagram-configuration';
53
58
  import { WorkflowGLSPServer } from './workflow-glsp-server';
54
59
  import { WorkflowPopupFactory } from './workflow-popup-factory';
@@ -81,6 +86,7 @@ export class WorkflowDiagramModule extends GModelDiagramModule {
81
86
  binding.add(CreateMergeNodeHandler);
82
87
  binding.add(CreateDecisionNodeHandler);
83
88
  binding.add(CreateCategoryHandler);
89
+ binding.add(EditTaskOperationHandler);
84
90
  }
85
91
 
86
92
  protected bindDiagramConfiguration(): BindingTarget<DiagramConfiguration> {
@@ -117,4 +123,14 @@ export class WorkflowDiagramModule extends GModelDiagramModule {
117
123
  binding.add(PreviousNodeNavigationTargetProvider);
118
124
  binding.add(NodeDocumentationNavigationTargetProvider);
119
125
  }
126
+
127
+ protected override configureContextActionProviders(binding: MultiBinding<ContextActionsProvider>): void {
128
+ super.configureContextActionProviders(binding);
129
+ binding.add(TaskEditContextActionProvider);
130
+ }
131
+
132
+ protected override configureContextEditValidators(binding: MultiBinding<ContextEditValidator>): void {
133
+ super.configureContextEditValidators(binding);
134
+ binding.add(TaskEditValidator);
135
+ }
120
136
  }