Hi,
I want to generate simple declarations with Acceleo in one of these two ways:
1.
[for (property :Property | c.eContents(Property))]
[PropertyDeclarations(property)/]
[/for]
[template public PropertyDeclarations(property:Property)]
[property.type.getStereotypeValue('Ecore::EDataType', 'instanceClassName')/] [property.name/] = [property.defaultValue/];
[/template]
2.
[c.attribute.type.getStereotypeValue('Ecore::EDataType', 'instanceClassName')/][c.attribute.name/];
Output
1. Yields this as the output
double in = ;
double out = ;
double v0_ = org.eclipse.uml2.uml.internal.impl.LiteralRealImpl@7b87d668 (name: <unset>, visibility: <unset>) (value: 0.0);
double v1_ = org.eclipse.uml2.uml.internal.impl.LiteralRealImpl@d18c0be (name: <unset>, visibility: <unset>) (value: 1.0);
So here I only want to consider the properties which are not ports: meaning 'in' and 'out'
And I want to access the values 0.0 and 1.0 respectively, but it does not work with [property.defaultValue/].....
2. If I try it another way with the code in 2. I get the following:
doubledoubledoubledouble inoutv0_v1_;
So basically I am wanting to know how I can change the code to get just the Parameters without the ports (I used the Parameter Property under Contraints and Comments) and in the right order, like this:
Thank you,
Frank