Bug 458122 - determinePackagesFrom(ResourceSet resourceSet) in EMfModel only searches for pacakges in the EPackage registry
Summary: determinePackagesFrom(ResourceSet resourceSet) in EMfModel only searches for ...
Status: NEW
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Dimitris Kolovos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-22 07:02 EST by Horacio Hoyos CLA
Modified: 2020-04-16 02:45 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Horacio Hoyos CLA 2015-01-22 07:02:23 EST
The mentioned method only looks for packages in the EPackage registry when resolving pakcages form the list of the model's metamodelUris. The search should be done in the model's ResourceSet (which is passed as a paremeter). Addtionally, the ResourseSet should not be passed as a parameter, since the search should be restricted to the model's modelImpl ResourceSet.
Comment 1 Horacio Hoyos CLA 2015-01-29 06:38:52 EST
Hi, after brainstorming with Dimitris we concluded the following:

- The current search for Types and Instances is greedy, but provides a safe net when craeting models for wich the metamodels are not known (or incomplete) at runtime.
- We don't want to break compatibilty with previous launch configurations (and possible standalone ones).
- For advanced users, we want to make the Type and Instance lookup a bit more efficient. 


We propose the introduction of a new variation point: limited. This new flag will allow users to explictly indicate that they want to limit the search of types and instances to types that exist in the list of supplied metamodels.

- If this flag is set to true, then classForName will not search the ResourceSet registry, but instead only the packages in the model. This also aplies to getEnumerationValue

- If this flag is set to true allContentsFromModel will only add objects that have a type that exist in packages on the model. The behavior is the same if expand is set to true, only that a wider space is searched. 


Optionally: determinePackagesFrom should be renamed or split since it is also registerig the file based metamodels. 

In order to support models that refere as metamodels (.ecore) as models (i.e. a transformation language AST that has import statements to the candidate model's metamodels), determinePackagesFrom should exapnd the search of pacakges to the ResourseSet registry. This is beacuse this referenced metamodels should have been loaded as models and hence will not exist in the EPackakge registry.
Comment 2 Sina Madani CLA 2020-04-15 07:10:45 EDT
Is this about the "expand" flag in AbstractEmfModel, or something else?
Comment 3 Horacio Hoyos CLA 2020-04-15 11:51:22 EDT
Think so
Comment 4 Sina Madani CLA 2020-04-15 11:59:39 EDT
If so then presumably the discussion above has already concluded, and we can close this bug?
Comment 5 Horacio Hoyos CLA 2020-04-16 02:18:23 EDT
I would implement the variant point as discussed, i.e. add the "limited" option to the UI model config.
Comment 6 Dimitris Kolovos CLA 2020-04-16 02:45:02 EDT
> - If this flag is set to true, then classForName will not search the ResourceSet registry, but instead only the packages in the model.

By "packages in the model" did we mean only the EPackages containing EClasses that are instantiated in the model?