Distinguishing "logical" Ecore elements from additional "technical" ones [message #1766675] |
Sun, 25 June 2017 06:45  |
Eclipse User |
|
|
|
In my use-case, I need to I compute a complete list of all elements in a given model, where this model can potentially be a meta-model.
As an example, consider a simple Ecore meta-model with 1 EPackage, 3 EClasses and 2 EReferences. Clearly, I would expect this list to have 1+3+2=6 elements.
However, it turns out the actual number is 8: Upon loading, for each of the two EReferences, an elements of the type "EGenericTypeImpl" is created (and the property "eClassifier" of each EReference is set to to one these elements).
I assume these additional elements serve some meaningful technical purpose. Still, they are not only irrelevant for my use-case, but actually detrimental: in the list that I want to compute, it is important to have a list of the "logical" elements, i.e., those shown to the user in the graphical and tree-based Ecore editors.
So, it need a way of distinguishing
* "logical" elements from "technical" ones,
* "logical" properties of elements from "technical" ones.
Is there a natural way of doing this?
[Updated on: Sun, 25 June 2017 06:48] by Moderator
|
|
|
|
|
|
|
Re: Distinguishing "logical" Ecore elements from additional "technical" ones [message #1766703 is a reply to message #1766686] |
Mon, 26 June 2017 06:08  |
Eclipse User |
|
|
|
Hi
I found examples essential to understand EGenericType. The Classic OCL is unpleasantly generic and so has a bit of everything:
GIT\org.eclipse.ocl\plugins\org.eclipse.ocl\model\OCL.ecore
GIT\org.eclipse.ocl\plugins\org.eclipse.ocl.uml\model\OCLUML.ecore
The Pivot OCL has an Ecore 2 Pivot transformation that might help. You can find an if-tree for the various EGenericType behaviours in:
GIT\org.eclipse.ocl\plugins\org.eclipse.ocl.pivot\src\org\eclipse\ocl\pivot\internal\ecore\es2as\Ecore2AS.java resolveType
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.04214 seconds