Giter VIP home page Giter VIP logo

bpmn-layout-generators's Introduction

BPMN Layout Generators


GitHub release (latest by date including pre-releases Build
Contributor Covenant License

⚠️ THIS IS AN EXPERIMENTAL PROJECT ⚠️

Tools for generating the graphical layout of the BPMN process (BPMNDI Graphical Model) in BPMN files. They can be used with diagrams containing only the BPMN Semantic part or to replace the existing BPMNDI part.

Plan work for the 1st implementations

Implementations

  • java
  • R This is only a wrapper of the java library

Existing alternatives

Java

Javascript

License

bpmn-layout-generators is released under the Apache 2.0 license.
Copyright © 2020-present, Bonitasoft S.A.

bpmn-layout-generators's People

Contributors

baptistemesta avatar csouchet avatar dependabot[bot] avatar oanesini avatar passga avatar tbouffard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

lzgabel takewiki

bpmn-layout-generators's Issues

Extraction of event logs

Hello Bonitasoft Team,

I have executted my process several time and I would like to extract my event logs for process analytics but don't know how to. Could you give a step by step guide? Please

[FEAT] support new csv format

"","from","to","from_id","to_id","value"
"1","ARTIFICIAL_START","Start1",2,10,6
"2","Credit vacation available","Update vacation request status",3,11,2
"3","End1","ARTIFICIAL_END",4,1,2
"4","Gateway1","Send message to cancel request",5,9,6
"5","Gateway2","Get vacation available",6,8,6
"6","Gateway3","End1",7,4,2
"7","Get vacation available","ARTIFICIAL_END",8,1,4
"8","Get vacation available","Credit vacation available",8,3,2
"9","Send message to cancel request","Gateway2",9,6,6
"10","Start1","Gateway1",10,5,6
"11","Update vacation request status","Gateway3",11,7,2

[FEAT] Improve edge layout for incoming/outgoing edges of gateways

Is your feature request related to a problem? Please describe.
With v1.0.2, outgoing edges of a gateways overlap incoming edges.

Examples generated with https://github.com/process-analytics/bpmn-visualization-pm4py:

layout-process-analytics
image

Describe the solution you'd like
For gateway, the layout of outgoing edges could always start with an horizontal line, then when needed to top or bottom then horizontal lines.

Example with diagram.bpmn.txt:

current proposal
01_current 02_proposal

Describe alternatives you've considered
#58 may help

Additional context
This is the solution that is used by https://github.com/bpmn-io/bpmn-auto-layout
They apply the same to incoming edges of gateways as well

Review if/how the algo has been implemented in 'orxyx-editor'

The paper mentions on p 398 the orxyx-editor as a bpmn vendor for integration of the algorithm

The next step is integrating the algorithm with the afore-
mentioned Oryx Editor in cooperation with the Hasso-
Plattner-Institut. This will allow everyone to evaluate the
algorithm or download its source code as part of the Oryx
source.

Original googlecode home: https://code.google.com/archive/p/oryx-editor/
This project served as base for the Signavio implementation

The new home for the source code is https://github.com/tiku01/oryx-editor (as of 2020-04-15, latest commit occurred on July 2015)
Let's review if the algorithm has been finally implemented there

[FEAT] Investigate nodejs bridge to run the java layout generator lib

Is your feature request related to a problem? Please describe.
We already manage our R implementation with such a bridge. Having the same for nodejs will avoid having to reimplement the generator in JS.

Additional context
check the following resources as starting point and others

[FEAT] Ensure edges don't overlap shapes

Is your feature request related to a problem? Please describe.
In some complex layout, the edges overlap the shapes, which makes the diagram hard to read.

Example with the "Repair Example" generated after performing Process Discovery.
repairExample

Describe the solution you'd like
Find a way to ensure that edges don't overlap edges.
#58 may help.

BPMN Export: set label fonts

We already compute font size for each shape/edge label in our internal display model but don't use it in the BPMN export.

[FEAT] Consider BPMN message flows

Is your feature request related to a problem? Please describe.
#43 will consider pools/participants. Then collaboration message flows won't be displayed.

Describe the solution you'd like
So, consider message flows when computing way points of the edges (sequence flows only for now).

Refactor svg waypoints computation

The current implementation

  • hard code the number of waypoints considered for the svg generation instead of using them all
  • generate multiple svg lines. We could have a single svg path or a svg polyline

See

// TODO manage couples in a generic way or build svg path instead of line (remove duplication)
if (edge.wayPoints.size() >= 2) {
DisplayPoint start = edge.wayPoints.get(0);
DisplayPoint end = edge.wayPoints.get(1);
content.append("<line")
.append(" x1=\"").append(start.x).append("\"")
.append(" y1=\"").append(start.y).append("\"")
.append(" x2=\"").append(end.x).append("\"")
.append(" y2=\"").append(end.y).append("\"")
.append(" stroke=\"").append(colorEgeStroke).append("\"")
.append(" stroke-width=\"").append(edgeStrokeWidth).append("\"")
.append(" stroke-opacity=\"").append(edgeStrokeOpacity).append("\"")
.append(" />\n");
if (edge.wayPoints.size() >= 3) {
start = end;
end = edge.wayPoints.get(2);
content.append("<line")
.append(" x1=\"").append(start.x).append("\"")
.append(" y1=\"").append(start.y).append("\"")
.append(" x2=\"").append(end.x).append("\"")
.append(" y2=\"").append(end.y).append("\"")
.append(" stroke=\"").append(colorEgeStroke).append("\"")
.append(" stroke-width=\"").append(edgeStrokeWidth).append("\"")
.append(" stroke-opacity=\"").append(edgeStrokeOpacity).append("\"")
.append(" />\n");
}
}
}

Add edge label bounds

In case a label is set on edge, we should position it. Usually, BPMN visualization put the label on the edge by default if no label bounds are provided.

Refactor waypoints related code

The whole code in in the AlgoToDisplayModelConverter class which is very large.
The code is also procedural and could be improved for simplification.

See

private List<DisplayPoint> inferWayPoints(Edge edge, Grid grid, List<DisplayFlowNode> flowNodes) {
Position positionFrom = getPositionOfShape(grid, edge.getFrom());
Position positionTo = getPositionOfShape(grid, edge.getTo());
EdgeDirection edgeDirection = computeEdgeDirection(positionFrom, positionTo, grid);
DisplayFlowNode flowNodeFrom = getFlowNode(flowNodes, positionFrom.getShape());
DisplayFlowNode flowNodeTo = getFlowNode(flowNodes, positionTo.getShape());
return computeWayPoints(edgeDirection, flowNodeFrom, flowNodeTo);
}
private List<DisplayPoint> computeWayPoints(EdgeDirection edgeDirection, DisplayFlowNode flowNodeFrom, DisplayFlowNode flowNodeTo) {
DisplayDimension dimensionFrom = flowNodeFrom.dimension;
DisplayDimension dimensionTo = flowNodeTo.dimension;
List<DisplayPoint> wayPoints = new ArrayList<>();
switch (edgeDirection) {
case HorizontalLeftToRight:
wayPoints.add(new DisplayPoint(dimensionFrom.x + dimensionFrom.width, dimensionFrom.y + dimensionFrom.height / 2));
wayPoints.add(new DisplayPoint(dimensionTo.x, dimensionTo.y + dimensionTo.height / 2));
break;
case HorizontalRightToLeft:
wayPoints.add(new DisplayPoint(dimensionFrom.x, dimensionFrom.y + dimensionFrom.height / 2));
wayPoints.add(new DisplayPoint(dimensionTo.x + dimensionTo.width, dimensionTo.y + dimensionTo.height / 2));
break;

[R package] Review package installation instruction

package installation: the usage of a gh token is probably not needed

The 0.1.4 package documentation explains that a github auth token must be pass to install the package.
I don't understand why we need the token as all resources used by the package are public. If this is required, please document why.

package installation failure

devtools::install_github("process-analytics/bpmn-layout-generators", ref="bpmnLayoutGeneratoR-0.1.4", subdir="R/bpmnLayoutGeneratoR")

The package requires JDK to be installed on the machine.
Otherwise the rjava package installation failed

Example on Ubuntu 20.04

checking Java support in R... present:
interpreter : '/usr/lib/jvm/default-java/bin/java'
archiver    : '/usr/lib/jvm/default-java/bin/jar'
compiler    : '/usr/lib/jvm/default-java/bin/javac'
header prep.: ''
cpp flags   : '-I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux'
java libs   : '-L/usr/lib/jvm/default-java/lib/server -ljvm'
checking whether Java run-time works... ./configure: line 3765: /usr/lib/jvm/default-java/bin/java: No such file or directory
no
configure: error: Java interpreter '/usr/lib/jvm/default-java/bin/java' does not work
ERROR: configuration failed for package ‘rJava’

rJava installation: http://rforge.net/rJava/
Java installation

Once JDK is installed, don't forget to run R CMD javareconf. See https://cran.r-project.org/doc/manuals/R-admin.html#Java-support

Usage example in the readme --> NullPointerException

Note: confirmed on Ubuntu 20.04 by @tbouffard and on Windows 10 Pro by @oanesini

With package 0.1.4, R 3.6.3, AdoptOpenJDK 11.0.11

    Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  :
      java.lang.NullPointerException

Same issue when running

  • diagram <- bpmnLayoutGeneratoR::generateBpmnLayout(flow_node, sequence_flow, "BPMN")
  • diagram <- bpmnLayoutGeneratoR::generateBpmnLayout(flow_node, sequence_flow)

as we are using the Java API and not the CLI, we should add a try catch bock when calling the 'layout generation from csv' method and at least print the stack trace

http://rforge.net/doc/packages/rJava/Exceptions.html

 tryCatch( diagramAsString <- bpmnLayoutJava$generateLayoutFromCSV(flow_node_as_csv, sequence_flow_as_csv, type), Exception = function(e){
     e$printStackTrace() 
 } )

When using the stack trace, we got

java.lang.NullPointerException
	at io.process.analytics.tools.bpmn.generator.input.CSVtoBPMN.assignIncomingAndOutgoingReferences(CSVtoBPMN.java:113)
	at io.process.analytics.tools.bpmn.generator.input.CSVtoBPMN.readFromCSV(CSVtoBPMN.java:51)
	at io.process.analytics.tools.bpmn.generator.BPMNLayoutGenerator.generateLayoutFromCSV(BPMNLayoutGenerator.java:48)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at RJavaTools.invokeMethod(RJavaTools.java:386)

CSVtoBPMN.readFromCSV received string parameters as

nodes

"","id","node","type"
"1",1,"task1","task"
"2",2,"task2","task"

edges --> the issue is here, from and to id must be number, not string, because in nodes, they are defined as number. Both must match.
We need to add robustness to the Java implementation, when the referenced id in from/to doesn't exist in nodes. See #95

"","id","from_id","to_id"
"1","1","1","2"

Review internal model

IMO it should contain:

  • shapes (ids of bpmn elements)
  • edges
  • position of shapes
  • waypoints ( to be added during implementation)

Right now we have:

  • Diagram
  • SortedDiagram
  • Grid

[FEAT] Consider boundary events in the sort/layout algorithm

Is your feature request related to a problem? Please describe.
Currently, the boundary events are considered as a isolated elements for the layout instead of being attached to the activity.

Describe the solution you'd like
A Boundary events should be attached to its parent activity

Additional context
Example with A.3.0.bpmn generated with PR #52 (the escalation boundary event is not displayed here as the screenshot has been done with [email protected] which does not support it)

image

original layout
A 3 0

[R package] Review package DESCRIPTION, development and release process

release process

For now, we have remaining branches and git tags
we should be able to only keep the git tags as the package installation using install_github can use a git tag with the ref parameter (https://www.rdocumentation.org/packages/remotes/versions/2.4.0/topics/install_github)
If so, update the install procedure in the README

DESCRIPTION

The version, title, description and license are not or incompletely set.
license should be License: Apache License (== 2)

Notice that due to the current release process, the DESCRIPTION file is never updated in the master branch

development

The jar file is not available in the master branch because we don't want to mess the repo.
We should explain how to get it when developing the package. There is no git ignore for the jar that MUST not be commited during dev (only during release): error prone
Makefile: review PACKAGE_NAME=rJavaPackageExample

As for the release, run make install from the R/bpmnLayoutGeneratoR folder

[INFRA] Switch the CI java build from Travis to GitHub Actions

The build is currently run on Travis CI, we will easily manage this new requirement with GH Actions.
In addition, Travis CI limited the number of build minutes available even for Open Source projects.
So I suggest we move to GitHub Actions

Not managed here
Test the java build with java 17. This may require a maven update. See maven 3.8.3 release on 2021-10-04
--> compilation error due to lombok. A new lombok version exists but it has not been tested.

Review the "Manhattan" layout algorithm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.