Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Mandatory attribute with default value
Mandatory attribute with default value [message #430638] Mon, 01 June 2009 09:43 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
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 #430640 is a reply to message #430638] Mon, 01 June 2009 09:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Setya,

Comments below.

Setya wrote:
> 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 ?
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?
>
> Any help would be greatly appreciated.
>
> Regards,
>
> Setya


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Mandatory attribute with default value [message #430641 is a reply to message #430640] Mon, 01 June 2009 10:05 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
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 #430642 is a reply to message #430641] Mon, 01 June 2009 10:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Setya,

Maybe you'll want to modify the generated wizard to set this value when
the instance file is first created.


Setya wrote:
> 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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Mandatory attribute with default value [message #430643 is a reply to message #430642] Mon, 01 June 2009 10:42 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Previous Topic:How to turn element name into lowercase using eAnnotations ?
Next Topic:Ecore Model Dependencies with No NS Prefix
Goto Forum:
  


Current Time: Sat Apr 20 03:04:19 GMT 2024

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

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

Back to the top