Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Generating code with Acceleo from Sirius digram model(How to start? What is metamodel URI for Sirius?)
Generating code with Acceleo from Sirius digram model [message #1219294] Tue, 03 December 2013 08:18 Go to next message
sninja sninja is currently offline sninja sninjaFriend
Messages: 31
Registered: October 2013
Member
Hi,

I want to generate code with Acceleo from my DSL defined by Sirius graphical diagram.

Diagram is defined by two files: one for graphical data (aird file) and one for semantic data (which is practically XML), if I got it right.

Here are my questions:

1. What is metamodel URI if I'm using Sirius diagram?
2. Are there any examples for Acceleo and Sirius for this case?
3. I presume, since both projects originated from Obeo, that this is possible?

Thanks.
Re: Generating code with Acceleo from Sirius digram model [message #1219305 is a reply to message #1219294] Tue, 03 December 2013 09:01 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 701
Registered: July 2009
Senior Member
Le 03/12/2013 09:18, sninja sninja a écrit :
> Hi,

Hi.

> I want to generate code with Acceleo from my DSL defined by Sirius
> graphical diagram.
>
> Diagram is defined by two files: one for graphical data (aird file) and
> one for semantic data (which is practically XML), if I got it right.

The aird file contains only Sirius-specific data about the (graphical)
representations of your data. The entirety of your semantic data is kept
in your semantic resources, with no references or other kind of
dependency to Sirius and its metamodels.

If you have created a diagram where a blue node graphically represents
one of you semantic element (say an instance of domain.Concept), the
aird file would contain (among other things) an instance of DNode (a
Sirius-specific type ) which corresponds to the blue node and
*references* the instance of domain.Concept stored in your
domain-specific XML file.

> Here are my questions:
> 1. What is metamodel URI if I'm using Sirius diagram?

In 99% of the cases, generators are only concerned about the semantic
data itself and do no care whether or not a diagram has been created for
that data, whether a given element is represented by a blue square or a
yellow ellipse, etc.

To take a concrete example, if you wanted to create a UML-to-Java
generator, its input would be the *.uml files and the corresponding
metamodel URI, and the generator should not care whether that file was
generated programatically, manually using Papyrus (which uses *.umldi
files to store graphical infos), or using the Sirius-based UML Designer
[1] (which uses the Sirius *.aird files for that).

So in 99% of the cases, if you want to create an Acceleo generator on
your semantic data, you can completely ignore Sirius and the aird files
and take your semantic resource as input (and thus the URI for your
EPackage(s)).

> 2. Are there any examples for Acceleo and Sirius for this case?

I'm not sure, but there would not be much to show beyond a completely
standard Acceleo generator which happens to work on a domain metamodel
for which there also exist a Sirius modeler. As I said, in most cases
you can completely ignore the presence of Sirius and use Acceleo
directly on your semantic model.

> 3. I presume, since both projects originated from Obeo, that this is
> possible?

Yes it is, but not because of some specific integration between the two
projects. They simply both work with your unmodified semantic metamodel.

[1] https://github.com/ObeoNetwork/UML-Modeling


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Generating code with Acceleo from Sirius digram model [message #1724573 is a reply to message #1219294] Wed, 24 February 2016 17:51 Go to previous messageGo to next message
Daniel Garzon is currently offline Daniel GarzonFriend
Messages: 1
Registered: February 2016
Junior Member
Hi sninja,

Did you solve your problem? I'm having the same issue at the moment, but I have not found a way to solve it, could you help me please?
Re: Generating code with Acceleo from Sirius digram model [message #1822627 is a reply to message #1724573] Tue, 10 March 2020 15:09 Go to previous messageGo to next message
Adil Bhatti is currently offline Adil BhattiFriend
Messages: 10
Registered: March 2019
Junior Member
Hello. I have generator in Acceleo and code is written in XML language. Is it possible to add java code along with XML? If yes, then what Java files will be important to write as header files?

Looking forward
Re: Generating code with Acceleo from Sirius digram model [message #1822678 is a reply to message #1822627] Wed, 11 March 2020 09:50 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

In so far as Acceleo is a general purpose model-to-text tool / programming language, it can certainly be used to generate XML or Java or an interleave of both. But it is a general purpose capability so you will be doing a lot of programming. I would start with something that inherently understands XML, like a model-to-model language or one of many Java support tools and I would really sit back and examine why I want to interleave Java and XML; seems really crazy hard.

Regards

Ed Willink
Previous Topic:Exception when creating a new Representation
Next Topic:Specifying the default model object to create in new model creation
Goto Forum:
  


Current Time: Thu Mar 28 10:26:03 GMT 2024

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

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

Back to the top