Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: meierch on February 07, 2010, 02:58:40 am

Title: Outer Class ?
Post by: meierch on February 07, 2010, 02:58:40 am
I try to generate some statements in the dot language used by GraphViz. I have a bunch of nested classes (classes with inner classes) - in other words a tree.

A
    B
    C

I need to transform this to

A -> B
A -> C

I have seen that I can check if a class is nested with %classIsNested%. But I don't know how to get the name of the outer class.

Any suggestion how to do this?

Thanks
Christian
Title: Re: Outer Class ?
Post by: Makulik on February 08, 2010, 08:57:20 pm
Hi,

From http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/fieldsubstitutionmacros.html
Quote
classQualNameThe Class name prefixed by its outer Classes. Class names are separated by double colons ( :: ).

May be you could use this, to do the trick?

HTH
Günther
Title: Re: Outer Class ?
Post by: meierch on February 09, 2010, 05:19:05 am
Thanks ... I was also trying this. But how do I find the second occurance of '::' from the end?

Christian
Title: Re: Outer Class ?
Post by: Makulik on February 10, 2010, 01:57:04 am
Hmm,
I see, to get the outer classes' bare class name (without namespace prefixes) s.th. like a find-from-end() macro would be needed (replace() to eliminate your actual classes' name + prefixed '::', finding and cutting aftwerwards) ; or that looping would need to be supported in the code generation templates.
I was missing fully fledged program control flow features in the code generation template language several times already :-( ...

WBR
Günther
Title: Re: Outer Class ?
Post by: meierch on February 10, 2010, 06:09:06 am
Another idea was to pass the name of the outerclass as a template parameter when the inner classes are processed. But does alos not work ...