Bug 1227392 - Second level sub-process connections not rendering correctly
Summary: Second level sub-process connections not rendering correctly
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Eclipse Tooling
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Robert (Bob) Brodt
QA Contact: Jozef Marko
Depends On:
TreeView+ depends on / blocked
Reported: 2015-06-02 14:37 UTC by Kris Verlaenen
Modified: 2016-02-04 19:16 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-02-04 19:16:52 UTC
Type: Bug

Attachments (Terms of Use)
Screenshot (24.53 KB, image/png)
2015-06-02 14:37 UTC, Kris Verlaenen
no flags Details
bug reproducer (32.95 KB, application/zip)
2015-06-04 05:48 UTC, Jozef Marko
no flags Details

Description Kris Verlaenen 2015-06-02 14:37:37 UTC
Created attachment 1033836 [details]

When having a subprocess inside another subprocess, connections aren't drawn correctly, see screenshot.

Simply add a subprocess with inside another subprocess, add a start node and try to draw a connection to another node.

Reproduced on 1.0.4.Final

Comment 1 Robert (Bob) Brodt 2015-06-03 18:07:23 UTC
I think this is related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=464584 and has been fixed in 1.1.3

Comment 2 Jozef Marko 2015-06-04 05:48:24 UTC
Created attachment 1034561 [details]
bug reproducer

Comment 3 Jozef Marko 2015-06-04 06:01:23 UTC
There is still something wrong.

Way to reproduce bug:
1. Create new process - 1.png
2. Via quick menu on StartProcess add embedded sub-process - 2.png
3. Via quick menu on Sub Process 1 add end event - 3.png
4. Via palette add start node to Sub Process 1 - 4.png 
5. Via quick menu on Start Event 2 add embedded sub-process - 5.png

Model will corrupt in step 5.

Png's are referenced from attachment 1034561 [details] - bug reproducer.

Comment 4 Robert (Bob) Brodt 2015-06-11 21:38:10 UTC
Argh! :(

OK, this is still because of the "isExpanded" attribute which, by default, is false, i.e. when the file is reopened, the subprocess is drawn as a collapsed figure, and the contained shapes and connections should be hidden. You can change the default behavior of this and other (what I like to call "semi-ambiguous") BPMNDI attributes in the User Preferences -> BPMN2 "General settings" page. Apparently I've been testing with the value for "isExpanded" defaulting to "Always true".

It also looks like there's an issue with resizing when the process is reopened. Since the BPMNDI can only contain one set of coordinates and sizes, it's not really possible to determine if those values are for the figure collapsed or expanded.

Any suggestions on how to handle this mess are welcome ;)

Comment 5 Jozef Marko 2015-06-12 07:59:26 UTC
Bob, by myself, there is definitely positive progress. Good job.

Problem with 'hiding' of elements in sub-process after reopen:
If user collapse and expand sub-process elements appear again.

Problem with strange curves of connections after resize:
If user manually move one point of connection, connection is routed again well.

But I have to agree, it is not acceptable for daily usage.

I think we should resolve problem for more simple process, containing only one sub-process at first. 

Please, follow these steps:
1. Be sure you have Preferences->BPMN2->Expand activity containers = Always false
2. Create new process New->Other->BPMN2->jBPM Process Diagram
3. Add Embedded Sub-Process to canvas.
4. Add End Event to canvas.
5. Connect with sequence flow StartEvent->SubProcess; SubProcess->EndEvent
6. Save process
7. Check source view, there will be <bpmndi:BPMNShape id="BPMNShape_SubProcess_1" bpmnElement="SubProcess_1" isExpanded="true">
8. Close and reopen process
9. SubProcess will be now displayed as collapsed (plus sign at the bottom)
10. Check source view, isExpanded from step 7. is always true.

I do not know why is in step 9. SubProcess displayed as when isExpanded is set to false.

I hope this will be good starting point.

Comment 6 Jozef Marko 2015-06-12 08:01:27 UTC
I forgot to mention used version of BPMN2 Modeler. I used BPMN2 Modeler to investigate what is going wrong.

Comment 7 Robert (Bob) Brodt 2015-06-12 15:31:40 UTC
Yes, sorry about the delay of publishing the build to the update site. The version should be

The whole point of the User Preferences for setting isExpanded (and others) is to force a certain behavior; the meanings of these preferences is as follows:

"Always false" = ignore the value of isExpanded from the DI and just always draw the subprocess in collapsed state.
"False if not set" = if the isExpanded attribute is not provided, use a default value of "false", meaning draw the subprocess collapsed
"True if not set" = the opposite of the previous: if isExpanded is not present, draw the subprocess expanded
"Always true" = ignore the value of isExpanded from the DI and always draw the subprocess in expanded state.

I think this is acceptable behavior, and covers all possible desired behaviors.

My biggest concern is how to restore the size of a subprocess in expanded state once it has been saved in collapsed state. Consider the scenario where the user preference for isExpanded is "Always true" and the user manually collapses the subprocess and saves the file. When the file is reopened, the subprocess will be drawn expanded and its contents will be visible, but the size is too small to show all of the children elements. I could force a resize of the subprocess to the minimum size so all children are visible when the file is opened, but this would cause a change in the model and the editor would immediately be set "dirty".

If we accept this behavior and say "ok, so it's dirty because I chose to override the isExpanded attribute." If I then save the file and change the user preference to "Always false" and reopen, the subprocess will be collapsed, but will be the size that it was when expanded - in other words, depending on the sizes and location of its children, it may be unreasonably large.

You see where I'm going with this? ;)

Comment 8 Jozef Marko 2015-06-13 08:05:03 UTC
Yes, I see. It is very difficult to decide what to display, when default preferences and current saved state differs.

I think there are only 3 options how to resolve this:

(Disallow feature of expanding/collapsing sub-process. It step back. But I think it is correct. If I know, web designer of BPMS product has no such feature and I think this feature is not described in specification of bpmn2.)


((1. User will be responsible for keeping sub-process of correct size.)


(2. Show sub-process always as collapsed and for editing open new window where user can edit only this sub-process.)


(3. Show sub-process as expanded but automatically keep sub-porcess of minimal needed size.))

What do you think about it?

Comment 9 Robert (Bob) Brodt 2015-10-16 19:49:41 UTC
Agree. I think for now I will remove the collapse/expand functionality, as well as "push down" and "pull up" for embedded SubProcesses because this is not a problem that can be solved in a couple of days.

Let's go with a combination of your options 1 & 3: the SubProcess will always be rendered expanded; when a child element is moved (or added) so that part of it is outside the original bounds of the SubProcess and part of it is still inside, the SubProcess figure will be resized to completely enclose the moved/added element. If an element is moved so it is completely inside, the SubProcess size remains the same even if it is now unnecessarily large - user will have to resize smaller if desired.

I will also have to remove the "User Preference -> BPMN2 -> Expand activity containers" combo box because this will always be "TRUE" regardless of what the BPMNDI says.

How does that sound?

Comment 10 Robert (Bob) Brodt 2015-10-19 17:29:42 UTC
Jozef, can you please test this again with build of the BPMN2 Modeler (here: http://download.eclipse.org/bpmn2-modeler/updates/luna/1.1.4/)

Comment 11 Jozef Marko 2015-10-26 09:54:23 UTC
Fix looks good in PMN2 Modeler -

I will verify this BZ when some JBDSIS with this version of BPMN2 Modeler will be available.

Comment 12 Jozef Marko 2016-01-18 13:31:39 UTC
Hello Bob, I am testing this BZ on BPMN2 Modeler 1.1.4.Final and I can again reproduce behavior from comment 3

But I find out, that it can not be reproduced, if is for modeling of process used only Palette. So you can focus on popup menu shown nearby process elements.

Comment 13 Robert (Bob) Brodt 2016-02-04 19:16:52 UTC
This functionality is being reworked for Neon (B*MS 7). Closing this now as DEFERRED.

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