Skip to main content



      Home
Home » Modeling » Compare » Model Resolving step(This step is not accessible programmatically)
Model Resolving step [message #1698967] Fri, 19 June 2015 04:25 Go to next message
Eclipse UserFriend
Hi,

I would access to step of Model Resolving [1] programmatically but, after reading the documentation, the only thing I can do is to extend the normal behaviour with both extension points.

For example before run a comparison, I would launch the Model Resolving step which uses IModelResolver and IResourceDependencyProvider
and other interesting classes but all is in internal scope. Otherwise, this step could be interesting to detect which are resources might be impacted by the next action.

I saw also that in RCP EMF Compare plugin, several registry(DiffEngine, PostProcessor, ....) are accessible.
In the same way, it would be interesting to access to step of Model Resolving.

Regards

Gabriel

1: https://www.eclipse.org/emf/compare/documentation/latest/developer/developer-guide.html#Model_Resolving
Re: Model Resolving step [message #1699284 is a reply to message #1698967] Tue, 23 June 2015 04:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi Gabriel,

The model resolving has internal details that we do not plan on making public API, but you should still be able to access this step programmatically from the facades available.

If you have a model file as a starting point, you might want to start from platform :

final IModelProviderDescriptor[] descriptors = ModelProvider.getModelProviderDescriptors();
ModelProvider modelProvider = null;
for (IModelProviderDescriptor desc : descriptors) {
    if ("org.eclipse.emf.compare.model.provider".equals(desc.getId())) {
        modelProvider = desc;
    }
}
ResourceMapping[] mappings = desc.getMappings(file, ResourceMappingContext.LOCAL_CONTEXT, new NullProgressMonitor());


Since this will give you the "emf" model provider (ours), the "mappings" array will contain a single EMFResourceMapping. call "getTraversals" on that for the list of files related to the one you gave as input.

You could also simply rely on EMF Compare to build your scope for you.... And writing this answer, I now understand what you mean, there are no API ways to create default instances of our IModelResolver and IModelMinimizer subclasses needed by the ComparisonScopeBuilder. Please open an enhancement request against EMF Compare for this on the bugzilla

Laurent Goubet
Obeo

[Updated on: Tue, 23 June 2015 04:52] by Moderator

Re: Model Resolving step [message #1699659 is a reply to message #1699284] Thu, 25 June 2015 11:21 Go to previous message
Eclipse UserFriend
Hi Laurent,

Thanks for your help, I created the bug.

Indeed, if I combine your solution to access to IModelResolver and the extension point, I will be able to use my implementation of IModelResolver.
In fact, I needed to replace EMF Compare Scope (Workspace, Project, ...) by mine. To succeed, I had to override different internal implementations (ThreadedModelResolver, ResourceDependencyResolver and DefaultResolutionContext).

Regards

Gabriel


Previous Topic:Print Structural differences to Console
Next Topic:Problems with the Diff-Feature
Goto Forum:
  


Current Time: Wed Jul 23 16:23:57 EDT 2025

Powered by FUDForum. Page generated in 0.03767 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top