|
Re: Acceleo 3 Problem with Stereotypes [message #649713 is a reply to message #649565] |
Thu, 20 January 2011 12:16 |
|
Hi,
We will need a bit more information in order to help you:
1- could you give me the ouput of this :
[template public generate_activities(a : Activity)]
[comment @main /]
[file (a.name.concat('Activity.java'), false, 'UTF-8')]
[for (i : InitialNode | a.ownedElement->filter(InitialNode))]
[i/]
[/for]
[/file]
[/template]
Because in Acceleo, "i" is also an implicit counter for the "for" and we had a bug with this and since I don't know the version of Acceleo that you are using, you may be affected by the bug.
2- if "i" is not an integer but really an InitialNode, try this :
[template public generate_activities(a : Activity)]
[comment @main /]
[file (a.name.concat('Activity.java'), false, 'UTF-8')]
Step 0
[for (i : InitialNode | a.ownedElement->filter(InitialNode))]
Step 1
[getNodeFlow(i)/]
[/for]
[/file]
[/template]
[template public getNodeFlow(node : ActivityNode)]
Step 2
[for (n: ActivityEdge | node.outgoing)]
Step 3
[if not (n.target.oclIsKindOf(ActivityFinalNode))]
Step 4: "[n/]"
--
[n.target.name /]
[if (n.hasKeyword('stereotype'))]
gefunden
[/if]
[if (n.hasValue(stereotype,'ViewCall'))]
gefunden
[/if]
--
[getNodeFlow(n.target)/]
[/if]
[/for]
[/template]
What is the output ? (maybe one of your variable as not the type that you are imagining or maybe it is null, I don't know so let's try something simple)
Stephane Begaudeau, Obeo.
|
|
|
|
|
Re: Acceleo 3 Problem with Stereotypes [message #649958 is a reply to message #649767] |
Fri, 21 January 2011 08:22 |
|
This is a multi-part message in MIME format.
--------------080904010307020309010409
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
Glad to see you managed :). That may not be the case here, but do not
hesitate to raise enhancement requests when you think that Acceleo could
have helped more (compilation warning, error message ...).
Laurent Goubet
Obeo
On 20/01/2011 15:53, woife wrote:
> Ok,
>
> sorry to have bothered you... i found my own error in the loop. i made a
> mistake...
>
> the correct code for the second template has to be:
>
>
> [template public getNodeFlow(node : ActivityNode)]
> [for (n: ActivityEdge | node.outgoing)]
> [if not (n.target.oclIsKindOf(ActivityFinalNode))]
>
> --
> [n.target.name /]
> [for (ns: Stereotype | n.target.getAppliedStereotypes())]
> gefunden
> [ns.name /]
> [/for]
> --
>
> [getNodeFlow(n.target)/]
> [/if]
> [/for]
> [/template]
>
>
> and it works! ;)
--------------080904010307020309010409
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=
--------------080904010307020309010409--
|
|
|
Powered by
FUDForum. Page generated in 0.03740 seconds