Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Conditional File Generation
Conditional File Generation [message #57472] Mon, 23 February 2009 20:27 Go to next message
Guadalupe Mising name is currently offline Guadalupe Mising nameFriend
Messages: 35
Registered: July 2009
Member
Hi all,
I am using Jet with exemplars to generate code from uml model. I have a
template and I obtain information from Java classes.
Right now I generate always the file, but I only want to generate it for
some classes (i.e.based on the name of the class).
I know how to check the class name in the template, but how can I check
that info in advance and indicate that the new file should only be
generated when the class name has an specific name?
Any help appreciated
Re: Conditional File Generation [message #57651 is a reply to message #57472] Wed, 25 February 2009 15:11 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Guadalupe:

I am guessing you are using a Rational Software Architect. If so, what
version?

Starting with version 7.5, each generation action has a Condition property
that you can set to an XPath expression (which is evaluated to a boolean
value using the XPath rules).

With earlier RSA versions, you have to resort to more creative techniques:
1) hand modify the main.jet template
2) use techniques similar to those found in this IBM Redbooks publication:
http://www.redbooks.ibm.com/redbooks/SG247529/wwhelp/wwhimpl /api.htm?href=26-43.htm

Paul

"Guadalupe " <gobellot@gmail.com> wrote in message
news:c1dd36b392388095e7860fb891f8400a$1@www.eclipse.org...
> Hi all,
> I am using Jet with exemplars to generate code from uml model. I have a
> template and I obtain information from Java classes. Right now I generate
> always the file, but I only want to generate it for some classes
> (i.e.based on the name of the class). I know how to check the class name
> in the template, but how can I check that info in advance and indicate
> that the new file should only be generated when the class name has an
> specific name? Any help appreciated
>
Re: Conditional File Generation [message #57746 is a reply to message #57651] Wed, 25 February 2009 17:33 Go to previous message
Guadalupe Mising name is currently offline Guadalupe Mising nameFriend
Messages: 35
Registered: July 2009
Member
Thanks a lot!
I have version 7.5, I added the condition in the property view and then I
had to "refine" it in the main.jet.
I tried a simple condition and it worked, I will try more complex
conditions in the following days.
Thanks again,
Guadalupe
Previous Topic:JET1 directive syntax
Next Topic:Launching JET2 from code
Goto Forum:
  


Current Time: Sat Dec 21 17:13:00 GMT 2024

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

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

Back to the top