@eclipse-glsp-examples/workflow-server 0.9.0-next.397cddd.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +277 -0
- package/lib/app.d.ts +2 -0
- package/lib/app.d.ts.map +1 -0
- package/lib/app.js +37 -0
- package/lib/app.js.map +1 -0
- package/lib/graph-extension.d.ts +60 -0
- package/lib/graph-extension.d.ts.map +1 -0
- package/lib/graph-extension.js +156 -0
- package/lib/graph-extension.js.map +1 -0
- package/lib/handler/create-activity-node-handler.d.ts +23 -0
- package/lib/handler/create-activity-node-handler.d.ts.map +1 -0
- package/lib/handler/create-activity-node-handler.js +45 -0
- package/lib/handler/create-activity-node-handler.js.map +1 -0
- package/lib/handler/create-automated-task-handler.d.ts +9 -0
- package/lib/handler/create-automated-task-handler.d.ts.map +1 -0
- package/lib/handler/create-automated-task-handler.js +42 -0
- package/lib/handler/create-automated-task-handler.js.map +1 -0
- package/lib/handler/create-category-handler.d.ts +25 -0
- package/lib/handler/create-category-handler.d.ts.map +1 -0
- package/lib/handler/create-category-handler.js +41 -0
- package/lib/handler/create-category-handler.js.map +1 -0
- package/lib/handler/create-decision-node-handler.d.ts +9 -0
- package/lib/handler/create-decision-node-handler.d.ts.map +1 -0
- package/lib/handler/create-decision-node-handler.js +42 -0
- package/lib/handler/create-decision-node-handler.js.map +1 -0
- package/lib/handler/create-edge-handler.d.ts +22 -0
- package/lib/handler/create-edge-handler.d.ts.map +1 -0
- package/lib/handler/create-edge-handler.js +31 -0
- package/lib/handler/create-edge-handler.js.map +1 -0
- package/lib/handler/create-fork-node-handler.d.ts +6 -0
- package/lib/handler/create-fork-node-handler.d.ts.map +1 -0
- package/lib/handler/create-fork-node-handler.js +39 -0
- package/lib/handler/create-fork-node-handler.js.map +1 -0
- package/lib/handler/create-fork-or-join-node-handler.d.ts +22 -0
- package/lib/handler/create-fork-or-join-node-handler.d.ts.map +1 -0
- package/lib/handler/create-fork-or-join-node-handler.js +21 -0
- package/lib/handler/create-fork-or-join-node-handler.js.map +1 -0
- package/lib/handler/create-join-node-handler.d.ts +6 -0
- package/lib/handler/create-join-node-handler.d.ts.map +1 -0
- package/lib/handler/create-join-node-handler.js +39 -0
- package/lib/handler/create-join-node-handler.js.map +1 -0
- package/lib/handler/create-manual-task-handler.d.ts +9 -0
- package/lib/handler/create-manual-task-handler.d.ts.map +1 -0
- package/lib/handler/create-manual-task-handler.js +42 -0
- package/lib/handler/create-manual-task-handler.js.map +1 -0
- package/lib/handler/create-merge-node-handler.d.ts +9 -0
- package/lib/handler/create-merge-node-handler.d.ts.map +1 -0
- package/lib/handler/create-merge-node-handler.js +42 -0
- package/lib/handler/create-merge-node-handler.js.map +1 -0
- package/lib/handler/create-task-handler.d.ts +24 -0
- package/lib/handler/create-task-handler.d.ts.map +1 -0
- package/lib/handler/create-task-handler.js +48 -0
- package/lib/handler/create-task-handler.js.map +1 -0
- package/lib/handler/create-weighted-edge-handler.d.ts +22 -0
- package/lib/handler/create-weighted-edge-handler.d.ts.map +1 -0
- package/lib/handler/create-weighted-edge-handler.js +33 -0
- package/lib/handler/create-weighted-edge-handler.js.map +1 -0
- package/lib/handler/create-workflow-node-operation-handler.d.ts +24 -0
- package/lib/handler/create-workflow-node-operation-handler.d.ts.map +1 -0
- package/lib/handler/create-workflow-node-operation-handler.js +62 -0
- package/lib/handler/create-workflow-node-operation-handler.js.map +1 -0
- package/lib/handler/grid-snapper.d.ts +22 -0
- package/lib/handler/grid-snapper.d.ts.map +1 -0
- package/lib/handler/grid-snapper.js +20 -0
- package/lib/handler/grid-snapper.js.map +1 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/lib/labeledit/workflow-label-edit-validator.d.ts +21 -0
- package/lib/labeledit/workflow-label-edit-validator.d.ts.map +1 -0
- package/lib/labeledit/workflow-label-edit-validator.js +55 -0
- package/lib/labeledit/workflow-label-edit-validator.js.map +1 -0
- package/lib/layout/workflow-layout-configurator.d.ts +22 -0
- package/lib/layout/workflow-layout-configurator.d.ts.map +1 -0
- package/lib/layout/workflow-layout-configurator.js +38 -0
- package/lib/layout/workflow-layout-configurator.js.map +1 -0
- package/lib/marker/workflow-model-validator.d.ts +29 -0
- package/lib/marker/workflow-model-validator.d.ts.map +1 -0
- package/lib/marker/workflow-model-validator.js +150 -0
- package/lib/marker/workflow-model-validator.js.map +1 -0
- package/lib/model/workflow-navigation-target-resolver.d.ts +24 -0
- package/lib/model/workflow-navigation-target-resolver.d.ts.map +1 -0
- package/lib/model/workflow-navigation-target-resolver.js +40 -0
- package/lib/model/workflow-navigation-target-resolver.js.map +1 -0
- package/lib/provider/abstract-next-or-previous-navigation-target-provider.d.ts +29 -0
- package/lib/provider/abstract-next-or-previous-navigation-target-provider.d.ts.map +1 -0
- package/lib/provider/abstract-next-or-previous-navigation-target-provider.js +60 -0
- package/lib/provider/abstract-next-or-previous-navigation-target-provider.js.map +1 -0
- package/lib/provider/next-node-navigation-target-provider.d.ts +24 -0
- package/lib/provider/next-node-navigation-target-provider.d.ts.map +1 -0
- package/lib/provider/next-node-navigation-target-provider.js +28 -0
- package/lib/provider/next-node-navigation-target-provider.js.map +1 -0
- package/lib/provider/node-documentation-navigation-target-provider.d.ts +24 -0
- package/lib/provider/node-documentation-navigation-target-provider.d.ts.map +1 -0
- package/lib/provider/node-documentation-navigation-target-provider.js +50 -0
- package/lib/provider/node-documentation-navigation-target-provider.js.map +1 -0
- package/lib/provider/previous-node-navigation-target-provider.d.ts +24 -0
- package/lib/provider/previous-node-navigation-target-provider.d.ts.map +1 -0
- package/lib/provider/previous-node-navigation-target-provider.js +28 -0
- package/lib/provider/previous-node-navigation-target-provider.js.map +1 -0
- package/lib/provider/workflow-command-palette-action-provider.d.ts +25 -0
- package/lib/provider/workflow-command-palette-action-provider.d.ts.map +1 -0
- package/lib/provider/workflow-command-palette-action-provider.js +92 -0
- package/lib/provider/workflow-command-palette-action-provider.js.map +1 -0
- package/lib/provider/workflow-context-menu-item-provider.d.ts +21 -0
- package/lib/provider/workflow-context-menu-item-provider.d.ts.map +1 -0
- package/lib/provider/workflow-context-menu-item-provider.js +54 -0
- package/lib/provider/workflow-context-menu-item-provider.js.map +1 -0
- package/lib/util/model-types.d.ts +35 -0
- package/lib/util/model-types.d.ts.map +1 -0
- package/lib/util/model-types.js +60 -0
- package/lib/util/model-types.js.map +1 -0
- package/lib/workflow-diagram-configuration.d.ts +28 -0
- package/lib/workflow-diagram-configuration.d.ts.map +1 -0
- package/lib/workflow-diagram-configuration.js +125 -0
- package/lib/workflow-diagram-configuration.js.map +1 -0
- package/lib/workflow-diagram-module.d.ts +27 -0
- package/lib/workflow-diagram-module.d.ts.map +1 -0
- package/lib/workflow-diagram-module.js +99 -0
- package/lib/workflow-diagram-module.js.map +1 -0
- package/lib/workflow-glsp-server.d.ts +23 -0
- package/lib/workflow-glsp-server.d.ts.map +1 -0
- package/lib/workflow-glsp-server.js +54 -0
- package/lib/workflow-glsp-server.js.map +1 -0
- package/lib/workflow-model-index.d.ts +20 -0
- package/lib/workflow-model-index.d.ts.map +1 -0
- package/lib/workflow-model-index.js +43 -0
- package/lib/workflow-model-index.js.map +1 -0
- package/lib/workflow-popup-factory.d.ts +21 -0
- package/lib/workflow-popup-factory.d.ts.map +1 -0
- package/lib/workflow-popup-factory.js +54 -0
- package/lib/workflow-popup-factory.js.map +1 -0
- package/package.json +61 -0
- package/src/app.ts +35 -0
- package/src/graph-extension.ts +186 -0
- package/src/handler/create-activity-node-handler.ts +34 -0
- package/src/handler/create-automated-task-handler.ts +30 -0
- package/src/handler/create-category-handler.ts +36 -0
- package/src/handler/create-decision-node-handler.ts +30 -0
- package/src/handler/create-edge-handler.ts +25 -0
- package/src/handler/create-fork-node-handler.ts +24 -0
- package/src/handler/create-fork-or-join-node-handler.ts +26 -0
- package/src/handler/create-join-node-handler.ts +24 -0
- package/src/handler/create-manual-task-handler.ts +30 -0
- package/src/handler/create-merge-node-handler.ts +30 -0
- package/src/handler/create-task-handler.ts +38 -0
- package/src/handler/create-weighted-edge-handler.ts +27 -0
- package/src/handler/create-workflow-node-operation-handler.ts +56 -0
- package/src/handler/grid-snapper.ts +32 -0
- package/src/index.ts +19 -0
- package/src/labeledit/workflow-label-edit-validator.ts +39 -0
- package/src/layout/workflow-layout-configurator.ts +28 -0
- package/src/marker/workflow-model-validator.ts +137 -0
- package/src/model/workflow-navigation-target-resolver.ts +40 -0
- package/src/provider/abstract-next-or-previous-navigation-target-provider.ts +53 -0
- package/src/provider/next-node-navigation-target-provider.ts +31 -0
- package/src/provider/node-documentation-navigation-target-provider.ts +52 -0
- package/src/provider/previous-node-navigation-target-provider.ts +31 -0
- package/src/provider/workflow-command-palette-action-provider.ts +124 -0
- package/src/provider/workflow-context-menu-item-provider.ts +38 -0
- package/src/util/model-types.ts +55 -0
- package/src/workflow-diagram-configuration.ts +122 -0
- package/src/workflow-diagram-module.ts +107 -0
- package/src/workflow-glsp-server.ts +37 -0
- package/src/workflow-model-index.ts +31 -0
- package/src/workflow-popup-factory.ts +46 -0
|
@@ -0,0 +1,54 @@
|
|
|
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.WorkflowPopupFactory = void 0;
|
|
10
|
+
/********************************************************************************
|
|
11
|
+
* Copyright (c) 2022 STMicroelectronics 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_node_1 = require("@eclipse-glsp/server-node");
|
|
26
|
+
const graph_extension_1 = require("./graph-extension");
|
|
27
|
+
const inversify_1 = require("inversify");
|
|
28
|
+
const NL = '<br/>';
|
|
29
|
+
let WorkflowPopupFactory = class WorkflowPopupFactory {
|
|
30
|
+
createPopupModel(element, action) {
|
|
31
|
+
if (element && element instanceof graph_extension_1.TaskNode) {
|
|
32
|
+
const popupTitle = server_node_1.GPreRenderedElement.builder()
|
|
33
|
+
.id('popup-title')
|
|
34
|
+
.code(`<div class="sprotty-popup-title">${element.name}</div>`)
|
|
35
|
+
.build();
|
|
36
|
+
const popupBody = server_node_1.GPreRenderedElement.builder()
|
|
37
|
+
.id('popup-body')
|
|
38
|
+
.code(`<div class="sprotty-popup-body">${this.generateBody(element)}</div>`)
|
|
39
|
+
.build();
|
|
40
|
+
return server_node_1.GModelRoot.builder().type('html').canvasBounds(action.bounds).id('sprotty-popup').add(popupTitle).add(popupBody).build();
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
generateBody(task) {
|
|
45
|
+
return `Type: ${task.taskType} ${NL}
|
|
46
|
+
Duration: ${task.duration} ${NL}
|
|
47
|
+
Reference: ${task.references} ${NL}`;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
WorkflowPopupFactory = __decorate([
|
|
51
|
+
inversify_1.injectable()
|
|
52
|
+
], WorkflowPopupFactory);
|
|
53
|
+
exports.WorkflowPopupFactory = WorkflowPopupFactory;
|
|
54
|
+
//# sourceMappingURL=workflow-popup-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-popup-factory.js","sourceRoot":"","sources":["../src/workflow-popup-factory.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAAuI;AACvI,uDAA6C;AAC7C,yCAAuC;AAEvC,MAAM,EAAE,GAAG,OAAO,CAAC;AAGnB,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAC7B,gBAAgB,CAAC,OAAsB,EAAE,MAA+B;QACpE,IAAI,OAAO,IAAI,OAAO,YAAY,0BAAQ,EAAE;YACxC,MAAM,UAAU,GAAG,iCAAmB,CAAC,OAAO,EAAE;iBAC3C,EAAE,CAAC,aAAa,CAAC;iBACjB,IAAI,CAAC,oCAAoC,OAAO,CAAC,IAAI,QAAQ,CAAC;iBAC9D,KAAK,EAAE,CAAC;YAEb,MAAM,SAAS,GAAG,iCAAmB,CAAC,OAAO,EAAE;iBAC1C,EAAE,CAAC,YAAY,CAAC;iBAChB,IAAI,CAAC,mCAAmC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3E,KAAK,EAAE,CAAC;YAEb,OAAO,wBAAU,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;SACnI;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAEO,YAAY,CAAC,IAAc;QAC/B,OAAO,SAAS,IAAI,CAAC,QAAQ,IAAI,EAAE;wBACnB,IAAI,CAAC,QAAQ,IAAI,EAAE;yBAClB,IAAI,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC;IAC7C,CAAC;CACJ,CAAA;AAvBY,oBAAoB;IADhC,sBAAU,EAAE;GACA,oBAAoB,CAuBhC;AAvBY,oDAAoB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eclipse-glsp-examples/workflow-server",
|
|
3
|
+
"version": "0.9.0-next.397cddd.4+397cddd",
|
|
4
|
+
"description": "GLSP node server for the workflow example",
|
|
5
|
+
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"eclipse",
|
|
8
|
+
"graphics",
|
|
9
|
+
"diagram",
|
|
10
|
+
"modeling",
|
|
11
|
+
"visualization",
|
|
12
|
+
"glsp",
|
|
13
|
+
"diagram editor"
|
|
14
|
+
],
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Eclipse GLSP"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://www.eclipse.org/glsp/",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/eclipse-glsp/glsp-server-node.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": "https://github.com/eclipse-glsp/glsp/issues",
|
|
24
|
+
"contributors": [
|
|
25
|
+
{
|
|
26
|
+
"name": "STMicroelectronics",
|
|
27
|
+
"url": "https://www.st.com/"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "Eclipse GLSP Project",
|
|
31
|
+
"email": "glsp-dev@eclipse.org",
|
|
32
|
+
"url": "https://projects.eclipse.org/projects/ecd.glsp"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"lib",
|
|
37
|
+
"src"
|
|
38
|
+
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@eclipse-glsp/layout-elk": "0.9.0-next.397cddd.4+397cddd",
|
|
41
|
+
"@eclipse-glsp/server-node": "0.9.0-next.397cddd.4+397cddd"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"typescript": "^3.9.2"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"clean": "rimraf lib",
|
|
48
|
+
"build": "yarn run clean && tsc",
|
|
49
|
+
"test": "",
|
|
50
|
+
"lint": "eslint -c ../../.eslintrc.js --ext .ts,.tsx ./src",
|
|
51
|
+
"lint:fix": "eslint --fix -c ../../.eslintrc.js --ext .ts,.tsx ./src",
|
|
52
|
+
"watch": "tsc -w",
|
|
53
|
+
"start:server": "yarn ts-node src/index.ts"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"main": "lib/index",
|
|
59
|
+
"types": "lib/index",
|
|
60
|
+
"gitHead": "397cddd532e9596bbe3717d931ae5ca826d949dd"
|
|
61
|
+
}
|
package/src/app.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { configureELKLayoutModule } from '@eclipse-glsp/layout-elk';
|
|
17
|
+
import { createAppModule, createSocketCliParser, LoggerFactory, resolveAndCatch, SocketServerLauncher } from '@eclipse-glsp/server-node';
|
|
18
|
+
import { Container } from 'inversify';
|
|
19
|
+
import { WorkflowLayoutConfigurator } from './layout/workflow-layout-configurator';
|
|
20
|
+
import { WorkflowDiagramModule, WorkflowServerModule } from './workflow-diagram-module';
|
|
21
|
+
|
|
22
|
+
export function launch(argv?: string[]): void {
|
|
23
|
+
const options = createSocketCliParser().parse(argv);
|
|
24
|
+
const appContainer = new Container();
|
|
25
|
+
appContainer.load(createAppModule(options));
|
|
26
|
+
|
|
27
|
+
const logger = appContainer.get<LoggerFactory>(LoggerFactory)('WorkflowServerApp');
|
|
28
|
+
const launcher = appContainer.resolve(SocketServerLauncher);
|
|
29
|
+
const elkLayoutModule = configureELKLayoutModule({ algorithms: ['layered'], layoutConfigurator: WorkflowLayoutConfigurator });
|
|
30
|
+
const serverModule = new WorkflowServerModule().configureDiagramModule(new WorkflowDiagramModule(), elkLayoutModule);
|
|
31
|
+
|
|
32
|
+
const errorHandler = (error: any): void => logger.error('Error in workflow server launcher:', error);
|
|
33
|
+
launcher.configure(serverModule);
|
|
34
|
+
resolveAndCatch(() => launcher.start({ port: options.port, host: options.host }), errorHandler);
|
|
35
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import {
|
|
17
|
+
Args,
|
|
18
|
+
ArgsUtil,
|
|
19
|
+
GCompartment,
|
|
20
|
+
GCompartmentBuilder,
|
|
21
|
+
GEdge,
|
|
22
|
+
GEdgeBuilder,
|
|
23
|
+
GLabel,
|
|
24
|
+
GLabelBuilder,
|
|
25
|
+
GNode,
|
|
26
|
+
GNodeBuilder
|
|
27
|
+
} from '@eclipse-glsp/server-node';
|
|
28
|
+
import { ModelTypes } from './util/model-types';
|
|
29
|
+
|
|
30
|
+
export class ActivityNode extends GNode {
|
|
31
|
+
nodeType: string;
|
|
32
|
+
|
|
33
|
+
static builder(): ActivityNodeBuilder {
|
|
34
|
+
return new ActivityNodeBuilder(ActivityNode);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class ActivityNodeBuilder<T extends ActivityNode = ActivityNode> extends GNodeBuilder<T> {
|
|
39
|
+
nodeType(nodeType: string): this {
|
|
40
|
+
this.proxy.nodeType = nodeType;
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class TaskNode extends GNode {
|
|
46
|
+
name: string;
|
|
47
|
+
duration: number;
|
|
48
|
+
taskType: string;
|
|
49
|
+
references: string;
|
|
50
|
+
|
|
51
|
+
static builder(): TaskNodeBuilder {
|
|
52
|
+
return new TaskNodeBuilder(TaskNode).layout('vbox').addArgs(ArgsUtil.cornerRadius(5));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class TaskNodeBuilder<T extends TaskNode = TaskNode> extends GNodeBuilder<T> {
|
|
57
|
+
name(name: string): this {
|
|
58
|
+
this.proxy.name = name;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
duration(duration: number): this {
|
|
63
|
+
this.proxy.duration = duration;
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
taskType(tasktype: string): this {
|
|
68
|
+
this.proxy.taskType = tasktype;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
references(references: string): this {
|
|
73
|
+
this.proxy.references = references;
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
children(): this {
|
|
78
|
+
this.proxy.children.push(this.createCompartment());
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
protected createCompartment(): GCompartment {
|
|
83
|
+
const layoutOptions: Args = {};
|
|
84
|
+
return new GCompartmentBuilder(GCompartment)
|
|
85
|
+
.type(ModelTypes.COMP_HEADER)
|
|
86
|
+
.id(this.proxy.id + '_header')
|
|
87
|
+
.layout('hbox')
|
|
88
|
+
.addLayoutOptions(layoutOptions)
|
|
89
|
+
.add(this.createCompartmentIcon())
|
|
90
|
+
.add(this.createCompartmentHeader())
|
|
91
|
+
.build();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
protected createCompartmentHeader(): GLabel {
|
|
95
|
+
return new GLabelBuilder(GLabel)
|
|
96
|
+
.type(ModelTypes.LABEL_HEADING)
|
|
97
|
+
.id(this.proxy.id + '_classname')
|
|
98
|
+
.text(this.proxy.name)
|
|
99
|
+
.build();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
protected createCompartmentIcon(): GCompartment {
|
|
103
|
+
return new GCompartmentBuilder(GCompartment)
|
|
104
|
+
.type(ModelTypes.ICON)
|
|
105
|
+
.id(this.proxy.id + '_icon')
|
|
106
|
+
.layout('stack')
|
|
107
|
+
.addLayoutOptions({ hAlign: 'center', resizeContainer: false })
|
|
108
|
+
.add(this.createCompartmentIconLabel())
|
|
109
|
+
.build();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
protected createCompartmentIconLabel(): GLabel {
|
|
113
|
+
return new GLabelBuilder(GLabel)
|
|
114
|
+
.type(ModelTypes.LABEL_ICON)
|
|
115
|
+
.id(this.proxy.id + '_ticon')
|
|
116
|
+
.text(`${this.proxy.taskType.toUpperCase().charAt(0)}`)
|
|
117
|
+
.build();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export class WeightedEdge extends GEdge {
|
|
122
|
+
probability?: string;
|
|
123
|
+
|
|
124
|
+
static builder(): WeightedEdgeBuilder {
|
|
125
|
+
return new WeightedEdgeBuilder(WeightedEdge).type(ModelTypes.WEIGHTED_EDGE);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export class WeightedEdgeBuilder<E extends WeightedEdge = WeightedEdge> extends GEdgeBuilder<E> {
|
|
130
|
+
probability(probability: string): this {
|
|
131
|
+
this.proxy.probability = probability;
|
|
132
|
+
return this;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export class Category extends ActivityNode {
|
|
137
|
+
name: string;
|
|
138
|
+
|
|
139
|
+
static builder(): CategoryNodeBuilder {
|
|
140
|
+
return new CategoryNodeBuilder(Category)
|
|
141
|
+
.layout('vbox')
|
|
142
|
+
.addLayoutOptions({ hAlign: 'center', hGrab: false, vGrab: false })
|
|
143
|
+
.addCssClass('category');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export class CategoryNodeBuilder<T extends Category = Category> extends ActivityNodeBuilder<T> {
|
|
148
|
+
name(name: string): this {
|
|
149
|
+
this.proxy.name = name;
|
|
150
|
+
return this;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
children(): this {
|
|
154
|
+
this.proxy.children.push(this.createLabelCompartment());
|
|
155
|
+
this.proxy.children.push(this.createStructCompartment());
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
protected createLabelCompartment(): GCompartment {
|
|
160
|
+
const layoutOptions: Args = {};
|
|
161
|
+
return new GCompartmentBuilder(GCompartment)
|
|
162
|
+
.type(ModelTypes.COMP_HEADER)
|
|
163
|
+
.id(this.proxy.id + '_header')
|
|
164
|
+
.layout('hbox')
|
|
165
|
+
.addLayoutOptions(layoutOptions)
|
|
166
|
+
.add(this.createCompartmentHeader())
|
|
167
|
+
.build();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
protected createCompartmentHeader(): GLabel {
|
|
171
|
+
return new GLabelBuilder(GLabel)
|
|
172
|
+
.type(ModelTypes.LABEL_HEADING)
|
|
173
|
+
.id(this.proxy.id + '_classname')
|
|
174
|
+
.text(this.proxy.name)
|
|
175
|
+
.build();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
protected createStructCompartment(): GCompartment {
|
|
179
|
+
return new GCompartmentBuilder(GCompartment)
|
|
180
|
+
.type(ModelTypes.STRUCTURE)
|
|
181
|
+
.id(this.proxy.id + '_struct')
|
|
182
|
+
.layout('freeform')
|
|
183
|
+
.addLayoutOptions({ hAlign: 'left', hGrab: true, vGrab: true })
|
|
184
|
+
.build();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { Point, Args, GNode, GModelState, ORIGIN_POINT } from '@eclipse-glsp/server-node';
|
|
17
|
+
import { CreateWorkflowNodeOperationHandler } from './create-workflow-node-operation-handler';
|
|
18
|
+
import { injectable } from 'inversify';
|
|
19
|
+
import { ActivityNode, ActivityNodeBuilder } from '../graph-extension';
|
|
20
|
+
import { ModelTypes } from '../util/model-types';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export abstract class CreateActivityNodeHandler extends CreateWorkflowNodeOperationHandler {
|
|
24
|
+
createNode(relativeLocation: Point | undefined, args: Args | undefined): GNode | undefined {
|
|
25
|
+
return this.builder(relativeLocation, this.modelState).build();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
protected builder(point: Point | undefined, modelState: GModelState): ActivityNodeBuilder {
|
|
29
|
+
return ActivityNode.builder()
|
|
30
|
+
.position(point ?? ORIGIN_POINT)
|
|
31
|
+
.type(this.elementTypeIds[0])
|
|
32
|
+
.nodeType(ModelTypes.toNodeType(this.elementTypeIds[0]));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ModelTypes } from '../util/model-types';
|
|
17
|
+
import { CreateTaskHandler } from './create-task-handler';
|
|
18
|
+
import { injectable } from 'inversify';
|
|
19
|
+
import { Point, GModelState } from '@eclipse-glsp/server-node';
|
|
20
|
+
import { TaskNodeBuilder } from '../graph-extension';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export class CreateAutomatedTaskHandler extends CreateTaskHandler {
|
|
24
|
+
elementTypeIds = [ModelTypes.AUTOMATED_TASK];
|
|
25
|
+
label = 'Automated Task';
|
|
26
|
+
|
|
27
|
+
protected builder(point: Point | undefined, modelState: GModelState): TaskNodeBuilder {
|
|
28
|
+
return super.builder(point, modelState).addCssClass('automated');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { Point, Args, GNode, GModelState, ORIGIN_POINT } from '@eclipse-glsp/server-node';
|
|
17
|
+
import { Category, CategoryNodeBuilder } from '../graph-extension';
|
|
18
|
+
import { ModelTypes } from '../util/model-types';
|
|
19
|
+
import { CreateWorkflowNodeOperationHandler } from './create-workflow-node-operation-handler';
|
|
20
|
+
|
|
21
|
+
export class CreateCategoryHandler extends CreateWorkflowNodeOperationHandler {
|
|
22
|
+
elementTypeIds = [ModelTypes.CATEGORY];
|
|
23
|
+
label = 'Category';
|
|
24
|
+
|
|
25
|
+
createNode(relativeLocation: Point | undefined, args: Args | undefined): GNode | undefined {
|
|
26
|
+
return this.builder(relativeLocation, this.modelState).build();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
protected builder(point: Point | undefined, modelState: GModelState): CategoryNodeBuilder {
|
|
30
|
+
return Category.builder()
|
|
31
|
+
.type(this.elementTypeIds[0])
|
|
32
|
+
.position(point ?? ORIGIN_POINT)
|
|
33
|
+
.name(this.label.replace(' ', '') + this.modelState.index.getAllByClass(Category).length)
|
|
34
|
+
.children();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ModelTypes } from '../util/model-types';
|
|
17
|
+
import { injectable } from 'inversify';
|
|
18
|
+
import { CreateActivityNodeHandler } from './create-activity-node-handler';
|
|
19
|
+
import { GModelState, Point } from '@eclipse-glsp/server-node';
|
|
20
|
+
import { ActivityNodeBuilder } from '../graph-extension';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export class CreateDecisionNodeHandler extends CreateActivityNodeHandler {
|
|
24
|
+
elementTypeIds = [ModelTypes.DECISION_NODE];
|
|
25
|
+
label = 'Decision Node';
|
|
26
|
+
|
|
27
|
+
protected builder(point: Point | undefined, modelState: GModelState): ActivityNodeBuilder {
|
|
28
|
+
return super.builder(point, modelState).addCssClass('decision');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { CreateEdgeOperationHandler, DefaultTypes, GEdge, GEdgeBuilder, GModelElement, GModelState } from '@eclipse-glsp/server-node';
|
|
17
|
+
|
|
18
|
+
export class CreateEdgeHandler extends CreateEdgeOperationHandler {
|
|
19
|
+
label = 'Edge';
|
|
20
|
+
elementTypeIds = [DefaultTypes.EDGE];
|
|
21
|
+
|
|
22
|
+
createEdge(source: GModelElement, target: GModelElement, modelState: GModelState): GEdge | undefined {
|
|
23
|
+
return new GEdgeBuilder(GEdge).sourceId(source.id).targetId(target.id).build();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ModelTypes } from '../util/model-types';
|
|
17
|
+
import { CreateForkOrJoinNodeHandler } from './create-fork-or-join-node-handler';
|
|
18
|
+
import { injectable } from 'inversify';
|
|
19
|
+
|
|
20
|
+
@injectable()
|
|
21
|
+
export class CreateForkNodeHandler extends CreateForkOrJoinNodeHandler {
|
|
22
|
+
elementTypeIds = [ModelTypes.FORK_NODE];
|
|
23
|
+
label = 'Fork Node';
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { Point, GModelState } from '@eclipse-glsp/server-node';
|
|
17
|
+
import { CreateActivityNodeHandler } from './create-activity-node-handler';
|
|
18
|
+
import { injectable } from 'inversify';
|
|
19
|
+
import { ActivityNodeBuilder } from '../graph-extension';
|
|
20
|
+
|
|
21
|
+
@injectable()
|
|
22
|
+
export abstract class CreateForkOrJoinNodeHandler extends CreateActivityNodeHandler {
|
|
23
|
+
protected builder(point: Point | undefined, modelState: GModelState): ActivityNodeBuilder {
|
|
24
|
+
return super.builder(point, modelState).addCssClass('forkOrJoin').size(10, 50);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ModelTypes } from '../util/model-types';
|
|
17
|
+
import { CreateForkOrJoinNodeHandler } from './create-fork-or-join-node-handler';
|
|
18
|
+
import { injectable } from 'inversify';
|
|
19
|
+
|
|
20
|
+
@injectable()
|
|
21
|
+
export class CreateJoinNodeHandler extends CreateForkOrJoinNodeHandler {
|
|
22
|
+
elementTypeIds = [ModelTypes.JOIN_NODE];
|
|
23
|
+
label = 'Join Node';
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ModelTypes } from '../util/model-types';
|
|
17
|
+
import { CreateTaskHandler } from './create-task-handler';
|
|
18
|
+
import { injectable } from 'inversify';
|
|
19
|
+
import { Point, GModelState } from '@eclipse-glsp/server-node';
|
|
20
|
+
import { TaskNodeBuilder } from '../graph-extension';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export class CreateManualTaskHandler extends CreateTaskHandler {
|
|
24
|
+
elementTypeIds = [ModelTypes.MANUAL_TASK];
|
|
25
|
+
label = 'Manual Task';
|
|
26
|
+
|
|
27
|
+
protected builder(point: Point | undefined, modelState: GModelState): TaskNodeBuilder {
|
|
28
|
+
return super.builder(point, modelState).addCssClass('manual');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ModelTypes } from '../util/model-types';
|
|
17
|
+
import { injectable } from 'inversify';
|
|
18
|
+
import { CreateActivityNodeHandler } from './create-activity-node-handler';
|
|
19
|
+
import { GModelState, Point } from '@eclipse-glsp/server-node';
|
|
20
|
+
import { ActivityNodeBuilder } from '../graph-extension';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export class CreateMergeNodeHandler extends CreateActivityNodeHandler {
|
|
24
|
+
elementTypeIds = [ModelTypes.MERGE_NODE];
|
|
25
|
+
label = 'Merge Node';
|
|
26
|
+
|
|
27
|
+
protected builder(point: Point | undefined, modelState: GModelState): ActivityNodeBuilder {
|
|
28
|
+
return super.builder(point, modelState).addCssClass('merge');
|
|
29
|
+
}
|
|
30
|
+
}
|