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
I think this is related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=464584 and has been fixed in 1.1.3
Created attachment 1034561 [details]
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.
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 ;)
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.
I forgot to mention used version of BPMN2 Modeler. I used BPMN2 Modeler 18.104.22.168506101743 to investigate what is going wrong.
Yes, sorry about the delay of publishing the build to the update site. The version should be 22.214.171.124506112142.
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? ;)
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?
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?
Jozef, can you please test this again with build 126.96.36.199510191726 of the BPMN2 Modeler (here: http://download.eclipse.org/bpmn2-modeler/updates/luna/1.1.4/)
Fix looks good in PMN2 Modeler - 188.8.131.52510212019
I will verify this BZ when some JBDSIS with this version of BPMN2 Modeler will be available.
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.
This functionality is being reworked for Neon (B*MS 7). Closing this now as DEFERRED.