diff --git a/open-bpmn.glsp-client/lerna.json b/open-bpmn.glsp-client/lerna.json index 1b3696e4..7cc02404 100644 --- a/open-bpmn.glsp-client/lerna.json +++ b/open-bpmn.glsp-client/lerna.json @@ -9,5 +9,5 @@ }, "publish": { "registry": "https://registry.npmjs.org/" - } + } } diff --git a/open-bpmn.glsp-client/open-bpmn-app/package.json b/open-bpmn.glsp-client/open-bpmn-app/package.json index 91a2aaf5..b5017f22 100644 --- a/open-bpmn.glsp-client/open-bpmn-app/package.json +++ b/open-bpmn.glsp-client/open-bpmn-app/package.json @@ -1,9 +1,15 @@ { - "private": true, "name": "open-bpmn-app", "version": "1.2.0", "description": "Web App for Open BPMN", "license": "(GPL-3.0)", + "scripts": { + "build": "theia build --mode development", + "prepare": "yarn build", + "start": "theia start --GLSP_PORT=5007 --root-dir=../workspace", + "start:external": "theia start --GLSP_PORT=5007 --root-dir=../workspace --debug", + "watch": "theia build --watch --mode development" + }, "dependencies": { "@open-bpmn/open-bpmn-theia": "1.2.0", "@theia/core": "1.39.0-next.20", @@ -22,14 +28,7 @@ "devDependencies": { "@theia/cli": "1.39.0-next.20" }, - "scripts": { - "build": "theia build --mode development", - "prepare": "yarn build", - "start": "theia start --GLSP_PORT=5007 --root-dir=../workspace", - "start:external": "theia start --GLSP_PORT=5007 --root-dir=../workspace --debug", - "watch": "theia build --watch --mode development" - }, "theia": { "target": "browser" } -} +} \ No newline at end of file diff --git a/open-bpmn.glsp-client/open-bpmn-glsp/package.json b/open-bpmn.glsp-client/open-bpmn-glsp/package.json index 2918d8e2..c3379910 100644 --- a/open-bpmn.glsp-client/open-bpmn-glsp/package.json +++ b/open-bpmn.glsp-client/open-bpmn-glsp/package.json @@ -2,21 +2,21 @@ "name": "@open-bpmn/open-bpmn-glsp", "version": "1.2.0", "description": "GLSP diagrams for BPMN 2.0", - "license": "(GPL-3.0)", "keywords": [ "glsp", "bpmn", "diagram" ], - "author": { - "name": "Imixs Workflow" - }, "homepage": "https://www.imixs.org/", + "bugs": "https://github.com/imixs/open-bpmn/issues", "repository": { "type": "git", "url": "https://github.com/imixs/open-bpmn.git" }, - "bugs": "https://github.com/imixs/open-bpmn/issues", + "license": "(GPL-3.0)", + "author": { + "name": "Imixs Workflow" + }, "contributors": [ { "name": "Ralph Soika", @@ -41,6 +41,17 @@ "src", "css" ], - "main": "lib/index", - "types": "lib/index" -} + "scripts": { + "build": "tsc", + "clean": "rimraf lib tsconfig.tsbuildinfo", + "lint": "eslint --ext .ts,.tsx ./src", + "prepare": "yarn clean && yarn build && yarn lint", + "watch": "tsc -w" + }, + "dependencies": { + "@eclipse-glsp/client": "1.1.0-RC10", + "@open-bpmn/open-bpmn-model": "1.0.4", + "@open-bpmn/open-bpmn-properties": "1.0.4", + "balloon-css": "^0.5.0" + } +} \ No newline at end of file diff --git a/open-bpmn.glsp-client/open-bpmn-model/package.json b/open-bpmn.glsp-client/open-bpmn-model/package.json index 2d2839b4..bb34ee37 100644 --- a/open-bpmn.glsp-client/open-bpmn-model/package.json +++ b/open-bpmn.glsp-client/open-bpmn-model/package.json @@ -3,11 +3,17 @@ "version": "1.2.0", "description": "GLSP model for BPMN 2.0", "license": "(GPL-3.0)", + "main": "lib/index", + "types": "lib/index", + "files": [ + "lib", + "src" + ], "scripts": { - "prepare": "yarn clean && yarn build && yarn lint", - "clean": "rimraf lib tsconfig.tsbuildinfo", "build": "tsc", + "clean": "rimraf lib tsconfig.tsbuildinfo", "lint": "eslint -c ../.eslintrc.js --ext .ts,.tsx ./src", + "prepare": "yarn clean && yarn build && yarn lint", "watch": "tsc -w" }, "dependencies": { diff --git a/open-bpmn.glsp-client/open-bpmn-properties/package.json b/open-bpmn.glsp-client/open-bpmn-properties/package.json index 9d68a904..0f0e76a9 100644 --- a/open-bpmn.glsp-client/open-bpmn-properties/package.json +++ b/open-bpmn.glsp-client/open-bpmn-properties/package.json @@ -3,26 +3,27 @@ "version": "1.2.0", "description": "GLSP property panel for BPMN 2.0", "license": "(GPL-3.0)", + "main": "lib/index", + "types": "lib/index", + "files": [ + "lib", + "src", + "css" + ], + "scripts": { + "build": "tsc", + "clean": "rimraf lib tsconfig.tsbuildinfo", + "lint": "eslint -c ../.eslintrc.js --ext .ts,.tsx ./src", + "prepare": "yarn clean && yarn build && yarn lint", + "watch": "tsc -w" + }, "dependencies": { "@eclipse-glsp/client": "2.0.0", "@open-bpmn/open-bpmn-model": "1.2.0", "@jsonforms/core": "3.0.0", "@jsonforms/react": "3.0.0", "@jsonforms/vanilla-renderers": "3.0.0", + "@open-bpmn/open-bpmn-model": "1.0.4", "balloon-css": "^0.5.0" - }, - "scripts": { - "prepare": "yarn clean && yarn build && yarn lint", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "build": "tsc", - "lint": "eslint -c ../.eslintrc.js --ext .ts,.tsx ./src", - "watch": "tsc -w" - }, - "files": [ - "lib", - "src", - "css" - ], - "main": "lib/index", - "types": "lib/index" -} + } +} \ No newline at end of file diff --git a/open-bpmn.glsp-client/open-bpmn-theia/package.json b/open-bpmn.glsp-client/open-bpmn-theia/package.json index 9614ac2b..0ba5b99e 100644 --- a/open-bpmn.glsp-client/open-bpmn-theia/package.json +++ b/open-bpmn.glsp-client/open-bpmn-theia/package.json @@ -2,19 +2,19 @@ "name": "@open-bpmn/open-bpmn-theia", "version": "1.2.0", "description": "Theia extension for the BPMN GLSP Client", - "license": "(GPL-3.0)", "keywords": [ "theia-extension" ], - "author": { - "name": "Imixs Workflow" - }, "homepage": "https://www.imixs.org/", + "bugs": "https://github.com/imixs/open-bpmn/issues", "repository": { "type": "git", "url": "https://github.com/imixs/open-bpmn.git" }, - "bugs": "https://github.com/imixs/open-bpmn/issues", + "license": "(GPL-3.0)", + "author": { + "name": "Imixs Workflow" + }, "contributors": [ { "name": "Ralph Soika", @@ -31,16 +31,20 @@ "@eclipse-glsp/theia-integration": "2.0.0" }, "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "rimraf lib tsconfig.tsbuildinfo", "build": "tsc && yarn run lint", + "clean": "rimraf lib tsconfig.tsbuildinfo", "lint": "eslint --ext .ts,.tsx ./src", + "prepare": "yarn run clean && yarn run build", "watch": "tsc -w" }, + "dependencies": { + "@eclipse-glsp/theia-integration": "1.1.0-RC10", + "@open-bpmn/open-bpmn-glsp": "1.0.4" + }, "theiaExtensions": [ { "frontend": "lib/browser/bpmn-frontend-module", "backend": "lib/node/bpmn-backend-module" } ] -} +} \ No newline at end of file diff --git a/open-bpmn.glsp-client/package.json b/open-bpmn.glsp-client/package.json index 775fc516..1b6d41b6 100644 --- a/open-bpmn.glsp-client/package.json +++ b/open-bpmn.glsp-client/package.json @@ -1,49 +1,49 @@ { - "private": true, "name": "parent", "version": "1.2.0", "description": "Open BPMN 2.0", - "license": "EPL-2.0", - "engines": { - "yarn": ">=1.7.0 <2.x.x", - "node": ">=14.18.0" - }, - "author": { - "name": "Imixs Workflow" - }, "homepage": "https://www.imixs.org/", + "bugs": "https://github.com/imixs/open-bpmn/issues", "repository": { "type": "git", "url": "https://github.com/imixs/open-bpmn.git" }, - "bugs": "https://github.com/imixs/open-bpmn/issues", + "license": "EPL-2.0", + "author": { + "name": "Imixs Workflow" + }, "contributors": [ { "name": "Ralph Soika", "email": "ralph.soika@imixs.com" } ], + "workspaces": [ + "open-bpmn-model", + "open-bpmn-properties", + "open-bpmn-glsp", + "open-bpmn-theia", + "open-bpmn-app" + ], "scripts": { - "prepare": "lerna run prepare", - "watch": "lerna run --parallel watch", "build": "yarn install:only && lerna run build", - "lint": "yarn install:only && lerna run lint --", "install:only": "yarn install --ignore-scripts", + "lint": "yarn install:only && lerna run lint --", + "prepare": "lerna run prepare", "rebuild:browser": "theia rebuild:browser", "start": "yarn rebuild:browser && yarn --cwd open-bpmn-app start", - "start:external": "yarn rebuild:browser && yarn --cwd open-bpmn-app start:external" + "start:external": "yarn rebuild:browser && yarn --cwd open-bpmn-app start:external", + "watch": "lerna run --parallel watch" }, "devDependencies": { "@eclipse-glsp/config": "2.0.0", "rimraf": "^2.6.1", "lerna": "^6.1.0", + "rimraf": "^2.6.1", "typescript": "^4.9.3" }, - "workspaces": [ - "open-bpmn-model", - "open-bpmn-properties", - "open-bpmn-glsp", - "open-bpmn-theia", - "open-bpmn-app" - ] -} + "engines": { + "node": ">=14.18.0", + "yarn": ">=1.7.0 <2.x.x" + } +} \ No newline at end of file diff --git a/open-bpmn.glsp-server/META-INF/MANIFEST.MF b/open-bpmn.glsp-server/META-INF/MANIFEST.MF index a02f5f3c..da71e30a 100644 --- a/open-bpmn.glsp-server/META-INF/MANIFEST.MF +++ b/open-bpmn.glsp-server/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: open-bpmn.glsp-server;singleton:=true Automatic-Module-Name: open-bpmn.glsp-server -Bundle-Version: 1.0.3.qualifier +Bundle-Version: 1.0.4.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/open-bpmn.glsp-server/src/main/java/org/openbpmn/glsp/model/BPMNGModelFactory.java b/open-bpmn.glsp-server/src/main/java/org/openbpmn/glsp/model/BPMNGModelFactory.java index a2e4af9f..7688bd42 100644 --- a/open-bpmn.glsp-server/src/main/java/org/openbpmn/glsp/model/BPMNGModelFactory.java +++ b/open-bpmn.glsp-server/src/main/java/org/openbpmn/glsp/model/BPMNGModelFactory.java @@ -232,36 +232,8 @@ public GGraph buildGGraph(final BPMNModel model) { applyBPMNElementExtensions(pool, participant); // apply lane-divider - if (participant.getBpmnProcess().getLanes().size() > 1) { - // add a divider between each lane - - double poolYPos = participant.getBounds().getPosition().getY(); - - Iterator laneIterator = participant.getBpmnProcess().getLanes().iterator(); - Lane currentLane = laneIterator.next(); - while (currentLane != null) { - Lane nextLane = null; - if (!laneIterator.hasNext()) { - break; // skip last lane - } - nextLane = laneIterator.next(); - double laneYPos = currentLane.getBounds().getPosition().getY() - poolYPos; - double laneHeight = currentLane.getBounds().getDimension().getHeight(); - double laneDividerYPos = laneYPos + laneHeight - 1; - double laneMinYPos = laneDividerYPos - laneHeight + Lane.MIN_HEIGHT; - double laneMaxYPos = laneDividerYPos + nextLane.getBounds().getDimension().getHeight() - - Lane.MIN_HEIGHT; - pool.getChildren() - .add(BPMNGModelUtil.createLaneDivider(participant, laneDividerYPos, - laneMinYPos, - laneMaxYPos, - currentLane.getId(), - nextLane.getId())); - - currentLane = nextLane; - } + addLaneDividers(participant, pool); - } gRootNodeList.add(pool); poolGNodeList.put(participant.getId(), pool); } else { @@ -330,6 +302,68 @@ public GGraph buildGGraph(final BPMNModel model) { return newGModel; } + /** + * This helper method adds the gLaneDividers to a pool. + * The method takes care about the issue #304, that the order of a LaneSet must + * not necessarily be the same as the visual position. For this reason the + * method first sorts the lanes by its y-position and later computes the correct + * divider position. This is just a GNode Display problem and has nothing to do + * with the BPMN meta model + * + * @param participant + * @param pool + * @throws BPMNMissingElementException + */ + private void addLaneDividers(Participant participant, PoolGNode pool) throws BPMNMissingElementException { + if (participant.getBpmnProcess().getLanes().size() > 1) { + // add a divider between each lane + double poolYPos = participant.getBounds().getPosition().getY(); + // Issue #304: + // The lane order must not necessarily be the same as the visual position + // For this reason we first sort the lanes by its y-position to compute + // the laneDivider positions correctly. + List orderLaneList = new ArrayList<>(); + orderLaneList.addAll(participant.getBpmnProcess().getLanes()); + // Sort the list based on the 'y' attribute + Collections.sort(orderLaneList, new Comparator() { + @Override + public int compare(Lane obj1, Lane obj2) { + try { + double y1 = obj1.getBounds().getPosition().getY(); + double y2 = obj2.getBounds().getPosition().getY(); + return Double.compare(y1, y2); + } catch (BPMNMissingElementException e) { + return 0; + } + } + }); + + // now we can iterate the ordered list of lanes to compute the divider positions + Iterator laneIterator = orderLaneList.iterator(); + Lane currentLane = laneIterator.next(); + while (currentLane != null) { + Lane nextLane = null; + if (!laneIterator.hasNext()) { + break; // skip last lane + } + nextLane = laneIterator.next(); + double laneYPos = currentLane.getBounds().getPosition().getY() - poolYPos; + double laneHeight = currentLane.getBounds().getDimension().getHeight(); + double laneDividerYPos = laneYPos + laneHeight - 1; + double laneMinYPos = laneDividerYPos - laneHeight + Lane.MIN_HEIGHT; + double laneMaxYPos = laneDividerYPos + nextLane.getBounds().getDimension().getHeight() + - Lane.MIN_HEIGHT; + pool.getChildren() + .add(BPMNGModelUtil.createLaneDivider(participant, laneDividerYPos, + laneMinYPos, + laneMaxYPos, + currentLane.getId(), + nextLane.getId())); + currentLane = nextLane; + } + } + } + /** * Helper method that findes a specific GNode in a GNodeList * diff --git a/pom.xml b/pom.xml index 96f12dc4..e119958d 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ terms of the Eclipse Public License v. 2.0 scm:git:git@github.com:imixs/open-bpmn.git scm:git:git@github.com:imixs/open-bpmn.git https://github.com/imixs/open-bpmn/ - open-bpmn-1.0.3 + open-bpmn-1.0.4