Conditional File Generation [message #57472] |
Mon, 23 February 2009 15:27  |
Eclipse User |
|
|
|
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 10:11   |
Eclipse User |
|
|
|
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 12:33  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04648 seconds