|
Re: referencing an element of an unknown metamodel using EObject [message #414482 is a reply to message #414474] |
Thu, 08 November 2007 17:31 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Javi,
Comments below.
Javi wrote:
> Hi,
>
> I have an input model mU compliant to the U metamodel (mmU).
> I create an output model mX compliant to the X metamodel (mmX).
>
> I want to keep a link from the output element (eX) to the input
> element (eU) from which it is derived.
>
> Because only during app-runtime the metamodel U is known, I cannot
> have any reference from mmX to mmU. Thus, I thought of creating a
> feature in XElement: actualElement of type EObject.
>
> <eClassifiers xsi:type="ecore:EClass" name="XElement">
> <eStructuralFeatures xsi:type="ecore:EReference" name="actualElement"
> ordered="false"
> lowerBound="1" eType="ecore:EClass
> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Object "/>
> </eClassifiers>
>
> I manage to read programmatically a model from the files (fX, fU), the
> link has the reference to eU. But eU is read as AnyType instead of as
> UElement. I suppose because it is unrecognized content.
What does the serialized link look like?
>
> In case U=UML,
> - I register the extension
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
> UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
> - I register the package
> UMLPackage umlPackage = UMLPackage.eINSTANCE;
> - I register the UML pathmaps
> URIConverter.URI_MAP.put(..., ...);
>
> Am I missing anything to have the element read as UElement instead of
> AnyType.
I imagine the reference should be read as proxy and resolved later, if
it's not resolving, I need more details to understand why. It should be
fine that it's an AnyType while it's a proxy, so likely the problem is
more to do with resolving the proxy than anything else.
>
> Thank you in advance
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: referencing an element of an unknown metamodel using EObject [message #414571 is a reply to message #414482] |
Tue, 13 November 2007 15:02 |
Javi Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Ed,
Indeed, it was unrecognized content. Different uml versions.
So it was not a reference problem.
Thank you anyway.
Ed Merks wrote:
> Javi,
> Comments below.
> Javi wrote:
>> Hi,
>>
>> I have an input model mU compliant to the U metamodel (mmU).
>> I create an output model mX compliant to the X metamodel (mmX).
>>
>> I want to keep a link from the output element (eX) to the input
>> element (eU) from which it is derived.
>>
>> Because only during app-runtime the metamodel U is known, I cannot
>> have any reference from mmX to mmU. Thus, I thought of creating a
>> feature in XElement: actualElement of type EObject.
>>
>> <eClassifiers xsi:type="ecore:EClass" name="XElement">
>> <eStructuralFeatures xsi:type="ecore:EReference" name="actualElement"
>> ordered="false"
>> lowerBound="1" eType="ecore:EClass
>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Object "/>
>> </eClassifiers>
>>
>> I manage to read programmatically a model from the files (fX, fU), the
>> link has the reference to eU. But eU is read as AnyType instead of as
>> UElement. I suppose because it is unrecognized content.
> What does the serialized link look like?
>>
>> In case U=UML,
>> - I register the extension
>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
>> UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>> - I register the package
>> UMLPackage umlPackage = UMLPackage.eINSTANCE;
>> - I register the UML pathmaps
>> URIConverter.URI_MAP.put(..., ...);
>>
>> Am I missing anything to have the element read as UElement instead of
>> AnyType.
> I imagine the reference should be read as proxy and resolved later, if
> it's not resolving, I need more details to understand why. It should be
> fine that it's an AnyType while it's a proxy, so likely the problem is
> more to do with resolving the proxy than anything else.
>>
>> Thank you in advance
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.02847 seconds