Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Using Ecore as Metamodel
[Acceleo] Using Ecore as Metamodel [message #541294] Sat, 19 June 2010 15:48 Go to next message
zoro  is currently offline zoro Friend
Messages: 26
Registered: April 2010
Junior Member
Hi,

I've imported my ecore metamodel in my template (.mt file), and it recognizes it ... but the problem is when I create a 'model.xmi' file and then I do launch from the 'configuration.chain' file, it generates an exception error, saying: "Package with uri 'null' not found" !!

Do I have to do "convert to EMF" ??
How can I make a model correct ?
Re: [Acceleo] Using Ecore as Metamodel [message #541455 is a reply to message #541294] Mon, 21 June 2010 09:00 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070203020909030802090709
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

This kind of exceptions (package with uri * not found) usually mean that
you're missing some package registrations ... though uri "null" I rarely
see.

How did you create the "model.xmi" file? Was that a file exported by an
external modeler such as Enterprise architect? If it is, I'd say the
issue is with the exported file. What does it do if you try to open it
in the ecore editor through "open with => other => Sample Reflective
Ecore Model Editor" ? If it fails through this, then the ecore model
itself is wrong (malformed xml, missing namespace, ...).

The "convert to EMF" item is provided as a bridge for exported models
which aren't "well" exported and thus incompatible with EMF. If using it
doesn't solve the issue (again, try opening your model with the
reflective editor before even trying Acceleo), please let us know.

Laurent Goubet
Obeo

zoro wrote:
> Hi,
>
> I've imported my ecore metamodel in my template (.mt file), and it
> recognizes it ... but the problem is when I create a 'model.xmi' file
> and then I do launch from the 'configuration.chain' file, it generates
> an exception error, saying: "Package with uri 'null' not found" !!
>
> Do I have to do "convert to EMF" ??
> How can I make a model correct ?


--------------070203020909030802090709
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------070203020909030802090709--
Re: [Acceleo] Using Ecore as Metamodel [message #541628 is a reply to message #541294] Mon, 21 June 2010 20:35 Go to previous messageGo to next message
zoro  is currently offline zoro Friend
Messages: 26
Registered: April 2010
Junior Member
Hi,

Thanks for your reply !

Here is my xmi model:

<?xml version = '1.0' encoding = 'UTF-8' ?>
<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Mon Jun 21 21:24:13 WAT 2010'>
  <XMI.content>
    <UML:Model xmi.id = '-64--88-1-5--6ed58084:1295c2da49e:-8000:0000000000000B36'
      name = 'untitledModel' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'
      isAbstract = 'false'>
      <UML:Namespace.ownedElement>
        <UML:Toto xmi.id = '-64--88-1-5--6ed58084:1295c2da49e:-8000:0000000000000CDE'
          name = 'A' visibility = 'public' isSpecification = 'false' isRoot = 'false'
          isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>
      </UML:Namespace.ownedElement>
    </UML:Model>
  </XMI.content>
</XMI>



Its just one Class with a name "A", It is generated and expoted to XMI by argoUML ...

Now, there is no error in that code, when I do "Convert to EMF" its converted to .uml with no problem,
The problem is when I replace "UML:Class" with "Toto", because I have in my ecore meta model a metaclass named "Toto" that has a name ... that I want to generate code from that model using my meta model and not the predefined metamodels ...

Any help would be appreciated !
Re: [Acceleo] Using Ecore as Metamodel [message #541739 is a reply to message #541628] Tue, 22 June 2010 11:55 Go to previous messageGo to next message
Freddy Allilaire is currently offline Freddy AllilaireFriend
Messages: 130
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060005010501030301090100
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

You're not supposed to modify manually this exported xmi file.
UML:Class is the metatype of your class called A and there is no
UML:Toto metatype in the UML metamodel(excepted if you have created a
stereotype). That's why the action "Convert to EMF" doesn't work in your
context.

So I don't understand the link between your UML model and your metamodel
containing a metatype Toto. Could you give us more details of your use case?

Regards,
Freddy.

Le 21/06/2010 22:35, zoro a écrit :
> Hi,
> Thanks for your reply !
>
> Here is my xmi model:
>
>
> <?xml version = '1.0' encoding = 'UTF-8' ?>
> <XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML'
> timestamp = 'Mon Jun 21 21:24:13 WAT 2010'>
> <XMI.content>
> <UML:Model xmi.id =
> '-64--88-1-5--6ed58084:1295c2da49e:-8000:0000000000000B36'
> name = 'untitledModel' isSpecification = 'false' isRoot = 'false' isLeaf
> = 'false'
> isAbstract = 'false'>
> <UML:Namespace.ownedElement>
> <UML:Toto xmi.id =
> '-64--88-1-5--6ed58084:1295c2da49e:-8000:0000000000000CDE'
> name = 'A' visibility = 'public' isSpecification = 'false' isRoot = 'false'
> isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>
> </UML:Namespace.ownedElement>
> </UML:Model>
> </XMI.content>
> </XMI>
>
>
>
> Its just one Class with a name "A", It is generated and expoted to XMI
> by argoUML ...
>
> Now, there is no error in that code, when I do "Convert to EMF" its
> converted to .uml with no problem,
> The problem is when I replace "UML:Class" with "Toto", because I have in
> my ecore meta model a metaclass named "Toto" that has a name ... that I
> want to generate code from that model using my meta model and not the
> predefined metamodels ...
>
> Any help would be appreciated !


--------------060005010501030301090100
Content-Type: text/x-vcard; charset=utf-8;
name="freddy_allilaire.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="freddy_allilaire.vcf"

YmVnaW46dmNhcmQNCmZuOkZyZWRkeSBBbGxpbGFpcmUNCm46QWxsaWxhaXJl O0ZyZWRkeQ0K
b3JnOk9CRU8NCmFkcjo7OzIgcnVlIFJvYmVydCBTY2h1bWFubjtOQU5URVM7 OzQ0NDA4O0Zy
YW5jZQ0KZW1haWw7aW50ZXJuZXQ6ZnJlZGR5LmFsbGlsYWlyZUBvYmVvLmZy DQp0aXRsZTpS
JkQgRW5naW5lZXINCnVybDp3d3cub2Jlby5mcg0KdmVyc2lvbjoyLjENCmVu ZDp2Y2FyZA0K
DQo=
--------------060005010501030301090100--
Re: [Acceleo] Using Ecore as Metamodel [message #542400 is a reply to message #541294] Thu, 24 June 2010 17:30 Go to previous messageGo to next message
zoro  is currently offline zoro Friend
Messages: 26
Registered: April 2010
Junior Member
Exactly, how can I define a new stereotypes ?
Re: [Acceleo] Using Ecore as Metamodel [message #542528 is a reply to message #542400] Fri, 25 June 2010 08:21 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030602030005020809000305
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I don't really know where to begin ... first of all, you're not using
"ecore" as metamodel : your model is clearly an UML model, thus its
metamodel is UML.

Second : you cannot manually alter the XML and hope for the result to
work. "UML:Class" means "my object is of type 'Class' in the 'UML'
namespace". Changing it to "UML:Toto" can only fail : there is no "Toto"
metaclass in the UML metamodel.

Starting from the beginning. When you export this model from ArgoUML to
an XMI (or better yet "EMF XMI" if the option is present in ArgoUML);
can you load the model within Eclipse with the action "Open With =>
Other... => UML model editor"? If not, change the expression from
whatever you have to ".uml" and try again.

If you still cannot open the file in the UML editor, try and run the
action "Convert to EMF" (this action serves as a bridge from external
modelers to EMF) and try opening the file in the UML editor again. If
that fails, it means that ArgoUML simply doesn't export an UML file that
we can read with EMF.

If you manage to open the file in the UML editor, you'll be able to
alter the model from there.

Laurent Goubet
Obeo

zoro wrote:
> Exactly, how can I define a new stereotypes ?


--------------030602030005020809000305
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------030602030005020809000305--
Previous Topic:[Xpand] Protected Region
Next Topic:[Acceleo] Problems with a template
Goto Forum:
  


Current Time: Fri Apr 19 14:07:31 GMT 2024

Powered by FUDForum. Page generated in 0.02221 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top