Community
Participate
Working Groups
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.
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)
Created attachment 101659 [details] Helper class for the workaround. (for compiling) Helper class to help compile above mentioned workaround
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.
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 !
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?
Yes, you "just" have to do that ;). Thanks for looking into it!
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
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.
Till, I have applied your patch complemented with a regeneration of the BPMN model.
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.
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.