summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-12-19 09:20:18 (EST)
committerStephan Born2013-01-25 12:36:31 (EST)
commitaca9fbc844db8970d5fba27b8dc108e4bea902b2 (patch)
tree5969b566ddbbf90eb203187d75a24f48bd7ef1ae
parent6d11c43beaad7b3701aee090dc65bc0515d37d8d (diff)
downloadorg.eclipse.stardust.ui.web-aca9fbc844db8970d5fba27b8dc108e4bea902b2.zip
org.eclipse.stardust.ui.web-aca9fbc844db8970d5fba27b8dc108e4bea902b2.tar.gz
org.eclipse.stardust.ui.web-aca9fbc844db8970d5fba27b8dc108e4bea902b2.tar.bz2
Jira-ID: CRNT-27424 Pepper: External Packages and Filereferences not removed from XPDL correctly when Structured Data changed to local reference
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61654 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java12
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalReferenceChangeTracker.java61
2 files changed, 45 insertions, 28 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java
index d3b523a..21348ea 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java
@@ -31,6 +31,7 @@ import org.eclipse.stardust.model.xpdl.carnot.IModelParticipant;
import org.eclipse.stardust.model.xpdl.carnot.INodeSymbol;
import org.eclipse.stardust.model.xpdl.carnot.ModelType;
import org.eclipse.stardust.model.xpdl.carnot.OrganizationType;
+import org.eclipse.stardust.model.xpdl.carnot.ProcessDefinitionType;
import org.eclipse.stardust.model.xpdl.carnot.RoleType;
import org.eclipse.stardust.model.xpdl.carnot.impl.DataSymbolTypeImpl;
import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil;
@@ -38,6 +39,7 @@ import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils;
import org.eclipse.stardust.model.xpdl.carnot.util.UnusedModelElementsSearcher;
import org.eclipse.stardust.model.xpdl.util.IConnectionManager;
import org.eclipse.stardust.model.xpdl.xpdl2.Extensible;
+import org.eclipse.stardust.model.xpdl.xpdl2.FormalParameterType;
import org.eclipse.stardust.model.xpdl.xpdl2.util.ExtendedAttributeUtil;
import org.eclipse.stardust.modeling.repository.common.Connection;
import org.eclipse.stardust.ui.web.modeler.edit.spi.ChangePostprocessor;
@@ -64,7 +66,8 @@ public class ExternalElementChangeTracker implements ChangePostprocessor
{
for (EObject dataCandidate : change.getModifiedElements())
{
- if (dataCandidate instanceof DataType) {
+ if (dataCandidate instanceof DataType)
+ {
trackDataModification((DataType) dataCandidate, change);
}
}
@@ -78,6 +81,7 @@ public class ExternalElementChangeTracker implements ChangePostprocessor
{
trackModification(candidate, false, change);
}
+
}
private void trackDataModification(DataType dataType, Modification change)
@@ -148,6 +152,12 @@ public class ExternalElementChangeTracker implements ChangePostprocessor
model.getOrganization().remove(element);
modified = true;
}
+ else if (candidate instanceof ProcessDefinitionType
+ && element instanceof DataType)
+ {
+ model.getData().remove(element);
+ modified = true;
+ }
if (modified)
{
change.markAlsoModified(element);
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalReferenceChangeTracker.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalReferenceChangeTracker.java
index 1f02b30..0573876 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalReferenceChangeTracker.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalReferenceChangeTracker.java
@@ -37,39 +37,47 @@ public class ExternalReferenceChangeTracker implements ChangePostprocessor
{
Collection<EObject> removedList = change.getRemovedElements();
+ Collection<EObject> modifiedList = change.getModifiedElements();
- ModelType model = null;
-
- if (!removedList.isEmpty())
+ if ( !removedList.isEmpty())
{
EObject removedElement = (EObject) removedList.toArray()[0];
if (removedElement.eContainer() instanceof ChangeDescriptionImpl)
{
- ChangeDescriptionImpl changeDescription = (ChangeDescriptionImpl) removedElement
- .eContainer();
+ ChangeDescriptionImpl changeDescription = (ChangeDescriptionImpl) removedElement.eContainer();
EObject container = changeDescription.getOldContainer(removedElement);
- model = ModelUtils.findContainingModel(container);
- List<String> uris = ModelUtils.getURIsForExternalPackages(model);
- for (Iterator<String> i = uris.iterator(); i.hasNext();)
- {
- String uri = i.next();
- WebModelerConnectionManager cm = (WebModelerConnectionManager) model
- .getConnectionManager();
- Connection connection = (Connection) cm.findConnection(uri);
- List<EObject> references = this.getExternalReferences(model,
- (Connection) connection);
- if (references.size() == 1)
- {
- ExternalPackage externalReference = (ExternalPackage) references.get(0);
- removeConnection(externalReference);
- model.getExternalPackages().getExternalPackage()
- .remove(externalReference);
- change.markAlsoRemoved(externalReference);
- change.markAlsoModified(model);
- }
- }
+ trackExternalReferences(change, container);
}
+ }
+ if ( !modifiedList.isEmpty())
+ {
+ EObject modifiedElement = (EObject) modifiedList.toArray()[0];
+ trackExternalReferences(change, modifiedElement);
+ }
+
+ }
+
+ private void trackExternalReferences(Modification change, EObject container)
+ {
+ ModelType model;
+ model = ModelUtils.findContainingModel(container);
+ List<String> uris = ModelUtils.getURIsForExternalPackages(model);
+ for (Iterator<String> i = uris.iterator(); i.hasNext();)
+ {
+ String uri = i.next();
+ WebModelerConnectionManager cm = (WebModelerConnectionManager) model.getConnectionManager();
+ Connection connection = (Connection) cm.findConnection(uri);
+ List<EObject> references = this.getExternalReferences(model,
+ (Connection) connection);
+ if (references.size() == 1)
+ {
+ ExternalPackage externalReference = (ExternalPackage) references.get(0);
+ removeConnection(externalReference);
+ model.getExternalPackages().getExternalPackage().remove(externalReference);
+ change.markAlsoRemoved(externalReference);
+ change.markAlsoModified(model);
+ }
}
}
@@ -80,8 +88,7 @@ public class ExternalReferenceChangeTracker implements ChangePostprocessor
IConnectionManager.URI_ATTRIBUTE_NAME);
ConnectionImpl connection = (ConnectionImpl) model.getConnectionManager()
.findConnection(uri);
- WebModelerConnectionManager man = (WebModelerConnectionManager) model
- .getConnectionManager();
+ WebModelerConnectionManager man = (WebModelerConnectionManager) model.getConnectionManager();
man.getRepository().getConnection().remove(connection);
}