Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] How to get a default value of EnumerationLiteral attribute and how to get a target name of
icon5.gif  [Acceleo] How to get a default value of EnumerationLiteral attribute and how to get a target name of [message #1053706] Tue, 07 May 2013 10:39
Félix SILINOU KAMDEM is currently offline Félix SILINOU KAMDEM
Messages: 96
Registered: April 2013
Member
Hello there,
I am generating a code using as an input Metamodel (an UML one).

--> I would like to know how to get a default value of an EnumerationLiteral attribute. The problem is that I cannot use Acceleo method named defaultValue. I also tried getValue() but the parameters is not allow me to use it in this case. (See at the code bellow).

[template private processEnumerationlitteral(e : Enumeration) post (trim())]
      [for ( el: EnumerationLiteral | e.eAllContents(EnumerationLiteral))]
            [if (e.getValue(enumaration, e.name))]
<symbol name="[el.name/]" value="[el.getValue(enumaration, e.name)/]"/>
            [else]
<symbol name="[el.name/]"/> 
            [/if]
      [/for]
[/template]



--> My second problem concerns the association. I would like to get a target name of an association but everything I have tried won't work. (See at the code bellow).

      [if (c.clientDependency->notEmpty())]
Class [c.name/]
            [for (d : Dependency | c.clientDependency)]
      target --> [d.target/]
      target name --> [d.target.name/]
            [/for]
      [/if]



Thank you for your advice.

[Updated on: Tue, 07 May 2013 10:40]

Report message to a moderator

Previous Topic:MWE and Check language
Next Topic:M2T with Xtext2 and Xtend2
Goto Forum:
  


Current Time: Wed Sep 17 05:51:39 GMT 2014

Powered by FUDForum. Page generated in 0.01852 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software