java generation customization

General discussions about code engineering

Moderator: Moderators

java generation customization

Postby etienne_f » Tue Mar 27, 2012 9:53 am


Excuse me if the question has already been asked, but I have searched on the documentation and in the knwoledge base and I didn't find a answer.

I would like to reuse the existing java generation and customize it. For instance, for a class I would like to add some specific java annotations at the beginning of the generated java code. These annotations are generated accordingly with the states ans transitions in a state chart linked with the class to generate.

I would like to insert my own code before and after the existing one. Are your own java generation operations available in the Open API ? Is it possible to overwrite them and how ? Is it possible to define a plugin that inherits from the java standard generation and to add some specific behaviors ? If yes how ?

Can you explain me if it possible ?

best regards

Forum Newbie
Forum Newbie
Posts: 16
Posts Rating:1
Joined: Fri Aug 19, 2011 8:08 am

Re: java generation customization

Postby ruslanasv » Thu Mar 29, 2012 5:40 am

Hello Alain,
unfortunately Core Code Engineering features of MagicDraw are not customizable. If you need to generate code without reverse, you may use Cameo MDA MagicDraw plug-in ( which use customizable OpenArchitectureWare templates to generate Java code.
Another approach would be to create your own Java generator based on MagicDraw Reports feature which also uses customizable Velocity templates to generate textual files.
Best Regards,
Ruslanas Vitiutinas
User avatar
Customer Support
Customer Support
Posts: 39
Posts Rating:1
Joined: Fri Jan 08, 2010 1:26 am
Full name: Ruslanas Vitiutinas

Return to Code engineering

Who is online

Users browsing this forum: No registered users and 0 guests