|Re: [Acceleo 3] getting All classes from Papyrus Model [message #647229 is a reply to message #646930]
||Wed, 05 January 2011 08:38
| Laurent Goubet
Registered: July 2009
This is a multi-part message in MIME format.|
Content-Type: text/plain; charset=UTF-8; format=flowed
This isn't a Papyrus problem, rather a general UML question. However, I
don't see what you're trying to do at all. You say you want to retrieve
all classes, but the OCL query you show doesn't select "all" classes :
it only retrieve one single classes which is the one you started with
(the class contained in variable "c").
"all classes" can be done in a number of ways, here are the two easiest :
1 - [Class.AllInstances/]
2 - [c.getModel().eAllContents(Class)/]
You had the "2", however, the "select" you did afterwards was merely
narrowing down the Classes you retrieved to "c" alone.
On 03/01/2011 10:08, splogad wrote:
> Hi to everybody!
> I'm dealing with an Acceleo 3 template to generate c# code. The problem
> is that starting from a Papyrus UML model I would like to retrieve all
> classes that belong to such model.
> My template simply write a file for each class but sometimes given a
> class it has to find for each of other class of the model if a given
> property is set. I tried to select classes form getModel() method but it
> didn't work:
> "[(c.getModel().eAllContents(Class)->select( classLoop: Class |
> general->asSequence()->last().qualifiedName =
> c.qualifiedName))->collect(qualifiedName)/] "
> I tried also with different selection, but it seems that model doesn't
> contain classes.
> Is it possible to do that? please send me a feedback.
> thanks in advance
Content-Type: text/x-vcard; charset=utf-8;
Powered by FUDForum
. Page generated in 0.01566 seconds