diff options
author | Camille Letavernier | 2015-01-21 17:01:43 +0000 |
---|---|---|
committer | Camille Letavernier | 2015-01-21 17:01:43 +0000 |
commit | ead8726b80b8bf69558b782bc8d9fd79a77ac244 (patch) | |
tree | f2be68cec7dc32d7c2c7caf84264b0e866cf5a05 | |
parent | 2cad64f6ad099a0b47d16a903725897f29609e9d (diff) | |
download | org.eclipse.papyrus-ead8726b80b8bf69558b782bc8d9fd79a77ac244.tar.gz org.eclipse.papyrus-ead8726b80b8bf69558b782bc8d9fd79a77ac244.tar.xz org.eclipse.papyrus-ead8726b80b8bf69558b782bc8d9fd79a77ac244.zip |
457341: [Model Import] Identify and fix performances bottlenecks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=457341
- Tentative fix for the Dangling URIs performances in Phase 1
-rw-r--r-- | extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/handler/ImportHandler.java | 6 | ||||
-rw-r--r-- | extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/DependencyAnalysisHelper.java (renamed from extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ConfigHelper.java) | 748 | ||||
-rw-r--r-- | extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformation.java | 11 | ||||
-rw-r--r-- | extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformationLauncher.java | 17 | ||||
-rw-r--r-- | tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/org.eclipse.papyrus.migration.rsa.tests.launch | 2 | ||||
-rw-r--r-- | tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/resources/parameters/TestParameters.emx | 193 |
6 files changed, 624 insertions, 353 deletions
diff --git a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/handler/ImportHandler.java b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/handler/ImportHandler.java index 13cc300ba03..8c47f03f2c9 100644 --- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/handler/ImportHandler.java +++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/handler/ImportHandler.java @@ -28,7 +28,7 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.papyrus.migration.rsa.Activator; import org.eclipse.papyrus.migration.rsa.RSAToPapyrusParameters.Config; -import org.eclipse.papyrus.migration.rsa.transformation.ConfigHelper; +import org.eclipse.papyrus.migration.rsa.RSAToPapyrusParameters.RSAToPapyrusParametersFactory; import org.eclipse.papyrus.migration.rsa.transformation.ImportTransformationLauncher; import org.eclipse.papyrus.views.properties.creation.PropertyEditorFactory; import org.eclipse.swt.widgets.Control; @@ -109,9 +109,7 @@ public class ImportHandler extends AbstractHandler { } public Config getTransformationParameters(ExecutionEvent event) { - ConfigHelper helper = new ConfigHelper(); - - Config config = helper.getConfig(); + Config config = RSAToPapyrusParametersFactory.eINSTANCE.createConfig(); Shell activeShell = HandlerUtil.getActiveShell(event); diff --git a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ConfigHelper.java b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/DependencyAnalysisHelper.java index cb9b42f6c1f..f3c79534e45 100644 --- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ConfigHelper.java +++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/DependencyAnalysisHelper.java @@ -1,343 +1,405 @@ -/*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.migration.rsa.transformation;
-
-import java.util.Collection;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.ecore.xml.type.AnyType;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.migration.rsa.RSAToPapyrusParameters.Config;
-import org.eclipse.papyrus.migration.rsa.RSAToPapyrusParameters.RSAToPapyrusParametersFactory;
-import org.eclipse.papyrus.migration.rsa.RSAToPapyrusParameters.URIMapping;
-import org.eclipse.papyrus.uml.extensionpoints.library.IRegisteredLibrary;
-import org.eclipse.papyrus.uml.extensionpoints.library.RegisteredLibrary;
-import org.eclipse.papyrus.uml.extensionpoints.profile.IRegisteredProfile;
-import org.eclipse.papyrus.uml.extensionpoints.profile.RegisteredProfile;
-import org.eclipse.uml2.uml.Element;
-
-import com.google.common.collect.Sets;
-
-/**
- * Helper class to instantiate and manipulate a Parameters Configuration
- *
- * @author Camille Letavernier
- *
- */
-public class ConfigHelper {
-
- protected final Config config;
-
- protected final static Set<String> rsaExtensions = Sets.newHashSet("emx", "efx"); //$NON-NLS-1$ //$NON-NLS-2$
-
- protected final static String rsaProfileExtension = "epx"; //$NON-NLS-1$
-
- // ResourceSet used to load and explore Static Libraries
- protected final ResourceSet localResourceSet = new ResourceSetImpl();
-
- public ConfigHelper(Config config) {
- this.config = config;
- synchronized (config) {
- if (config.getMappingParameters() == null) {
- config.setMappingParameters(RSAToPapyrusParametersFactory.eINSTANCE.createMappingParameters());
- }
- }
-
- configureResourceSet();
- }
-
- protected void configureResourceSet() {
- localResourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_ATTACHMENT, true);
- localResourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true);
- localResourceSet.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
- localResourceSet.getLoadOptions().put(XMLResource.OPTION_USE_PACKAGE_NS_URI_AS_LOCATION, Boolean.FALSE);
- }
-
- protected void unloadResourceSet() {
- EMFHelper.unload(localResourceSet);
- }
-
- public ConfigHelper() {
- this(RSAToPapyrusParametersFactory.eINSTANCE.createConfig());
- }
-
- public Config getConfig() {
- return config;
- }
-
- public void computeURIMappings(Collection<Resource> sourceModels) {
- try {
- for (Resource sourceModel : sourceModels) {
- doComputeURIMappings(sourceModel);
- }
- } finally {
- unloadResourceSet();
- }
- }
-
- protected void doComputeURIMappings(Resource sourceModel) {
- doComputeProfileURIMappings(sourceModel);
-
- TreeIterator<EObject> resourceContents = sourceModel.getAllContents();
- ResourceSet resourceSet = sourceModel.getResourceSet();
-
- while (resourceContents.hasNext()) {
- EObject next = resourceContents.next();
- for (EReference reference : next.eClass().getEAllReferences()) {
- if (reference.isContainer() || reference.isContainment() || reference.isDerived() || reference.isTransient()) {
- continue;
- }
-
- Object value = next.eGet(reference);
- if (value instanceof EObject) {
- handleURIMapping((EObject) value, resourceSet);
- } else if (value instanceof Collection<?>) {
- for (Object element : (Collection<?>) value) {
- if (element instanceof EObject) {
- handleURIMapping((EObject) element, resourceSet);
- }
- }
- }
- }
- }
- }
-
- protected void doComputeProfileURIMappings(Resource sourceModel) {
- ResourceSet resourceSet = sourceModel.getResourceSet();
-
- for (EObject rootObject : sourceModel.getContents()) {
- if (isInvalidStereotypeApplication(rootObject)) {
- handleProfileURIMapping(rootObject, resourceSet);
- }
- }
- }
-
- protected boolean isInvalidStereotypeApplication(EObject eObject) {
- if (eObject instanceof Element) {
- return false;
- }
-
- // The package is not resolved: probably a missing profile
- if (eObject instanceof AnyType) {
- return true;
- }
-
- // If the package is resolved but is contained in an EPX resource, it needs to be mapped to the Papyrus equivalent
- EPackage ePackage = eObject.eClass().getEPackage();
- if ("epx".equals(ePackage.eResource().getURI().fileExtension())) {
- return true;
- }
-
- return false;
- }
-
- protected void handleProfileURIMapping(EObject stereotypeApplication, ResourceSet resourceSet) {
- Collection<URIMapping> mappings = config.getMappingParameters().getProfileUriMappings();
-
- URIMapping existingMapping = findExistingProfileMapping(stereotypeApplication, resourceSet);
- if (existingMapping == null) {
- URI packageURI = EcoreUtil.getURI(stereotypeApplication.eClass().getEPackage());
-
- URIMapping mapping = RSAToPapyrusParametersFactory.eINSTANCE.createURIMapping();
-
- mapping.setSourceURI(packageURI.trimFragment().trimQuery().toString());
- mapping.setTargetURI(packageURI.trimFragment().trimQuery().toString());
-
- synchronized (config) {
- mappings.add(mapping);
- }
- } else {
- synchronized (config) {
- mappings.add(existingMapping);
- }
- }
- }
-
- protected void handleURIMapping(EObject eObject, ResourceSet resourceSet) {
-
- Collection<URIMapping> mappings = config.getMappingParameters().getUriMappings();
-
- if (eObject.eIsProxy() || isRSAModelElement(eObject)) { // Not yet resolved, or still a reference to an RSA Model Element
- eObject = EcoreUtil.resolve(eObject, resourceSet);
- if (eObject.eIsProxy() || isRSAModelElement(eObject)) { // Can't be resolved
-
- URIMapping existingMapping = findExistingMapping(eObject, resourceSet);
- if (existingMapping == null) {
- URIMapping mapping = RSAToPapyrusParametersFactory.eINSTANCE.createURIMapping();
- URI sourceURI = EcoreUtil.getURI(eObject);
-
- mapping.setSourceURI(sourceURI.trimFragment().trimQuery().toString());
- mapping.setTargetURI(sourceURI.trimFragment().trimQuery().toString()); // By default, don't change anything
-
- synchronized (config) {
- mappings.add(mapping);
- }
- } else {
- synchronized (config) {
- mappings.add(existingMapping);
- }
- }
- }
- }
- }
-
- protected boolean isRSAModelElement(EObject eObject) {
- return isRSAModelElement(EcoreUtil.getURI(eObject));
- }
-
- protected boolean isRSAModelElement(URI objectURI) {
- String fileExtension = objectURI.fileExtension();
- return rsaExtensions.contains(fileExtension) || rsaProfileExtension.equals(fileExtension);
- }
-
- protected URIMapping findExistingProfileMapping(EObject stereotypeApplication, ResourceSet resourceSet) {
- URI proxyURI = EcoreUtil.getURI(stereotypeApplication.eClass().getEPackage());
- String fileExtension = proxyURI.fileExtension();
-
- URIMapping mapping = RSAToPapyrusParametersFactory.eINSTANCE.createURIMapping();
- URI sourceURI = proxyURI.trimFragment().trimQuery();
- mapping.setSourceURI(sourceURI.toString());
-
- URI targetURI = null;
-
- if ("epx".equals(fileExtension)) {
- targetURI = sourceURI.trimFileExtension().appendFileExtension("profile").appendFileExtension("uml");
- try {
- Resource resource = resourceSet.getResource(targetURI, true);
- if (resource != null && !resource.getContents().isEmpty()) {
- mapping.setTargetURI(targetURI.toString());
- return mapping;
- }
- } catch (Exception ex) {
- // Ignore: we can't find the target resource
- }
- }
-
- return findExistingMapping(proxyURI, resourceSet);
- }
-
- protected URIMapping findExistingMapping(URI proxyURI, ResourceSet resourceSet) {
- String fileExtension = proxyURI.fileExtension();
-
- URIMapping mapping = RSAToPapyrusParametersFactory.eINSTANCE.createURIMapping();
- mapping.setSourceURI(proxyURI.trimFragment().trimQuery().toString());
-
- URI targetURI = null;
- // Maybe the element has been migrated locally
- if (rsaExtensions.contains(fileExtension)) {
- targetURI = proxyURI.trimFileExtension().appendFileExtension("uml");
- } else if (rsaProfileExtension.equals(fileExtension)) {
- targetURI = proxyURI.trimFileExtension().appendFileExtension("profile.uml");
- }
-
- if (targetURI != null) {
- try {
- EObject targetElement = resourceSet.getEObject(targetURI, true);
- if (targetElement != null) {
-
- targetURI = EcoreUtil.getURI(targetElement);
-
- mapping.setTargetURI(targetURI.trimFragment().trimQuery().toString());
-
- return mapping;
- }
- } catch (Exception ex) {
- // Ignore: we can't find a target element for the given proxy
- }
- }
-
-
- if (!isRSAModelElement(proxyURI)) {
- // Maybe the resource exists, but doesn't contain this specific element
- URI resourceURI = proxyURI.trimFragment().trimQuery();
- try {
- Resource resource = resourceSet.getResource(resourceURI, true);
- if (resource != null && !resource.getContents().isEmpty()) {
-
- mapping.setTargetURI(resourceURI.toString());
-
- return mapping;
- }
- } catch (Exception ex) {
- // Ignore: we can't find the target resource
- }
- }
-
- // If the URI fragment is a path, don't explore registered libraries/profiles: almost all libraries will
- // have a matching element, although there is no specific correspondence
- if (isPathFragment(proxyURI)) {
- return null;
- }
-
- // Otherwise, we have an ID fragment
-
- // Maybe the resource has already been migrated, then deployed as a static library. Browse all registered libraries and try to find a matching XMI ID
- for (IRegisteredLibrary library : RegisteredLibrary.getRegisteredLibraries()) {
- URI libraryURI = library.getUri();
- try {
- Resource libraryResource = localResourceSet.getResource(libraryURI, true);
- if (libraryResource != null) {
- EObject resolvedElement = libraryResource.getEObject(proxyURI.fragment());
- if (resolvedElement != null && !resolvedElement.eIsProxy()) {
- mapping.setTargetURI(libraryURI.toString());
-
- return mapping;
- }
- }
- } catch (Exception ex) {
- // Ignore
- }
- }
-
- // Maybe the object is a Profile, so let's browse registered profiles as well
- for (IRegisteredProfile profile : RegisteredProfile.getRegisteredProfiles()) {
- URI profileURI = profile.getUri();
- try {
- Resource profileResource = localResourceSet.getResource(profileURI, true);
- if (profileResource != null) {
- EObject resolvedElement = profileResource.getEObject(proxyURI.fragment());
- if (resolvedElement != null && !resolvedElement.eIsProxy()) {
- mapping.setTargetURI(profileURI.toString());
-
- return mapping;
- }
- }
- } catch (Exception ex) {
- // Ignore
- }
- }
-
- return null;
- }
-
- protected boolean isPathFragment(URI proxyURI) {
- String uriFragment = proxyURI.fragment();
-
- return uriFragment.charAt(0) == '/';
- }
-
- protected URIMapping findExistingMapping(EObject proxy, ResourceSet resourceSet) {
- URI proxyURI = EcoreUtil.getURI(proxy);
- return findExistingMapping(proxyURI, resourceSet);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.migration.rsa.transformation; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.eclipse.emf.common.util.TreeIterator; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.ecore.xml.type.AnyType; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.migration.rsa.RSAToPapyrusParameters.Config; +import org.eclipse.papyrus.migration.rsa.RSAToPapyrusParameters.RSAToPapyrusParametersFactory; +import org.eclipse.papyrus.migration.rsa.RSAToPapyrusParameters.URIMapping; +import org.eclipse.papyrus.uml.extensionpoints.library.IRegisteredLibrary; +import org.eclipse.papyrus.uml.extensionpoints.library.RegisteredLibrary; +import org.eclipse.papyrus.uml.extensionpoints.profile.IRegisteredProfile; +import org.eclipse.papyrus.uml.extensionpoints.profile.RegisteredProfile; +import org.eclipse.uml2.uml.Element; + +import com.google.common.collect.Sets; + +public class DependencyAnalysisHelper { + + protected final Config config; + + protected final static Set<String> rsaExtensions = Sets.newHashSet("emx", "efx"); //$NON-NLS-1$ //$NON-NLS-2$ + + protected final static String rsaProfileExtension = "epx"; //$NON-NLS-1$ + + // ResourceSet used to load and explore Static Libraries + protected final ResourceSet localResourceSet = new ResourceSetImpl(); + + // Store the broken URIs without trying to resolve them. We don't have enough information to resolve them during the first phase of the model import + // The Key is the resource URI, the value is the Set of each individual EObject Fragment (We need the EObject fragments to find potential matches) + protected final Map<URI, Set<String>> brokenUris = new HashMap<URI, Set<String>>(); + + protected final Set<URI> brokenProfiles = new HashSet<URI>(); + + public DependencyAnalysisHelper(Config config) { + this.config = config; + + configureResourceSet(); + } + + protected void configureResourceSet() { + localResourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_ATTACHMENT, true); + localResourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true); + localResourceSet.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); + localResourceSet.getLoadOptions().put(XMLResource.OPTION_USE_PACKAGE_NS_URI_AS_LOCATION, Boolean.FALSE); + } + + protected void unloadResourceSet() { + EMFHelper.unload(localResourceSet); + } + + public void computeURIMappings(Collection<Resource> sourceModels) { + for (Resource sourceModel : sourceModels) { + doComputeURIMappings(sourceModel); + } + } + + public synchronized void resolveAllMappings() { + if (config.getMappingParameters() == null) { + config.setMappingParameters(RSAToPapyrusParametersFactory.eINSTANCE.createMappingParameters()); + } + + try { + for (Entry<URI, Set<String>> resourceToRepair : brokenUris.entrySet()) { + findMatch(resourceToRepair.getKey(), resourceToRepair.getValue()); + } + + for (URI profileDefinition : brokenProfiles) { + findMatch(profileDefinition); + } + } finally { + unloadResourceSet(); + } + } + + protected void findMatch(URI resourceURI, Set<String> fragments) { + for (String fragment : fragments) { + URI eObjectURI = resourceURI.appendFragment(fragment); + URIMapping mapping = findExistingMapping(eObjectURI, localResourceSet); + if (mapping != null) { + config.getMappingParameters().getUriMappings().add(mapping); + return; + } + } + } + + protected void findMatch(URI profileDefinitionURI) { + URIMapping match = findExistingProfileMapping(profileDefinitionURI, localResourceSet); + if (match != null) { + config.getMappingParameters().getProfileUriMappings().add(match); + } + } + + protected void doComputeURIMappings(Resource sourceModel) { + doComputeProfileURIMappings(sourceModel); + + TreeIterator<EObject> resourceContents = sourceModel.getAllContents(); + ResourceSet resourceSet = sourceModel.getResourceSet(); + + while (resourceContents.hasNext()) { + EObject next = resourceContents.next(); + for (EReference reference : next.eClass().getEAllReferences()) { + if (reference.isContainer() || reference.isContainment() || reference.isDerived() || reference.isTransient()) { + continue; + } + + Object value = next.eGet(reference); + if (value instanceof EObject) { + handleURIMapping((EObject) value, resourceSet); + } else if (value instanceof Collection<?>) { + for (Object element : (Collection<?>) value) { + if (element instanceof EObject) { + handleURIMapping((EObject) element, resourceSet); + } + } + } + } + } + } + + protected void doComputeProfileURIMappings(Resource sourceModel) { + ResourceSet resourceSet = sourceModel.getResourceSet(); + + for (EObject rootObject : sourceModel.getContents()) { + if (isInvalidStereotypeApplication(rootObject)) { + handleProfileURIMapping(rootObject, resourceSet); + } + } + } + + protected boolean isInvalidStereotypeApplication(EObject eObject) { + if (eObject instanceof Element) { + return false; + } + + // The package is not resolved: probably a missing profile + if (eObject instanceof AnyType) { + return true; + } + + // If the package is resolved but is contained in an EPX resource, it needs to be mapped to the Papyrus equivalent + EPackage ePackage = eObject.eClass().getEPackage(); + if ("epx".equals(ePackage.eResource().getURI().fileExtension())) { + return true; + } + + return false; + } + + protected boolean isRSAModelElement(EObject eObject) { + return isRSAModelElement(EcoreUtil.getURI(eObject)); + } + + protected boolean isRSAModelElement(URI objectURI) { + String fileExtension = objectURI.fileExtension(); + return rsaExtensions.contains(fileExtension) || rsaProfileExtension.equals(fileExtension); + } + + protected synchronized Set<String> getFragments(URI resourceURI) { + if (!brokenUris.containsKey(resourceURI)) { + brokenUris.put(resourceURI, new HashSet<String>()); + } + + return brokenUris.get(resourceURI); + } + + protected synchronized void handleBrokenReference(EObject proxy) { + URI proxyURI = EcoreUtil.getURI(proxy); + URI resourceURI = proxyURI.trimFragment().trimQuery(); + String fragment = proxyURI.fragment(); + Set<String> fragments = getFragments(resourceURI); + fragments.add(fragment); + } + + protected synchronized void addBrokenProfileDefinition(URI packageURI) { + brokenProfiles.add(packageURI); + } + + + protected void handleProfileURIMapping(EObject stereotypeApplication, ResourceSet resourceSet) { + + EPackage profileDefinition = stereotypeApplication.eClass().getEPackage(); + URI packageURI = EcoreUtil.getURI(profileDefinition); + addBrokenProfileDefinition(packageURI); + + + // Collection<URIMapping> mappings = config.getMappingParameters().getProfileUriMappings(); + // + // URIMapping existingMapping = findExistingProfileMapping(stereotypeApplication, resourceSet); + // if (existingMapping == null) { + // URI packageURI = EcoreUtil.getURI(stereotypeApplication.eClass().getEPackage()); + // + // URIMapping mapping = RSAToPapyrusParametersFactory.eINSTANCE.createURIMapping(); + // + // mapping.setSourceURI(packageURI.trimFragment().trimQuery().toString()); + // mapping.setTargetURI(packageURI.trimFragment().trimQuery().toString()); + // + // synchronized (config) { + // mappings.add(mapping); + // } + // } else { + // synchronized (config) { + // mappings.add(existingMapping); + // } + // } + } + + protected void handleURIMapping(EObject eObject, ResourceSet resourceSet) { + + if (isRSAModelElement(eObject)) { + handleBrokenReference(eObject); + return; + } + + if (eObject.eIsProxy()) { + eObject = EcoreUtil.resolve(eObject, resourceSet); + if (eObject.eIsProxy()) { + handleBrokenReference(eObject); + return; + } + } + + // Collection<URIMapping> mappings = config.getMappingParameters().getUriMappings(); + // + // if (eObject.eIsProxy() || isRSAModelElement(eObject)) { // Not yet resolved, or still a reference to an RSA Model Element + // eObject = EcoreUtil.resolve(eObject, resourceSet); + // if (eObject.eIsProxy() || isRSAModelElement(eObject)) { // Can't be resolved + // + // URIMapping existingMapping = findExistingMapping(eObject, resourceSet); + // if (existingMapping == null) { + // URIMapping mapping = RSAToPapyrusParametersFactory.eINSTANCE.createURIMapping(); + // URI sourceURI = EcoreUtil.getURI(eObject); + // + // mapping.setSourceURI(sourceURI.trimFragment().trimQuery().toString()); + // mapping.setTargetURI(sourceURI.trimFragment().trimQuery().toString()); // By default, don't change anything + // + // synchronized (config) { + // mappings.add(mapping); + // } + // } else { + // synchronized (config) { + // mappings.add(existingMapping); + // } + // } + // } + // } + } + + protected URIMapping findExistingProfileMapping(URI profileDefinitionURI, ResourceSet resourceSet) { + + String fileExtension = profileDefinitionURI.fileExtension(); + + URIMapping mapping = RSAToPapyrusParametersFactory.eINSTANCE.createURIMapping(); + URI sourceURI = profileDefinitionURI.trimFragment().trimQuery(); + mapping.setSourceURI(sourceURI.toString()); + + URI targetURI = null; + + if ("epx".equals(fileExtension)) { + targetURI = sourceURI.trimFileExtension().appendFileExtension("profile").appendFileExtension("uml"); + try { + Resource resource = resourceSet.getResource(targetURI, true); + if (resource != null && !resource.getContents().isEmpty()) { + mapping.setTargetURI(targetURI.toString()); + return mapping; + } + } catch (Exception ex) { + // Ignore: we can't find the target resource + } + } + + return findExistingMapping(profileDefinitionURI, resourceSet); + } + + protected URIMapping findExistingMapping(URI proxyURI, ResourceSet resourceSet) { + String fileExtension = proxyURI.fileExtension(); + + URIMapping mapping = RSAToPapyrusParametersFactory.eINSTANCE.createURIMapping(); + mapping.setSourceURI(proxyURI.trimFragment().trimQuery().toString()); + + URI targetURI = null; + // Maybe the element has been migrated locally + if (rsaExtensions.contains(fileExtension)) { + targetURI = proxyURI.trimFileExtension().appendFileExtension("uml"); + } else if (rsaProfileExtension.equals(fileExtension)) { + targetURI = proxyURI.trimFileExtension().appendFileExtension("profile.uml"); + } + + if (targetURI != null) { + try { + EObject targetElement = resourceSet.getEObject(targetURI, true); + if (targetElement != null) { + + targetURI = EcoreUtil.getURI(targetElement); + + mapping.setTargetURI(targetURI.trimFragment().trimQuery().toString()); + + return mapping; + } + } catch (Exception ex) { + // Ignore: we can't find a target element for the given proxy + } + } + + + if (!isRSAModelElement(proxyURI)) { + // Maybe the resource exists, but doesn't contain this specific element + URI resourceURI = proxyURI.trimFragment().trimQuery(); + try { + Resource resource = resourceSet.getResource(resourceURI, true); + if (resource != null && !resource.getContents().isEmpty()) { + + mapping.setTargetURI(resourceURI.toString()); + + return mapping; + } + } catch (Exception ex) { + // Ignore: we can't find the target resource + } + } + + // If the URI fragment is a path, don't explore registered libraries/profiles: almost all libraries will + // have a matching element, although there is no specific correspondence + if (isPathFragment(proxyURI)) { + return null; + } + + // Otherwise, we have an ID fragment + + // Maybe the resource has already been migrated, then deployed as a static library. Browse all registered libraries and try to find a matching XMI ID + for (IRegisteredLibrary library : RegisteredLibrary.getRegisteredLibraries()) { + URI libraryURI = library.getUri(); + try { + Resource libraryResource = localResourceSet.getResource(libraryURI, true); + if (libraryResource != null) { + EObject resolvedElement = libraryResource.getEObject(proxyURI.fragment()); + if (resolvedElement != null && !resolvedElement.eIsProxy()) { + mapping.setTargetURI(libraryURI.toString()); + + return mapping; + } + } + } catch (Exception ex) { + // Ignore + } + } + + // Maybe the object is a Profile, so let's browse registered profiles as well + for (IRegisteredProfile profile : RegisteredProfile.getRegisteredProfiles()) { + URI profileURI = profile.getUri(); + try { + Resource profileResource = localResourceSet.getResource(profileURI, true); + if (profileResource != null) { + EObject resolvedElement = profileResource.getEObject(proxyURI.fragment()); + if (resolvedElement != null && !resolvedElement.eIsProxy()) { + mapping.setTargetURI(profileURI.toString()); + + return mapping; + } + } + } catch (Exception ex) { + // Ignore + } + } + + return null; + } + + protected boolean isPathFragment(URI proxyURI) { + String uriFragment = proxyURI.fragment(); + + return uriFragment.charAt(0) == '/'; + } + + protected URIMapping findExistingMapping(EObject proxy, ResourceSet resourceSet) { + URI proxyURI = EcoreUtil.getURI(proxy); + return findExistingMapping(proxyURI, resourceSet); + } +} diff --git a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformation.java b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformation.java index bf00217eb08..b0c1f46b6ff 100644 --- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformation.java +++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformation.java @@ -142,6 +142,7 @@ public class ImportTransformation { /** EPackages corresponding to source native profiles with specific support in the transformation */ protected static final Set<EPackage> sourceEPackages = new HashSet<EPackage>(); + protected final DependencyAnalysisHelper analysisHelper; static { sourceEPackages.add(org.eclipse.papyrus.migration.rsa.default_.DefaultPackage.eINSTANCE); @@ -150,13 +151,14 @@ public class ImportTransformation { } public ImportTransformation(URI sourceURI) { - this(sourceURI, RSAToPapyrusParametersFactory.eINSTANCE.createConfig()); + this(sourceURI, RSAToPapyrusParametersFactory.eINSTANCE.createConfig(), null); } - public ImportTransformation(URI sourceURI, Config config) { + public ImportTransformation(URI sourceURI, Config config, DependencyAnalysisHelper analysisHelper) { Assert.isNotNull(sourceURI); this.sourceURI = sourceURI; this.parameters = config; + this.analysisHelper = analysisHelper; } public void run() { @@ -578,8 +580,9 @@ public class ImportTransformation { } protected void handleDanglingURIs(Collection<Resource> resourcesToSave) { - ConfigHelper helper = new ConfigHelper(parameters); - helper.computeURIMappings(resourcesToSave); + if (analysisHelper != null) { + analysisHelper.computeURIMappings(resourcesToSave); + } } protected void unloadResourceSet(ResourceSet resourceSet) { diff --git a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformationLauncher.java b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformationLauncher.java index 6be59be28dc..2081db8d85e 100644 --- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformationLauncher.java +++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/src/org/eclipse/papyrus/migration/rsa/transformation/ImportTransformationLauncher.java @@ -108,6 +108,11 @@ public class ImportTransformationLauncher { protected long ownRepairLibrariesTime;
/**
+ * Own execution time for resolving all matches for broken profiles/libraries
+ */
+ protected long resolveAllDependencies;
+
+ /**
* The top-level job for this transformation
*/
protected Job importDependenciesJob;
@@ -118,6 +123,8 @@ public class ImportTransformationLauncher { */
protected long transformationsExecutionTime = 0L;
+ protected DependencyAnalysisHelper analysisHelper;
+
public ImportTransformationLauncher(Config config) {
this(config, null);
}
@@ -135,8 +142,10 @@ public class ImportTransformationLauncher { public void run(List<URI> urisToImport) {
List<ImportTransformation> transformations = new LinkedList<ImportTransformation>();
+ analysisHelper = new DependencyAnalysisHelper(config);
+
for (URI uri : urisToImport) {
- ImportTransformation transformation = new ImportTransformation(uri, config);
+ ImportTransformation transformation = new ImportTransformation(uri, config, analysisHelper);
transformations.add(transformation);
}
@@ -199,6 +208,7 @@ public class ImportTransformationLauncher { log("\tTotal Transformation Time: " + timeFormat(transformationsExecutionTime));
log("Second phase (50-100%) / " + nbThreads + " Threads");
+ log("\tTotal Handle all Dangling References: " + timeFormat(resolveAllDependencies));
log("\tCumulated Loading Time: " + timeFormat(ownLoadingTime));
log("\tCumulated Fix Libraries Time: " + timeFormat(ownRepairLibrariesTime));
log("\tCumulated Fix Stereotypes Time: " + timeFormat(ownRepairStereotypesTime));
@@ -386,6 +396,11 @@ public class ImportTransformationLauncher { profileUrisToReplace.putAll(transformation.getProfileURIMappings());
}
+ long startResolveAll = System.nanoTime();
+ analysisHelper.resolveAllMappings();
+ long endResolveAll = System.nanoTime();
+ resolveAllDependencies = endResolveAll - startResolveAll;
+
filterKnownMappings(config.getMappingParameters(), urisToReplace, profileUrisToReplace);
if (!config.getMappingParameters().getUriMappings().isEmpty() || !config.getMappingParameters().getProfileUriMappings().isEmpty()) {
diff --git a/tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/org.eclipse.papyrus.migration.rsa.tests.launch b/tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/org.eclipse.papyrus.migration.rsa.tests.launch index 9ccdfb31e31..dc0c7a5baf3 100644 --- a/tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/org.eclipse.papyrus.migration.rsa.tests.launch +++ b/tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/org.eclipse.papyrus.migration.rsa.tests.launch @@ -23,7 +23,7 @@ <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.migration.rsa.tests.AllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.migration.rsa.tests"/>
diff --git a/tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/resources/parameters/TestParameters.emx b/tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/resources/parameters/TestParameters.emx new file mode 100644 index 00000000000..92daa923958 --- /dev/null +++ b/tests/junit/extraplugins/migration/org.eclipse.papyrus.migration.rsa.tests/resources/parameters/TestParameters.emx @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--xtools2_universal_type_manager-->
+<?com.ibm.xtools.emf.core.signature <signature id="com.ibm.xtools.uml.msl.model" version="7.0.0"><feature description="" name="com.ibm.xtools.ruml.feature" url="" version="7.0.0"/></signature>?>
+<?com.ibm.xtools.emf.core.signature <signature id="com.ibm.xtools.mmi.ui.signatures.diagram" version="7.0.0"><feature description="" name="Rational Modeling Platform (com.ibm.xtools.rmp)" url="" version="7.0.0"/></signature>?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Default="http:///schemas/Default/_fNm3AAqoEd6-N_NOT9vsCA/2" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmlns:umlnotation="http://www.ibm.com/xtools/1.5.3/Umlnotation" xsi:schemaLocation="http:///schemas/Default/_fNm3AAqoEd6-N_NOT9vsCA/2 pathmap://UML2_MSL_PROFILES/Default.epx#_fNwoAAqoEd6-N_NOT9vsCA?Default/Default?">
+ <uml:Model xmi:id="_78anwp_dEeSMStbbPSeZNQ" name="TestParameters">
+ <eAnnotations xmi:id="_78anw5_dEeSMStbbPSeZNQ" source="uml2.diagrams" references="_78anxJ_dEeSMStbbPSeZNQ">
+ <contents xmi:type="umlnotation:UMLDiagram" xmi:id="_78anxJ_dEeSMStbbPSeZNQ" type="Class" name="Main">
+ <children xmi:type="umlnotation:UMLShape" xmi:id="_8rc4AJ_dEeSMStbbPSeZNQ" element="_8rYmkJ_dEeSMStbbPSeZNQ" fontName="Segoe UI" fontHeight="8" transparency="0" lineColor="14263149" lineWidth="1" showStereotype="Label">
+ <children xmi:type="notation:DecorationNode" xmi:id="_8rdfEJ_dEeSMStbbPSeZNQ" type="ImageCompartment">
+ <layoutConstraint xmi:type="notation:Size" xmi:id="_8rdfEZ_dEeSMStbbPSeZNQ" width="1320" height="1320"/>
+ </children>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_8rdfEp_dEeSMStbbPSeZNQ" type="Stereotype"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_8reGIJ_dEeSMStbbPSeZNQ" type="Name"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_8reGIZ_dEeSMStbbPSeZNQ" type="Parent"/>
+ <children xmi:type="notation:SemanticListCompartment" xmi:id="_8reGIp_dEeSMStbbPSeZNQ" type="AttributeCompartment"/>
+ <children xmi:type="notation:SemanticListCompartment" xmi:id="_8reGI5_dEeSMStbbPSeZNQ" type="OperationCompartment"/>
+ <children xmi:type="notation:SemanticListCompartment" xmi:id="_8retMJ_dEeSMStbbPSeZNQ" visible="false" type="SignalCompartment"/>
+ <children xmi:type="umlnotation:UMLShapeCompartment" xmi:id="_8retMZ_dEeSMStbbPSeZNQ" visible="false" type="StructureCompartment"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8rc4AZ_dEeSMStbbPSeZNQ" x="5544" y="4884"/>
+ </children>
+ <children xmi:type="umlnotation:UMLShape" xmi:id="_J30ysJ_eEeSMStbbPSeZNQ" element="_J3whQJ_eEeSMStbbPSeZNQ" fontName="Segoe UI" fontHeight="8" transparency="0" lineColor="14263149" lineWidth="1" showStereotype="Label">
+ <children xmi:type="notation:DecorationNode" xmi:id="_J31ZwJ_eEeSMStbbPSeZNQ" type="ImageCompartment">
+ <layoutConstraint xmi:type="notation:Size" xmi:id="_J31ZwZ_eEeSMStbbPSeZNQ" width="1320" height="1320"/>
+ </children>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_J31Zwp_eEeSMStbbPSeZNQ" type="Stereotype"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_J31Zw5_eEeSMStbbPSeZNQ" type="Name"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_J31ZxJ_eEeSMStbbPSeZNQ" type="Parent"/>
+ <children xmi:type="notation:SemanticListCompartment" xmi:id="_J32A0J_eEeSMStbbPSeZNQ" type="AttributeCompartment"/>
+ <children xmi:type="notation:SemanticListCompartment" xmi:id="_J32A0Z_eEeSMStbbPSeZNQ" type="OperationCompartment"/>
+ <children xmi:type="notation:SemanticListCompartment" xmi:id="_J32A0p_eEeSMStbbPSeZNQ" visible="false" type="SignalCompartment"/>
+ <children xmi:type="umlnotation:UMLShapeCompartment" xmi:id="_J32A05_eEeSMStbbPSeZNQ" visible="false" type="StructureCompartment"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_J30ysZ_eEeSMStbbPSeZNQ" x="15557" y="4868"/>
+ </children>
+ <children xmi:type="umlnotation:UMLShape" xmi:id="_ocsqQJ_eEeSMStbbPSeZNQ" element="_ocpm8J_eEeSMStbbPSeZNQ" fontName="Segoe UI" fontHeight="8" fillColor="14277119" transparency="0" lineColor="12632258" lineWidth="1" showStereotype="Label">
+ <children xmi:type="notation:DecorationNode" xmi:id="_octRUJ_eEeSMStbbPSeZNQ" type="ImageCompartment">
+ <layoutConstraint xmi:type="notation:Size" xmi:id="_octRUZ_eEeSMStbbPSeZNQ" width="1320" height="1320"/>
+ </children>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_octRUp_eEeSMStbbPSeZNQ" type="Name"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_octRU5_eEeSMStbbPSeZNQ" type="Stereotype"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_octRVJ_eEeSMStbbPSeZNQ" type="ValueSpecification"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ocsqQZ_eEeSMStbbPSeZNQ" x="11484" y="7920" width="6719" height="1824"/>
+ </children>
+ </contents>
+ </eAnnotations>
+ <eAnnotations xmi:id="_78anxZ_dEeSMStbbPSeZNQ" source="com.ibm.xtools.common.ui.reduction.editingCapabilities">
+ <details xmi:id="_78anxp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBFunctionTemplateParameter" value="1"/>
+ <details xmi:id="_78anx5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBPrimitiveTypeTemplateParameter" value="1"/>
+ <details xmi:id="_78anyJ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBElementImport1" value="1"/>
+ <details xmi:id="_78anyZ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBFragment" value="1"/>
+ <details xmi:id="_78anyp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBElementImport2" value="1"/>
+ <details xmi:id="_78any5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBArtifact" value="1"/>
+ <details xmi:id="_78anzJ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBInterfaceTemplateParameter" value="1"/>
+ <details xmi:id="_78anzZ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBFunction" value="1"/>
+ <details xmi:id="_78anzp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBProfile" value="1"/>
+ <details xmi:id="_78anz5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBInteractionOverview" value="1"/>
+ <details xmi:id="_78an0J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBStructureDiagram" value="1"/>
+ <details xmi:id="_78an0Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBSubsystem" value="1"/>
+ <details xmi:id="_78an0p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBSignal" value="1"/>
+ <details xmi:id="_78an05_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBInteractionOverviewDiagram" value="1"/>
+ <details xmi:id="_78an1J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBClass" value="1"/>
+ <details xmi:id="_78an1Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBRelationship1" value="1"/>
+ <details xmi:id="_78an1p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBRelationship2" value="1"/>
+ <details xmi:id="_78an15_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBStateMachine1" value="1"/>
+ <details xmi:id="_78an2J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBRelationship3" value="1"/>
+ <details xmi:id="_78an2Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBStateMachine2" value="1"/>
+ <details xmi:id="_78an2p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBComponent" value="1"/>
+ <details xmi:id="_78an25_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBDeploymentSpecification" value="1"/>
+ <details xmi:id="_78an3J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBActivity1" value="1"/>
+ <details xmi:id="_78an3Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBAbstractionRelation" value="1"/>
+ <details xmi:id="_78an3p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBActivity2" value="1"/>
+ <details xmi:id="_78an35_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBActivity3" value="1"/>
+ <details xmi:id="_78an4J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBAction" value="1"/>
+ <details xmi:id="_78an4Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBActivityDiagram" value="1"/>
+ <details xmi:id="_78an4p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBClassTemplateParameter" value="1"/>
+ <details xmi:id="_78an45_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBActivity4" value="1"/>
+ <details xmi:id="_78an5J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBPackage" value="1"/>
+ <details xmi:id="_78an5Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBTemplate" value="1"/>
+ <details xmi:id="_78an5p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBStereotypedDeployment1" value="1"/>
+ <details xmi:id="_78an55_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBSpecificInstanceType1" value="1"/>
+ <details xmi:id="_78an6J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBSequence1" value="1"/>
+ <details xmi:id="_78an6Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBCollaborationUse" value="1"/>
+ <details xmi:id="_78an6p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBSpecificInstanceType2" value="1"/>
+ <details xmi:id="_78an65_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBSequence2" value="1"/>
+ <details xmi:id="_78an7J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBSequenceDiagram" value="1"/>
+ <details xmi:id="_78an7Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBObjectDiagram" value="1"/>
+ <details xmi:id="_78an7p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBTiming" value="1"/>
+ <details xmi:id="_78an75_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBDependancy" value="1"/>
+ <details xmi:id="_78an8J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBLifeLine" value="1"/>
+ <details xmi:id="_78an8Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBComponentTemplateParameter" value="1"/>
+ <details xmi:id="_78an8p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBUsage" value="1"/>
+ <details xmi:id="_78an85_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBFreeFormDiagram" value="1"/>
+ <details xmi:id="_78an9J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBInstance" value="1"/>
+ <details xmi:id="_78an9Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBStereotypedArtifact" value="1"/>
+ <details xmi:id="_78an9p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBComponentDiagram" value="1"/>
+ <details xmi:id="_78an95_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBEvent1" value="1"/>
+ <details xmi:id="_78an-J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBTypes1" value="1"/>
+ <details xmi:id="_78an-Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBEvent2" value="1"/>
+ <details xmi:id="_78an-p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBTypes2" value="1"/>
+ <details xmi:id="_78an-5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBTypes3" value="1"/>
+ <details xmi:id="_78an_J_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBTypes4" value="1"/>
+ <details xmi:id="_78an_Z_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBTimingDiagram" value="1"/>
+ <details xmi:id="_78an_p_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBCommunicationDiagram" value="1"/>
+ <details xmi:id="_78an_5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBConstraint" value="1"/>
+ <details xmi:id="_78aoAJ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBStereotypedClass" value="1"/>
+ <details xmi:id="_78aoAZ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBProfileApplication" value="1"/>
+ <details xmi:id="_78aoAp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBPackageTemplateParameter" value="1"/>
+ <details xmi:id="_78aoA5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBStereotypedComponent" value="1"/>
+ <details xmi:id="_78aoBJ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBInterface" value="1"/>
+ <details xmi:id="_78aoBZ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBInformationFlow" value="1"/>
+ <details xmi:id="_78aoBp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBComment1" value="1"/>
+ <details xmi:id="_78aoB5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBComment2" value="1"/>
+ <details xmi:id="_78aoCJ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBComment3" value="1"/>
+ <details xmi:id="_78aoCZ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBCollaboration" value="1"/>
+ <details xmi:id="_78aoCp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBCompositeStructure1" value="1"/>
+ <details xmi:id="_78aoC5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBRealization" value="1"/>
+ <details xmi:id="_78aoDJ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBStateChartDiagram" value="1"/>
+ <details xmi:id="_78aoDZ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBCompositeStructure2" value="1"/>
+ <details xmi:id="_78aoDp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBUseCase1" value="1"/>
+ <details xmi:id="_78aoD5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBUseCase2" value="1"/>
+ <details xmi:id="_78aoEJ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBClassDiagram" value="1"/>
+ <details xmi:id="_78aoEZ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBUseCaseDiagram" value="1"/>
+ <details xmi:id="_78aoEp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBDeployment1" value="1"/>
+ <details xmi:id="_78aoE5_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBDeployment2" value="1"/>
+ <details xmi:id="_78aoFJ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBDeploymentDiagram" value="1"/>
+ <details xmi:id="_78aoFZ_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBInteraction" value="1"/>
+ <details xmi:id="_78aoFp_dEeSMStbbPSeZNQ" key="com.ibm.xtools.activities.umlBBCommunication" value="1"/>
+ </eAnnotations>
+ <packageImport xmi:id="_78aoF5_dEeSMStbbPSeZNQ">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <ownedRule xmi:id="_ocpm8J_eEeSMStbbPSeZNQ">
+ <specification xmi:type="uml:OpaqueExpression" xmi:id="_ocqOAJ_eEeSMStbbPSeZNQ">
+ <language></language>
+ <body>Opaque Specification without language</body>
+ </specification>
+ </ownedRule>
+ <packagedElement xmi:type="uml:Class" xmi:id="_8rYmkJ_dEeSMStbbPSeZNQ" name="Class1">
+ <eAnnotations xmi:id="_QWzBQJ_eEeSMStbbPSeZNQ" source="uml2.diagrams">
+ <contents xmi:type="umlnotation:UMLDiagram" xmi:id="_QWzoUJ_eEeSMStbbPSeZNQ" type="Object" name="ObjectDiagram1">
+ <children xmi:type="umlnotation:UMLShape" xmi:id="_RkHI8J_eEeSMStbbPSeZNQ" element="_RkCQcJ_eEeSMStbbPSeZNQ" fontName="Segoe UI" fontHeight="8" transparency="0" lineColor="14263149" lineWidth="1" showStereotype="Label">
+ <children xmi:type="notation:DecorationNode" xmi:id="_RkHwAJ_eEeSMStbbPSeZNQ" type="ImageCompartment">
+ <layoutConstraint xmi:type="notation:Size" xmi:id="_RkHwAZ_eEeSMStbbPSeZNQ" width="1320" height="1320"/>
+ </children>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_RkHwAp_eEeSMStbbPSeZNQ" type="Stereotype"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_RkHwA5_eEeSMStbbPSeZNQ" type="Name"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_RkHwBJ_eEeSMStbbPSeZNQ" type="Parent"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_RkIXEJ_eEeSMStbbPSeZNQ" type="ValueSpecification"/>
+ <children xmi:type="notation:BasicDecorationNode" xmi:id="_RkIXEZ_eEeSMStbbPSeZNQ" visible="false" type="TaggedValueSet"/>
+ <children xmi:type="notation:ListCompartment" xmi:id="_RkIXEp_eEeSMStbbPSeZNQ" type="SlotCompartment"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RkHI8Z_eEeSMStbbPSeZNQ" x="8572" y="5847"/>
+ </children>
+ <element xsi:nil="true"/>
+ </contents>
+ </eAnnotations>
+ <ownedAttribute xmi:id="_-pTr0J_dEeSMStbbPSeZNQ" name="attribute1" visibility="private" type="_J3whQJ_eEeSMStbbPSeZNQ">
+ <defaultValue xmi:type="uml:InstanceValue" xmi:id="_ZK1CsJ_eEeSMStbbPSeZNQ" type="_J3whQJ_eEeSMStbbPSeZNQ" instance="_RkCQcJ_eEeSMStbbPSeZNQ"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_J3whQJ_eEeSMStbbPSeZNQ" name="Class2">
+ <ownedAttribute xmi:id="_KSLzcJ_eEeSMStbbPSeZNQ" name="attribute1" visibility="private">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:InstanceSpecification" xmi:id="_RkCQcJ_eEeSMStbbPSeZNQ" name="Class2Instance" classifier="_J3whQJ_eEeSMStbbPSeZNQ">
+ <slot xmi:id="_WdM-0J_eEeSMStbbPSeZNQ" definingFeature="_KSLzcJ_eEeSMStbbPSeZNQ">
+ <value xmi:type="uml:OpaqueExpression" xmi:id="_XNd-IJ_eEeSMStbbPSeZNQ">
+ <language></language>
+ <body>Hello, World!</body>
+ </value>
+ </slot>
+ </packagedElement>
+ <profileApplication xmi:id="_78aoGJ_dEeSMStbbPSeZNQ">
+ <eAnnotations xmi:id="_78aoGZ_dEeSMStbbPSeZNQ" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbnfB2L_5w"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+ </profileApplication>
+ <profileApplication xmi:id="_78aoGp_dEeSMStbbPSeZNQ">
+ <eAnnotations xmi:id="_78aoG5_dEeSMStbbPSeZNQ" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="pathmap://UML2_MSL_PROFILES/Default.epx#_fNwoAAqoEd6-N_NOT9vsCA?Default/Default?"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML2_MSL_PROFILES/Default.epx#_a_S3wNWLEdiy4IqP8whjFA?Default?"/>
+ </profileApplication>
+ <profileApplication xmi:id="_78aoHJ_dEeSMStbbPSeZNQ">
+ <eAnnotations xmi:id="_78aoHZ_dEeSMStbbPSeZNQ" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="pathmap://UML2_MSL_PROFILES/Deployment.epx#_IrdAUMmBEdqBcN1R6EvWUw?Deployment/Deployment?"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML2_MSL_PROFILES/Deployment.epx#_vjbuwOvHEdiDX5bji0iVSA?Deployment?"/>
+ </profileApplication>
+ </uml:Model>
+ <Default:MetaConstraint xmi:id="_0-Mb8J_eEeSMStbbPSeZNQ" base_Constraint="_ocpm8J_eEeSMStbbPSeZNQ"/>
+</xmi:XMI>
|