Bug 233472 - Activities not associated to Lanes
Summary: Activities not associated to Lanes
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BPMN (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Antoine Toulmé CLA
QA Contact: Oisin Hurley CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-22 11:30 EDT by Anshu Jain CLA
Modified: 2012-01-06 13:57 EST (History)
4 users (show)

See Also:


Attachments
Workaround implemented in the PoolPoolCompartmentEditPart (23.27 KB, text/x-java)
2008-05-22 19:11 EDT, Anshu Jain CLA
no flags Details
Helper class for the workaround. (for compiling) (7.85 KB, patch)
2008-05-22 19:14 EDT, Anshu Jain CLA
no flags Details | Diff
Patch to calc all lanes containing an activity on resizing the activity (12.67 KB, patch)
2008-05-29 11:44 EDT, Till Essers CLA
antoine: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anshu Jain CLA 2008-05-22 11:30:31 EDT
Hi,

If you add lanes to a BPMN diagram, and then add activities to a particular lane, the BPMN model does not reflect the activities contained by a Lane. 

In particular the API Lane.getActivities() returns a null always. This is clearly not as per the specification.
Comment 1 Anshu Jain CLA 2008-05-22 19:11:41 EDT
Created attachment 101658 [details]
Workaround implemented in the PoolPoolCompartmentEditPart

This is a quick hack I did to get around the problem. I am overriding the addVisualChild of the Pools EditPart. Here I simply hook into any newly created activity by means of a FigureListener. After any move of activity I just loop around to correct the containment of the activities within the lane. 

Please see the methods addChildVisual(EditPart childEditPart, int index) - Begins at line number 113. 

It seems to work correctly under limited trials. (I haven't yet thought about impact the resizing of the Lanes itself might have)
Comment 2 Anshu Jain CLA 2008-05-22 19:14:27 EDT
Created attachment 101659 [details]
Helper class for the workaround. (for compiling)

Helper class to help compile above mentioned workaround
Comment 3 Hugues Malphettes CLA 2008-05-22 19:25:24 EDT
Thanks for the report and the patch.
We will review it shortly.
We will need to remove the reference to the EMFWriteHelper. I think there are GMF or EMF utilities to do the required EMF manipulation.
Comment 4 Antoine Toulmé CLA 2008-05-28 08:17:49 EDT
Sorry Anshu, but this patch is too much of a hack. The edit policies are better suited to introduce changes in the semantic model. 

Look for the uses of the SetGroupsCommand class to see what needs to be done.

Thanks for taking the time to write this patch !
Comment 5 Till Essers CLA 2008-05-29 06:41:28 EDT
I had a look into the SetGroupsCommand and its occurence. If I understood it right, I just have to add the same for lanes even in the same methods?
Comment 6 Antoine Toulmé CLA 2008-05-29 09:23:15 EDT
Yes, you "just" have to do that ;).

Thanks for looking into it!
Comment 7 Till Essers CLA 2008-05-29 11:44:41 EDT
Created attachment 102669 [details]
Patch to calc all lanes containing an activity on resizing the activity

Here it is.
I implemented an SetLanesCommand which does nearly the same as the SetGroupsCommand. I also implemented findContainingLanes() methods to check in which lanes the Activity is in.
Right now it only works when resizing the Activity. Even though a List of Lanes have to be added to the Activity (which is generated).

Hope this one helps.

TODO:
-add SetLanesCommand when creating a new Activity
-add SetLanesCommand when resizing the Lane
Comment 8 Hugues Malphettes CLA 2008-05-29 16:44:14 EDT
Antoine just changed the bpmn semantics so that activities can belong to multiple lanes.
We are testing it internally and will commit the changes asap.
Comment 9 Antoine Toulmé CLA 2008-05-29 18:03:51 EDT
Till, I have applied your patch complemented with a regeneration of the BPMN model.
Comment 10 Antoine Toulmé CLA 2008-05-29 18:05:08 EDT
svn ci -m "adding support for lane and activities, applying patch of bug 233472"
Password: 
Sending        org.eclipse.stp.bpmn/model/bpmn.ecore
Sending        org.eclipse.stp.bpmn/model/bpmn.genmodel
Sending        org.eclipse.stp.bpmn/model/bpmn.xsd
Sending        org.eclipse.stp.bpmn/src/org/eclipse/stp/bpmn/Activity.java
Sending        org.eclipse.stp.bpmn/src/org/eclipse/stp/bpmn/BpmnPackage.java
Sending        org.eclipse.stp.bpmn/src/org/eclipse/stp/bpmn/Lane.java
Sending        org.eclipse.stp.bpmn/src/org/eclipse/stp/bpmn/impl/ActivityImpl.java
Sending        org.eclipse.stp.bpmn/src/org/eclipse/stp/bpmn/impl/BpmnPackageImpl.java
Sending        org.eclipse.stp.bpmn/src/org/eclipse/stp/bpmn/impl/LaneImpl.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/clipboard/BpmnClipboardSupport.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/clipboard/BpmnConnectorViewPostPasteChildOperation.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/clipboard/BpmnPositionalGeneralViewPasteOperation.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/diagram/BpmnDiagramMessages.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/diagram/actions/GroupAction.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/diagram/actions/GroupInSubprocessCommand.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/diagram/actions/activitytypes/ChangeActivityTypeAction.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/diagram/bpmndiagrammessages.properties
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/figures/router/EdgeRectilinearRouter.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/policies/ResizableActivityEditPolicy.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/policies/ResizableLaneEditPolicy.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/policies/ResizableSubProcessEditPolicy.java
Sending        org.eclipse.stp.bpmn.diagram/customsrc/org/eclipse/stp/bpmn/policies/SubProcessCreationEditPolicy.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/ActivityItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/ArtifactItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/ArtifactsContainerItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/AssociationItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/AssociationTargetItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/BpmnDiagramItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/DataObjectItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/GraphItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/GroupItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/IdentifiableItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/LaneItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/MessageVertexItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/MessagingEdgeItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/NamedBpmnObjectItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/PoolItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/SequenceEdgeItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/SubProcessItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/TextAnnotationItemProvider.java
Sending        org.eclipse.stp.bpmn.edit/src/org/eclipse/stp/bpmn/provider/VertexItemProvider.java
Transmitting file data .........................................
Committed revision 2289.
Comment 11 Antoine Toulmé CLA 2008-05-29 18:19:54 EDT
There are still some issues with lanes:
234740: on creation a lane is not associated with activities
234741: when a lane is moved, all lanes should recompute their activities.

I will try to work on them, help is appreciated.