Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Code generation from a transformed model
Code generation from a transformed model [message #1766824] Tue, 27 June 2017 15:57 Go to next message
Mahin Abbasipour is currently offline Mahin AbbasipourFriend
Messages: 24
Registered: June 2013
Junior Member
Hello,

I hope that I am asking my question in a right forum.
I have an ATL transformation that the input and out metamodels are the profiles I defined. The transformed output model has some operations. I want to generate Java code from the output model.
I am able to generate the Java code as explained in https://wiki.eclipse.org/Java_Code_Generation but I don't know how to generate code from a transformed model. Any help is appreciated.

Thank you very much.
Mahin
Re: Code generation from a transformed model [message #1767204 is a reply to message #1766824] Mon, 03 July 2017 14:27 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 163
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Is your output model still basically a UML model, but with some specific stereotypes? If yes, the Papyrus Java code generator can generate code from it, but will of course ignore these specific stereotypes.

If I understand your question, you cannot call the code generator the usual way, since the generated model is "only" a UML file (no Papyprus .di/.notation). Therefore, you cannot open it with Papyrus. If yes, a workaround is to create the missing files: select the UML file in the Project Explorer and then right click on New -> Papyrus Model to create a (basically empty) notation and di file. (It is also possible to open a UML file with Papyrus, but it will complain about the missing files)
Re: Code generation from a transformed model [message #1767232 is a reply to message #1767204] Mon, 03 July 2017 21:29 Go to previous messageGo to next message
Jeni Martin is currently offline Jeni MartinFriend
Messages: 42
Registered: November 2012
Member
Hello,

I tried what you kindly suggested, but when I right click on one of the transformed classes, and then choose "Designer"-->Generate Java code, it says that the operation is not enabled.

Thanks,
Mahin

[Updated on: Mon, 03 July 2017 21:33]

Report message to a moderator

Re: Code generation from a transformed model [message #1796333 is a reply to message #1767232] Thu, 11 October 2018 05:42 Go to previous message
Miss Aleena is currently offline Miss AleenaFriend
Messages: 2
Registered: October 2018
Junior Member
Jeni Martin wrote on Mon, 03 July 2017 21:29
Hello,

I tried what you kindly suggested, but when I right click on one of the transformed classes, and then choose "Designer"-->Generate Java code, it says that the operation is not enabled.

Thanks,
Mahin


Hi,

I am having the same issue. i am using eclipse photon committers under windows 10 pro and have installed Papyrus Photon (4.0.0). I also installed the java component of papyrus:
http://download.eclipse.org/modeling/mdt/papyrus/components/designer/

from
https://wiki.eclipse.org/Java_Code_Generation

but when i tried to generate code for my UML class diagram by right clicking on window and then selecting option( designer -> Generate code ) it showed pop-up that "this operation is not enabled"
and after this occurrence, when i again tried to select the option ( designer -> Generate code ), it was gone from the drop-down which i previously selected after right clicking the window.

I am currently learning Object Oriented And Analysis and i am using Eclipse photon for drawing Use Cases, class diagrams for scenarios and also using java component to generate code for class diagrams.

When I opened my model.di file, that i made in my university's lab, the eclipse photon committers on my laptop showed a window named " Repair stereotypes* " .The java code for the class diagram in that model.di file was generated normally in my university's lab. But in lab the computers were having eclipse Luna.

On the " Repair Stereotypes* " window it was written that:
"For each missing profile definition, select an action to correct the problem. Recommended actions are selected already."

2 Problems were displayed:
1- One Resource was having issue with profile -> "(java) - unknown schema"
count -> ""
2- Another Resource was having issue with Count -> "2 danging stereotypes".

After applying actions, it showed window saying, "Problem in Repairing Stereotypes -some actions cannot be completed"

The screen shots of above windows are in the attached file.

Any advice would be very helpful.

Thanks,
Aleena
Previous Topic:Problem running alf
Next Topic:Decorate ModelExplorer-Element in Diagram
Goto Forum:
  


Current Time: Wed Oct 17 05:45:50 GMT 2018

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

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

Back to the top