[ATL] model element references in input model [message #922859] |
Tue, 25 September 2012 12:04 |
Niels S Messages: 3 Registered: September 2012 |
Junior Member |
|
|
Hello,
I have a similar problem as described here (http://eclipse.org/forums/index.php/t/167517/), unfortunately this thread has no answer.
Situation: I used EMF to create an Ecore metamodel, generated a model editor, and build a model with it. All fine. Please consider the simplified model below. In this model I set some properties of model elements to reference other model elements. In this case the element "ExampleContract1" has a clientDependency to the other element "ExampleContract2". The model editor creates a link like "#//ShippingContract/ExampleContract2".
(the http part is removed from the code headers otherwise I was not allowed to post)
<?xml version="1.0" encoding="UTF-8"?>
<soaML:SoaMLModel xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:soaML="soaML.ecore" xmlns:uml="eclipse.org/uml2/3.0.0/UML" name="Case study">
<packagedElement xsi:type="soaML:SoaMLModel" name="ShippingContract">
<packagedElement xsi:type="soaML:ServiceContract" name="ExampleContract1" clientDependency="#//ShippingContract/ExampleContract2"/>
<packagedElement xsi:type="soaML:QoSContract" name="ExampleContract2" />
</packagedElement>
.... snip ....
Now when I try to load this model in a ATL transformation (as input model) it generates the following error: "Error loading platform:/resource/project/model/Case.soaml: The feature 'hippingContract' is not a valid feature". With other words, it breaks on the reference.
Why does this not work? Hope someone can give me some explanations or hints?
Regards,
Niels
[Updated on: Tue, 25 September 2012 12:50] Report message to a moderator
|
|
|
Re: [ATL] model element references in input model [message #923266 is a reply to message #922859] |
Tue, 25 September 2012 19:23 |
|
Op 25-09-12 14:04, Niels S schreef:
> Hello,
>
> I have a similar problem as described here
> (http://eclipse.org/forums/index.php/t/167517/), unfortunately this thread has
> no answer.
>
> Situation, i used EMF to create an Ecore metamodel, generated a model editor,
> and build a model with it. All fine. Please consider the simplified model
> below. In this model I set some properties of model elements to reference
> other model elements. In this case the element "ExampleContract1" has a
> clientDependency to the other element "ExampleContract2". The model editor
> creates a link like "#//ShippingContract/ExampleContract2".
>
> (the http part is remove from the code headers otherwise I was not allowed to
> post)
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soaML:SoaMLModel xmlns:xsi="w3.org/2001/XMLSchema-instance"
> xmlns:soaML="soaML.ecore" xmlns:uml="eclipse.org/uml2/3.0.0/UML" name="Case
> study">
> <packagedElement xsi:type="soaML:SoaMLModel" name="ShippingContract">
>
> <packagedElement xsi:type="soaML:ServiceContract" name="ExampleContract1"
> clientDependency="#//ShippingContract/ExampleContract2"/>
> <packagedElement xsi:type="soaML:QoSContract" name="ExampleContract2" />
>
> </packagedElement>
>
> ... snip ....
>
>
> Now when I try to load this model in a ATL transformation (as input model) it
> generates the following error: "Error loading
> platform:/resource/project/model/Case.soaml: The feature 'hippingContract' is
> not a valid feature". With other words, it breaks on the reference.
>
> Why does this not work? Hope someone can give me some explanations or hints?
>
> Regards,
>
> Niels
That doesn't look like standard XMI to me... Did you use any special settings
in the .genmodel file? Or did you generate the .ecore from an .xsd file? In
any case, standard EMF XMI includes an xmlns:xmi header and uses XPath
expressions for references. Yours would be something like
"/0/@packagedElement.0/@packagedElement.1".
Normally, this custom XML format is not a problem, unless you load your
metamodel from file instead of namespace URI. If you load the metamodel from
file, ATL will use a standard XMIResourceImpl parser, which does not
understand your specific XML format.
Regards,
Dennis
Cheers,
Dennis
|
|
|
Re: [ATL] model element references in input model [message #924349 is a reply to message #923266] |
Wed, 26 September 2012 19:23 |
Niels S Messages: 3 Registered: September 2012 |
Junior Member |
|
|
Hello Dennis,
Thanks for your answer.
I created the Ecore file myself (just by clicking the metamodel in a EcoreDiagram), there's is just one special thing: it extends UML2 metamodel. I.e., several elements have a UML!<class> supertype.
(When I inspect the metamodel's Ecore file with the OclInEcore editor I see nothing stranges (just the import "import uml : '/plugin/org.eclipse.uml2.uml/model/UML.ecore#/';").
I would have been really happy if the generated editor uses XPath references as you describe, however, it make these other kind of references. Furthermore, I use default GenModel settings to generate the editor.
Maybe it is because I try to extend UML?
Any further ideas are welcome....
[Updated on: Wed, 26 September 2012 19:23] Report message to a moderator
|
|
|
Re: [ATL] model element references in input model [message #928557 is a reply to message #924349] |
Sun, 30 September 2012 19:10 |
|
Op 26-09-12 21:23, Niels S schreef:
> Hello Dennis,
>
> Thanks for your answer.
>
> I created the Ecore file myself (just by clicking the metamodel in a
> EcoreDiagram), there's is just one special thing: it extends UML2 metamodel.
> I.e., several elements have a UML!<class> supertype.
>
> (When I inspect the metamodel's Ecore file with the OclInEcore editor I see
> nothing stranges (just the import "import uml :
> '/plugin/org.eclipse.uml2.uml/model/UML.ecore#/';").
>
> I would have been really happy if the generated editor uses XPath references
> as you describe, however, it make these other kind of references. Furthermore,
> I use default GenModel settings to generate the editor.
>
> Maybe it is because I try to extend UML?
>
> Any further ideas are welcome?
Perhaps it indeed has something to do with UML. The UML metamodel is
configured to use XMI IDs instead of XPath expressions. Better check with the
EMF and UML newsgroups as well.
Regards,
Dennis
Cheers,
Dennis
|
|
|
|
Powered by
FUDForum. Page generated in 0.03448 seconds