[ATL] model element references in input model [message #922859] |
Tue, 25 September 2012 08:04  |
Eclipse User |
|
|
|
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 08:50] by Moderator
|
|
|
Re: [ATL] model element references in input model [message #923266 is a reply to message #922859] |
Tue, 25 September 2012 15:23   |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.26340 seconds