Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Brodt2014-06-10 11:13:39 -0400
committerBob Brodt2014-06-10 11:13:39 -0400
commitfbd1d12a5b67e4932ef64e3c3dfedaa461d3176d (patch)
tree48f3548dc875e13d1a0aba04cf560ddb6ba99ed9
parentb1da1c77b27d694318fa8b186c670b5879c74d60 (diff)
downloadorg.eclipse.bpmn2-modeler-API-Refactoring.tar.gz
org.eclipse.bpmn2-modeler-API-Refactoring.tar.xz
org.eclipse.bpmn2-modeler-API-Refactoring.zip
Fixed NPE during delete of nested Lanes in Pools.API-Refactoring
Fixed NPE from double-click actcion when Property View is closed. Added a "Show Property View" context menu action. Added missing [+] decorator to SubChoreography. Added missing Participants in Outline View for Choreographies.
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIUtils.java77
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java20
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java4
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java32
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/Messages.java1
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/messages.properties1
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java20
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java3
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java4
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTabDescriptorProvider.java37
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/outline/FlowElementTreeEditPart.java19
11 files changed, 150 insertions, 68 deletions
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIUtils.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIUtils.java
index 7db29637..822d37af 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIUtils.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIUtils.java
@@ -652,48 +652,51 @@ public class DIUtils {
boolean canDelete = false;
Definitions definitions = (Definitions)rootElement.eContainer();
- BPMNDiagram bpmnDiagram = DIUtils.findBPMNDiagram(rootElement);
- RootElement newRootElement = null;
- if (bpmnDiagram==null) {
- List<EObject> allObjects = new ArrayList<EObject>();
- Map<EObject, Collection<EStructuralFeature.Setting>> usages;
- TreeIterator<EObject> iter = rootElement.eContainer().eAllContents();
- while (iter.hasNext())
- allObjects.add(iter.next());
-
- usages = UsageCrossReferencer.findAll(allObjects, rootElement);
- canDelete = usages.isEmpty();
- }
- else {
- // find a replacement for the BPMNDiagram target element
- for (RootElement r : definitions.getRootElements()) {
- if (r!=rootElement && (r instanceof FlowElementsContainer || r instanceof Collaboration)) {
- if (rootElement instanceof Collaboration) {
- Collaboration collaboration = (Collaboration) rootElement;
- if (collaboration.getParticipants().isEmpty()) {
- newRootElement = r;
- canDelete = true;
- break;
+ // check if this thing has already been deleted (eContainer == null)
+ if (definitions!=null) {
+ BPMNDiagram bpmnDiagram = DIUtils.findBPMNDiagram(rootElement);
+ RootElement newRootElement = null;
+ if (bpmnDiagram==null) {
+ List<EObject> allObjects = new ArrayList<EObject>();
+ Map<EObject, Collection<EStructuralFeature.Setting>> usages;
+ TreeIterator<EObject> iter = definitions.eAllContents();
+ while (iter.hasNext())
+ allObjects.add(iter.next());
+
+ usages = UsageCrossReferencer.findAll(allObjects, rootElement);
+ canDelete = usages.isEmpty();
+ }
+ else {
+ // find a replacement for the BPMNDiagram target element
+ for (RootElement r : definitions.getRootElements()) {
+ if (r!=rootElement && (r instanceof FlowElementsContainer || r instanceof Collaboration)) {
+ if (rootElement instanceof Collaboration) {
+ Collaboration collaboration = (Collaboration) rootElement;
+ if (collaboration.getParticipants().isEmpty()) {
+ newRootElement = r;
+ canDelete = true;
+ break;
+ }
+
}
-
- }
- else if (rootElement instanceof FlowElementsContainer) {
- FlowElementsContainer container = (FlowElementsContainer) rootElement;
- if (container.getFlowElements().isEmpty()) {
- newRootElement = r;
- canDelete = true;
- break;
+ else if (rootElement instanceof FlowElementsContainer) {
+ FlowElementsContainer container = (FlowElementsContainer) rootElement;
+ if (container.getFlowElements().isEmpty()) {
+ newRootElement = r;
+ canDelete = true;
+ break;
+ }
}
+ break;
}
- break;
}
}
- }
-
- if (canDelete) {
- EcoreUtil.delete(rootElement);
- if (bpmnDiagram!=null && newRootElement!=null)
- bpmnDiagram.getPlane().setBpmnElement(newRootElement);
+
+ if (canDelete) {
+ EcoreUtil.delete(rootElement);
+ if (bpmnDiagram!=null && newRootElement!=null)
+ bpmnDiagram.getPlane().setBpmnElement(newRootElement);
+ }
}
return canDelete;
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
index 55f63506..e92c6579 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
@@ -604,11 +604,6 @@ public class BPMN2Editor extends DiagramEditor implements IPreferenceChangeListe
public String getContributorId() {
return CONTRIBUTOR_ID;
}
-
- public TargetRuntime getTargetRuntime(ITabDescriptorProvider tdp) {
- tabDescriptorProvider = tdp;
- return getTargetRuntime();
- }
public TargetRuntime getTargetRuntime() {
if (targetRuntime==null) {
@@ -843,13 +838,14 @@ public class BPMN2Editor extends DiagramEditor implements IPreferenceChangeListe
}
if (required==ITabDescriptorProvider.class) {
if (tabDescriptorProvider==null) {
- IWorkbenchPage page = getEditorSite().getPage();
- String viewID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
- try {
- page.showView(viewID, null, IWorkbenchPage.VIEW_CREATE);
- page.showView(viewID, null, IWorkbenchPage.VIEW_ACTIVATE);
- }
- catch (Exception e) {}
+ tabDescriptorProvider = new PropertyTabDescriptorProvider();
+// IWorkbenchPage page = getEditorSite().getPage();
+// String viewID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
+// try {
+// page.showView(viewID, null, IWorkbenchPage.VIEW_CREATE);
+// page.showView(viewID, null, IWorkbenchPage.VIEW_ACTIVATE);
+// }
+// catch (Exception e) {}
}
return tabDescriptorProvider;
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java
index 087fc28b..6de025a5 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java
@@ -78,6 +78,10 @@ public class BPMN2EditorDiagramBehavior extends DiagramBehavior {
action.setEnabled(action.isEnabled());
manager.add(action);
}
+
+ action = getDiagramContainer().getActionRegistry().getAction("show.property.view"); //$NON-NLS-1$
+ action.setText(action.getText());
+ manager.add(action);
}
};
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java
index 854d1844..b89c4ffa 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java
@@ -63,6 +63,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.contentoutline.ContentOutline;
@@ -430,6 +431,37 @@ public class DesignEditor extends BPMN2Editor {
}
};
registry.registerAction(action);
+
+ action = new WorkbenchPartAction(multipageEditor.getDesignEditor()) {
+
+ @Override
+ protected void init() {
+ super.init();
+ setId("show.property.view"); //$NON-NLS-1$
+ }
+
+ @Override
+ public String getText() {
+ return Messages.DesignEditor_Show_Property_View_Action;
+ }
+
+ @Override
+ protected boolean calculateEnabled() {
+ return true;
+ }
+
+ public void run() {
+ IWorkbenchPage page = getEditorSite().getPage();
+ String viewID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
+ try {
+ page.showView(viewID, null, IWorkbenchPage.VIEW_CREATE);
+ page.showView(viewID, null, IWorkbenchPage.VIEW_ACTIVATE);
+ }
+ catch (Exception e) {}
+ }
+ };
+ registry.registerAction(action);
+
}
public class AddRemoveDiagramListener implements ResourceSetListener {
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/Messages.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/Messages.java
index 4ea544fa..eb05ba49 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/Messages.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/Messages.java
@@ -23,6 +23,7 @@ public class Messages extends NLS {
public static String DesignEditor_Diagram_Tab;
public static String DesignEditor_Hide_Source_View_Action;
public static String DesignEditor_Show_Source_View_Action;
+ public static String DesignEditor_Show_Property_View_Action;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/messages.properties b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/messages.properties
index e4d0eaba..987fe67a 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/messages.properties
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/messages.properties
@@ -17,3 +17,4 @@ DesignEditor_DeletePage_Message=Are you sure you want to delete the page {0}?
DesignEditor_Diagram_Tab=Diagram
DesignEditor_Hide_Source_View_Action=Hide Source View
DesignEditor_Show_Source_View_Action=Show Source View
+DesignEditor_Show_Property_View_Action=Show Property View
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java
index bd8500cf..0b2ce4e3 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java
@@ -13,13 +13,18 @@
package org.eclipse.bpmn2.modeler.ui.features.choreography;
import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ChoreographyActivity;
import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.SubChoreography;
+import org.eclipse.bpmn2.modeler.core.features.GraphitiConstants;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.utils.ShapeDecoratorUtil;
import org.eclipse.bpmn2.modeler.ui.ImageProvider;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.graphiti.features.IAddFeature;
import org.eclipse.graphiti.features.ICreateFeature;
import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
public class SubChoreographyFeatureContainer extends AbstractChoreographyFeatureContainer {
@@ -39,6 +44,21 @@ public class SubChoreographyFeatureContainer extends AbstractChoreographyFeature
return new AddSubChoreographyFeature(fp);
}
+ @Override
+ public MultiUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ MultiUpdateFeature multiUpdate = super.getUpdateFeature(fp);
+ multiUpdate.addFeature(new UpdateChoreographyMarkerFeature(fp) {
+ @Override
+ protected void doUpdate(ChoreographyActivity element, ContainerShape markerContainer) {
+ super.doUpdate(element, markerContainer);
+ // SubChoreography always has an EXPAND marker
+ ShapeDecoratorUtil.showActivityMarker(markerContainer, GraphitiConstants.ACTIVITY_MARKER_EXPAND);
+ }
+ });
+
+ return multiUpdate;
+ }
+
public static class CreateSubChoreographyFeature extends AbstractCreateChoreographyActivityFeature<SubChoreography> {
public CreateSubChoreographyFeature(IFeatureProvider fp) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java
index d4767cae..cb88e172 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java
@@ -16,7 +16,6 @@ import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.Conversation;
import org.eclipse.bpmn2.SubConversation;
import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNConnectionFeature;
import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
import org.eclipse.bpmn2.modeler.core.features.label.UpdateLabelFeature;
@@ -30,10 +29,8 @@ import org.eclipse.graphiti.features.ILayoutFeature;
import org.eclipse.graphiti.features.IMoveShapeFeature;
import org.eclipse.graphiti.features.IResizeShapeFeature;
import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IAddContext;
import org.eclipse.graphiti.features.context.IResizeShapeContext;
import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
public class ConversationFeatureContainer extends BaseElementFeatureContainer {
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java
index d747c824..57764c57 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java
@@ -46,6 +46,10 @@ public class DeleteLaneFeature extends AbstractDefaultDeleteFeature {
ContainerShape laneContainerShape = (ContainerShape) context.getPictogramElement();
ContainerShape parentContainerShape = laneContainerShape.getContainer();
Lane lane = (Lane)getBusinessObjectForPictogramElement(laneContainerShape);
+ if (lane==null) {
+ // this can happen if the lane was already deleted by its parent Lane or Pool
+ return;
+ }
LaneSet laneSet = (LaneSet)lane.eContainer();
if (parentContainerShape != null) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTabDescriptorProvider.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTabDescriptorProvider.java
index 08128d33..36153979 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTabDescriptorProvider.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTabDescriptorProvider.java
@@ -16,11 +16,11 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
import org.eclipse.bpmn2.modeler.core.runtime.Bpmn2SectionDescriptor;
import org.eclipse.bpmn2.modeler.core.runtime.PropertyTabDescriptor;
import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
@@ -35,7 +35,7 @@ public class PropertyTabDescriptorProvider implements ITabDescriptorProvider {
// cached in this map. It is the BPMN2 Editor's responsibility to remove these items from the map
// when it is disposed().
// @see PropertyTabDescriptorProvider#disposeTabDescriptors(Resource)
- Hashtable <EObject, TabDescriptorList> tabDescriptorListMap = new Hashtable <EObject, TabDescriptorList>();
+ static Hashtable <EObject, TabDescriptorList> tabDescriptorListMap = new Hashtable <EObject, TabDescriptorList>();
public PropertyTabDescriptorProvider() {
super();
@@ -45,26 +45,22 @@ public class PropertyTabDescriptorProvider implements ITabDescriptorProvider {
@Override
public ITabDescriptor[] getTabDescriptors(IWorkbenchPart part, ISelection selection) {
- // is the Tab Descriptor List already in our cache?
- TabDescriptorList tabDescriptorList = null;
EObject businessObject = BusinessObjectUtil.getBusinessObjectForSelection(selection);
- if (businessObject!=null) {
- tabDescriptorList = tabDescriptorListMap.get(businessObject);
- if (tabDescriptorList!=null) {
- // Yes! return it.
- return tabDescriptorList.toArray();
- }
+ if (businessObject==null || businessObject.eResource()==null) {
+ return new ITabDescriptor[] {};
}
- // No, we need build the list: get the Target Runtime <propertyTab> contributions
- // and merge with the Default Runtime Tab Descriptors
- TargetRuntime rt = TargetRuntime.getDefaultRuntime();
- Object bpmn2Editor = part.getAdapter(BPMN2Editor.class);
- if (bpmn2Editor instanceof BPMN2Editor) {
- rt = ((BPMN2Editor)bpmn2Editor).getTargetRuntime(this);
+ // is the Tab Descriptor List already in our cache?
+ TabDescriptorList tabDescriptorList = tabDescriptorListMap.get(businessObject);
+ if (tabDescriptorList!=null) {
+ // Yes! return it.
+ return tabDescriptorList.toArray();
}
+ // No, we need build the list: get the Target Runtime <propertyTab> contributions
+ // and merge with the Default Runtime Tab Descriptors
List<PropertyTabDescriptor> desc = null;
+ TargetRuntime rt = Bpmn2Preferences.getInstance(businessObject.eResource()).getRuntime();
if (rt!=TargetRuntime.getDefaultRuntime()) {
desc = TargetRuntime.getDefaultRuntime().buildPropertyTabDescriptors();
desc.addAll(rt.buildPropertyTabDescriptors());
@@ -185,5 +181,14 @@ public class PropertyTabDescriptorProvider implements ITabDescriptorProvider {
tabDescriptorListMap.remove(object);
}
}
+ // clean up any dangling EObjects (ones that are not contained in a Resource)
+ List<EObject> removed = new ArrayList<EObject>();
+ for (EObject o : tabDescriptorListMap.keySet()) {
+ if (o.eResource()==null) {
+ removed.add(o);
+ }
+ }
+ for (EObject o : removed)
+ tabDescriptorListMap.remove(o);
}
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/outline/FlowElementTreeEditPart.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/outline/FlowElementTreeEditPart.java
index 2d4ebaef..6f078bb7 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/outline/FlowElementTreeEditPart.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/outline/FlowElementTreeEditPart.java
@@ -18,6 +18,7 @@ import org.eclipse.bpmn2.BoundaryEvent;
import org.eclipse.bpmn2.CallActivity;
import org.eclipse.bpmn2.CallableElement;
import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.Choreography;
import org.eclipse.bpmn2.ChoreographyActivity;
import org.eclipse.bpmn2.Definitions;
import org.eclipse.bpmn2.FlowElement;
@@ -25,6 +26,7 @@ import org.eclipse.bpmn2.FlowElementsContainer;
import org.eclipse.bpmn2.FlowNode;
import org.eclipse.bpmn2.Lane;
import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.SequenceFlow;
import org.eclipse.bpmn2.SubChoreography;
@@ -168,6 +170,23 @@ public class FlowElementTreeEditPart extends AbstractGraphicsTreeEditPart {
if (container instanceof SubChoreography) {
retList.addAll(((SubChoreography)container).getArtifacts());
}
+ if (container instanceof Choreography) {
+ // Add Pools as children if the Pool has a Process associated with it,
+ // or if the Participant is NOT referenced by a Choreography Activity.
+ for (Participant p : ((Choreography)container).getParticipants()) {
+ if (p.getProcessRef()!=null)
+ retList.add(p);
+ else {
+ for (FlowElement fe : flowElements) {
+ if (fe instanceof ChoreographyActivity) {
+ if (!((ChoreographyActivity)fe).getParticipantRefs().contains(p)) {
+ retList.add(p);
+ }
+ }
+ }
+ }
+ }
+ }
return retList;
}

Back to the top