Skip to content

Commit

Permalink
Merge branch 'open-bpmn-1.0'
Browse files Browse the repository at this point in the history
issue #305
  • Loading branch information
rsoika committed Nov 1, 2023
2 parents ee8040f + 18c3632 commit 45de0d6
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 97 deletions.
2 changes: 1 addition & 1 deletion open-bpmn.glsp-client/lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
},
"publish": {
"registry": "https://registry.npmjs.org/"
}
}
}
17 changes: 8 additions & 9 deletions open-bpmn.glsp-client/open-bpmn-app/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
}
}
}
27 changes: 19 additions & 8 deletions open-bpmn.glsp-client/open-bpmn-glsp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
10 changes: 8 additions & 2 deletions open-bpmn.glsp-client/open-bpmn-model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
33 changes: 17 additions & 16 deletions open-bpmn.glsp-client/open-bpmn-properties/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
20 changes: 12 additions & 8 deletions open-bpmn.glsp-client/open-bpmn-theia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
]
}
}
44 changes: 22 additions & 22 deletions open-bpmn.glsp-client/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 1 addition & 1 deletion open-bpmn.glsp-server/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Lane> 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 {
Expand Down Expand Up @@ -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<Lane> orderLaneList = new ArrayList<>();
orderLaneList.addAll(participant.getBpmnProcess().getLanes());
// Sort the list based on the 'y' attribute
Collections.sort(orderLaneList, new Comparator<Lane>() {
@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<Lane> 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
*
Expand Down
Loading

0 comments on commit 45de0d6

Please sign in to comment.