Book a Demo

Author Topic: NewVal parameter  (Read 2748 times)

Jeanluc

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
NewVal parameter
« on: April 22, 2005, 06:44:00 am »
Hi,

When EA generate function parameter, it use NewVal . In my society,  I need to code with Value rather than NewVal parameter name. I don't see configuration for that. Is it reasonnable to modify Code Generation Templates to change this default behavior ?

Regards,

Jean-Luc

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: NewVal parameter
« Reply #1 on: April 25, 2005, 03:43:47 pm »
There is a bit of a complication to doing this that when EA creates the setter operation, it gives it a name NewVal.  There isn't any way around that at the moment.

However, I haven't tried it, but it should be possible to ignore this name and user Value instead using the templates.

(The following instruction assume not C# or VB.Net)
1. Open the template editor to the operation declaration template for your language.
2. If there is already a "property set" template then select it.  Otherwise add a new stereotype override (probably need to add a stereotype to the model first using Configuration | UML | Stereotypes) and then select it.
3. Modify this template to list over a custom template "Parameter__PropertySet" instead of "Parameter"
4. Create a new custom template for parameter with the name "PropertySet".
5. Copy the normal parameter template to your new one and replace "%paramName%" with "Value".

Without having done it, I'd say that this would do the job for you.

Simon
« Last Edit: April 25, 2005, 03:44:09 pm by simonm »