Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » How did MoDisco generated the file java.ecore
How did MoDisco generated the file java.ecore [message #1766440] Wed, 21 June 2017 13:58 Go to next message
Tiago Martins is currently offline Tiago MartinsFriend
Messages: 23
Registered: May 2017
Junior Member
I am trying to generate my .ecore file from a list of interfaces that extend EClass, but my .ecore file never get the eClassifiers with all my classes, there isn't the node eClassifiers on my ecore file while on java.ecore there are 132 eClassifiers.

I am generating using EMF Generator Model from the uml file generated by Papyrus.

Thank you very much for the help,
Tiago
Re: How did MoDisco generated the file java.ecore [message #1766441 is a reply to message #1766440] Wed, 21 June 2017 14:03 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello,

The Java metamodel (i.e. the Ecore file) provided by MoDisco has not been generated but has been designed manually to be able to represent generically all Java programs.
It is directly inspired from the JDT internal structure/syntax tree.
Its purpose seems to be different from what you are trying to do in your case.


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: How did MoDisco generated the file java.ecore [message #1766513 is a reply to message #1766441] Thu, 22 June 2017 13:05 Go to previous messageGo to next message
Tiago Martins is currently offline Tiago MartinsFriend
Messages: 23
Registered: May 2017
Junior Member
Hi Hugo,

Thank you for your prompt reply,

Can you just tell me any Discoverer already existing in MoDisco that creates an instance of KDM without using ATL?

I need to create a model instance of KDM by myself, and I was looking for some source code example,

Thank you very much for your help, have a great day.
Re: How did MoDisco generated the file java.ecore [message #1768431 is a reply to message #1766440] Tue, 18 July 2017 15:28 Go to previous messageGo to next message
Tiago Martins is currently offline Tiago MartinsFriend
Messages: 23
Registered: May 2017
Junior Member
@Hugo Bruneliere can you help me how can I generate a KDM model by myself without ATL transformation?

I want to have control on which Action Elements I add to the model and so on...

Thank you!
Re: How did MoDisco generated the file java.ecore [message #1768476 is a reply to message #1768431] Wed, 19 July 2017 09:12 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello Tiago,

I have the impression your question is a general EMF question and not a MoDisco-specific one, as it relates to the creation and manipulation of model elements (the fact that the corresponding metamodel is KDM or another one does not change anything).
As for any metamodel, you can use either the generated API or the EMF reflexive API.
I encourage you to take a look to the EMF documentation for more insights on these aspects.


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: How did MoDisco generated the file java.ecore [message #1768600 is a reply to message #1768476] Thu, 20 July 2017 12:27 Go to previous messageGo to next message
Tiago Martins is currently offline Tiago MartinsFriend
Messages: 23
Registered: May 2017
Junior Member
Hello Hugo,

It's a MoDisco related question, because I am parsing PHP projects and want to create KDM instance models from the parsing I am running.

I want to use later the MoDisco features like queries and so on, after having my KDM sorted out.

The question is that I have been looking at MoDisco source code, and KDM is being created from ATL transformations, and I am not using any transformations.

Can you guide me on what I should look into?
Thank you very much for your help in advance.
Re: How did MoDisco generated the file java.ecore [message #1768618 is a reply to message #1768600] Thu, 20 July 2017 15:32 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello Tiago,

As I mentioned before, if you don't want to use a model-to-model transformation language (such as ATL) to create your KDM model, you will have to do it directly via Java code.
This can be done either by using the specific API generated from the KDM metamodel in Ecore (cf. the MoDisco plugin providing this metamodel and corresponding generated code), or the EMF reflexive API applied in the context of this KDM metamodel.
Once your KDM model created, loaded and/or serialized (as any EMF model), you can then apply on it the MoDisco query features (as well as any EMF-based feature in general).


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: How did MoDisco generated the file java.ecore [message #1768624 is a reply to message #1768618] Thu, 20 July 2017 16:50 Go to previous messageGo to next message
Tiago Martins is currently offline Tiago MartinsFriend
Messages: 23
Registered: May 2017
Junior Member
Hey Hugo,

Thank you for your help, so I will look into the MoDisco plugin where the KDM Metamodel resides, I assume that the corresponding generated code of it should help me to do what I want.

Thank you again

EDIT: Can you name which plugin of MoDisco contains the KDM?

[Updated on: Thu, 20 July 2017 16:51]

Report message to a moderator

Re: How did MoDisco generated the file java.ecore [message #1769523 is a reply to message #1768624] Tue, 01 August 2017 09:53 Go to previous messageGo to next message
Tiago Martins is currently offline Tiago MartinsFriend
Messages: 23
Registered: May 2017
Junior Member
Hi again @Hugo,

I have been looking into all plugin projects of MoDisco in git, and maybe the one I need is org.eclipse.gmt.modisco.omg.kdm, is that right?

However there are too many packages, and I don't know where to start such that I can create my KDM model, can you give me any further help?

Thank you very much in advance,
Tiago
Re: How did MoDisco generated the file java.ecore [message #1769542 is a reply to message #1769523] Tue, 01 August 2017 12:38 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hi Tiago,

A good point to start is to get a KDM example model, so that you can see the main constructs used in such a model and how they are arranged together.
You can easily get one from any Java project/plugin in your workspace by using the MoDisco KDM discoverer (or the Java discoverer chained with the Java to KDM transformation).

Kind regards


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: How did MoDisco generated the file java.ecore [message #1770109 is a reply to message #1769542] Tue, 08 August 2017 12:32 Go to previous message
Tiago Martins is currently offline Tiago MartinsFriend
Messages: 23
Registered: May 2017
Junior Member
Hey @Hugo,

I did that, KDM have a lot of types in it, like packages, class unit, method unit and so on.

My question here, is that on my custom discoverer I am running through a php AST and by each node I wanna create a specific item (Class Unit/Method unit or whatever) of the KDM programmatically.
Do you understand? I am sorry if I wasn't clear from the start.

I just don't know how to create the KDM programatically with my own types inside it, how to serialize it?

Thank you very much,
Tiago
Previous Topic:JDTVisitor Assignment Node
Next Topic:Which versions of Java are supported?
Goto Forum:
  


Current Time: Tue Apr 16 14:00:33 GMT 2024

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

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

Back to the top