Mandatory attribute with default value [message #430638] |
Mon, 01 June 2009 09:43 |
|
Hi all,
We have mandatory xml attribute that must exist when domain file is
created for the first time, its default value must equal to the domain
file name. How to specify this kind attribute in the genmodel/ecore files ?
Any help would be greatly appreciated.
Regards,
Setya
|
|
|
|
Re: Mandatory attribute with default value [message #430641 is a reply to message #430640] |
Mon, 01 June 2009 10:05 |
|
Hi Ed,
> This sounds like something the application needs to do not something the
> model can do for you automatically. It also sounds error prone given
> that copying a file to another location will produce an inconsistent
> result. Does it end up being the full absolute path for the file or what?
No, it's just the file name without extension & full path. The attribute
serves as some kind of identifier.
Regards,
Setya
|
|
|
|
Re: Mandatory attribute with default value [message #430643 is a reply to message #430642] |
Mon, 01 June 2009 10:42 |
|
Hi Ed,
> Maybe you'll want to modify the generated wizard to set this value when
> the instance file is first created.
Thanks.
I've specified the attribute's Lower Bound property to 1 & also specify
the Default Value Literal property but still the attribute is not set
when the file created by the wizard, but the editor for this attribute
is generated with default value in the Properties View.
I guess I'll have to take a look at the generated wizard.
Regards,
Setya
|
|
|
Re: Mandatory attribute with default value [message #430644 is a reply to message #430643] |
Mon, 01 June 2009 11:02 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Setya,
Comments below.
Setya wrote:
> Hi Ed,
>
>> Maybe you'll want to modify the generated wizard to set this value
>> when the instance file is first created.
>
> Thanks.
>
> I've specified the attribute's Lower Bound property to 1 & also
> specify the Default Value Literal property but still the attribute is
> not set when the file created by the wizard, but the editor for this
> attribute is generated with default value in the Properties View.
Defaults aren't serialized.
>
> I guess I'll have to take a look at the generated wizard.
Given you want a different value in each instance, it's not really a
default...
>
>
> Regards,
>
> Setya
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03725 seconds