Problem with Papyrus Compare and an embedded profile? [message #1816909] |
Mon, 11 November 2019 11:57  |
Eclipse User |
|
|
|
I have a model that we are working on collaboratively and we use Papyrus Compare to manage the merge process. We have our own plugin that extends Papyrus for our needs and it gets packaged as an RCP product.
We have recently moved to using a Profile that is registered within the plugin, rather than having it externally applied - I am now trying to use Papyrus Compare but it now fails with the error "The definition of the Profile applied on <Model> xxx has changed.". When I look at the log, the actual stack trace is as shown below. Looking at the code throwing the exception:
public EObject lookupRoot() throws NotFoundException {
if (resource == null || resource.getContents().isEmpty()) {
// The root doesn't exist.
throw new NotFoundException("No root defined in the model");
}
return resource.getContents().get(0);
}
is this because it is failing to load a resource from within the plugin?
NB: Our model is relatively complex as it is split into different domains, each within its own file that are then brought together using PackageImports - there may be issues there but I have been through by hand and the UML files are all consistent with regard to the ProfileApplication.
Thanks,
Oliver
!ENTRY org.eclipse.papyrus.uml.tools 4 0 2019-11-11 16:34:54.229
!MESSAGE Unexpected Error
!STACK 0
org.eclipse.papyrus.infra.core.resource.NotFoundException: No root defined in the model
at org.eclipse.papyrus.uml.tools.model.UmlModel.lookupRoot(UmlModel.java:114)
at org.eclipse.papyrus.uml.tools.service.ProfileDefinitionService.addRootProfileDecorationIfRequired(ProfileDefinitionService.java:140)
at org.eclipse.papyrus.uml.tools.service.ProfileDefinitionService.startService(ProfileDefinitionService.java:121)
at org.eclipse.papyrus.infra.core.services.internal.ServiceEntry.startService(ServiceEntry.java:154)
at org.eclipse.papyrus.infra.core.services.internal.StartStartupEntry.startService(StartStartupEntry.java:83)
at org.eclipse.papyrus.infra.core.services.ServicesRegistry.startServices(ServicesRegistry.java:1022)
at org.eclipse.papyrus.infra.core.services.ServicesRegistry.startRegistry(ServicesRegistry.java:490)
at org.eclipse.papyrus.compare.diagram.ide.ui.internal.ServicesRegistryInitializingHook.preLoadingHook(ServicesRegistryInitializingHook.java:37)
at org.eclipse.emf.compare.ide.internal.utils.NotLoadingResourceSet.load(NotLoadingResourceSet.java:390)
at org.eclipse.emf.compare.ide.internal.utils.NotLoadingResourceSet.create(NotLoadingResourceSet.java:155)
at org.eclipse.emf.compare.ide.ui.internal.logical.ComparisonScopeBuilder.createScope(ComparisonScopeBuilder.java:519)
at org.eclipse.emf.compare.ide.ui.internal.logical.ComparisonScopeBuilder.createMinimizedScope(ComparisonScopeBuilder.java:487)
at org.eclipse.emf.compare.ide.ui.internal.logical.ComparisonScopeBuilder.build(ComparisonScopeBuilder.java:182)
at org.eclipse.emf.compare.ide.ui.internal.logical.ComparisonScopeBuilder.create(ComparisonScopeBuilder.java:271)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer.compareInputChanged(EMFCompareStructureMergeViewer.java:1563)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer$CompareInputChangedJob.run(EMFCompareStructureMergeViewer.java:224)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
|
|
|
|
Re: Problem with Papyrus Compare and an embedded profile? [message #1816929 is a reply to message #1816909] |
Tue, 12 November 2019 05:30  |
Eclipse User |
|
|
|
Hi Oliver,
Papyrus Compare has only partial support for profile migration during the comparison (see bug 495259).
This support is mainly provided in the so-called ProfileMigrationHook, which will run through your models before the comparison and tries to migrate stereotype applications of stereotypes for which no definition can be resolved.
Profile definitions are searched based on the URI of the missing stereotypes package URI. See also class ProfileMigrationHook.
Note that this only works for static UML profiles that are registered -- it doesn't work for profiles that live in the workspace.
Anyway, diff/merge with evolving profiles is a tricky thing because you essentially change the metamodel when changing the UML profile, so within one comparison, you have to account for the change of possible attribute and reference values according to the metamodel. Sure, there are easy cases which can be supported (e.g. only additions), but it quickly becomes complex if you want to provide "full" support for that.
To be on the safe side, I would recommend to handle that issue, if possible, in a separate "organizational" process as you suggested (rebase open branches after each profile change or merge them before the profile migration).
Hope this helps!
Philip
|
|
|
Powered by
FUDForum. Page generated in 0.07736 seconds