|
Re: [Acceleo 3] getting All classes from Papyrus Model [message #647229 is a reply to message #646930] |
Wed, 05 January 2011 08:38 |
|
This is a multi-part message in MIME format.
--------------040100080406000008030107
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Giacomo,
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.
Laurent Goubet
Obeo
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
> giacomo
>
>
--------------040100080406000008030107
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------040100080406000008030107--
|
|
|
Powered by
FUDForum. Page generated in 0.03645 seconds