Bug 1320054 - Tasks and connectors positions do not save correctly within subprocess in BPMN2 files
Summary: Tasks and connectors positions do not save correctly within subprocess in BPM...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Designer
Version: 6.3.0
Hardware: All
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Tihomir Surdilovic
QA Contact: Kirill Gaevskii
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-22 08:52 UTC by Radovan Bičiště
Modified: 2020-03-27 19:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:06:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1268754 0 high CLOSED Docker of edge is not positioned relatively to swimlane 2021-02-22 00:41:40 UTC

Internal Links: 1268754

Description Radovan Bičiště 2016-03-22 08:52:17 UTC
Description of problem:
We use BPMN2 xml files for displaying process runtime path in our monitoring console. The BPMN2 files with subprocesses containing shapes and edges are displayed correctly. Shapes and edges were moved outside of the subprocess boundary.  Edges were disconnected from the shapes too. We tried to open the BPMN2 file in other tool like https://bpmn.io/ and received the same view.
Debugging showed us to classes Bpmn2JsonUnmarshaller and Bpmn2JsonMarshaller. The root cause of the problem seems to be variable coordianteManipulation in Bpmn2JsonMarshaller class. Is there a reason for transforming the coordinates when loading XML to JSON and transforming again when saving JSON to XML? When I disable the transformation at both ends (set coordianteManipulation  to false and comment out methods updateShapeBoundsInSubprocess and updateEdgeBoundsInContainers) processes display correctly.

Version-Release number of selected component (if applicable):
6.3.0

How reproducible:
1. create BPMN2 process with subprocess and tasks and connections within subprocess in business-central.
2. go to View Process Sources in business-central.
3. visualize XML given in BPMN2 tab.

Actual results:
Connectors and tasks are misplaced.

Expected results:
Connectors and tasks are aligned.

Additional info:
Follow up on Redhat support case 01604255.

Comment 2 Tihomir Surdilovic 2016-03-23 16:25:44 UTC
Yes there is a reason for the transformation. In the Designer JSON nested node coordinates are represented as relative to the top-left corder of their container(s). The transformation changes them to absolute which is required by the BPMN2 spec (and also to work as it does in our eclipse editor).

Maybe the tools you are opening the bpmn2 with expect relative coordinates for nested nodes? In this case those tools should probably be update to follow spec as well.

Comment 3 Radovan Bičiště 2016-03-24 09:15:46 UTC
Hi,
Thank you for your reply. We tried to display the diagram in bpmn.io (http://demo.bpmn.io/).
I looked into BPMN 2.0 specification and it says:"All BPMNShape elements are owned directly by a BPMNPlane (that is the root element in a BPMNDiagram), i.e., shapes
are not nested within each other in the BPMN DI model although they may appear that way when depicted. The bounds
of a BPMNShape are always relative to that plane's origin point and are REQUIRED to be positive coordinates. Note that
the bounds’ x and y coordinates are the position of the upper left corner of the shape (relative to the upper left corner of
the plane).", chapter 12.2.3.5 and respectively for Edges...

Radovan

Comment 4 Tihomir Surdilovic 2016-03-24 10:31:27 UTC
@Radovam, yes and the eclipse modeller and web designer conform to that.

I tried importing/exporting a couple of small diagrams with designer and http://demo.bpmn.io/new and at first glance it seems to me that http://demo.bpmn.io/new is doing some weird things during the import but we do not control that source so I can't tell what's going on and IMO would be not good to just assume it is 100% correct. We can however compare and control the code of the web designer and the eclipse modeler so testing with those 2 tools would be preferred and if you find any issues there please report them.

Comment 5 Radovan Bičiště 2016-03-24 11:51:51 UTC
Hi Tihomir,
You are right. It boils down to the way the processes are drawn inside our monitoring application.
Thank you very much,
Radovan

Comment 6 Radovan Bičiště 2016-04-01 07:46:25 UTC
I was looking into the issue bit more. Seems like the update of coordinates for edges is broken. Method updateEdgeBoundsInContainers in the class Bpmn2JsonUnmarshaller is adding coordinates of shapes to the end points instead coordinates of a container in our case of a subprocess. Another issue is that it does not transform vertexes and only end points.
Reverse operation in the class Bpmn2JsonMarshaller is fixing that. Again it is transforming end points separately in the method marshallSequenceFlow. It transforms also vertexes though.
IMHO it would be sufficient to transform coordinates of all vertexes of an edge in a simple loop instead of looking for end points etc...


Note You need to log in before you can comment on or make changes to this bug.