Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » Unique Id and Validation
Unique Id and Validation [message #380000] Tue, 17 April 2007 09:04 Go to next message
Jens Krause is currently offline Jens KrauseFriend
Messages: 3
Registered: July 2009
Junior Member
Hi there,

i have a GMF diagram and want to use the EMFT Validation in there.

I thougth if i set the attribute "unique" of an EClass attribute to true
in my ecore file, the validation automatically checks if this id is
really unique. But it seems that isn't so.

For better understanding here a short view of my structure:

EClass Field
|
+- EAttribute id, Type "ID <java.lang.String>"
|
+- Unique "true"


But if i now set the same id for 2 Fields, no error is shown. Do i have
to increase the priority for the validation provider. It's now set to
"medium". Or do i have to add an extra Audit Rule for that?

Sorry for the crossposting, but i thought this could match both newsgroups.

reagards
Jens K.


** f'up set to eclipse.modeling **
Re: Unique Id and Validation [message #380504 is a reply to message #380000] Tue, 17 April 2007 11:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jens,

The unique attribute only has meaning if the upper bound of the typed
element is greater than one and in that case it implies that the same
value may not occur more than once among the values of that one
feature. You'd use EAttribute.isID to specify that the value represents
an ID that must be unique within the containing resource; this will also
cause that feature's value to be used as the ID for references to the
object carrying that ID.

Cross posting to EMF's newsgroup rather than the general Modeling
newsgroup would be better in the future.


Jens Krause wrote:
> Hi there,
>
> i have a GMF diagram and want to use the EMFT Validation in there.
>
> I thougth if i set the attribute "unique" of an EClass attribute to
> true in my ecore file, the validation automatically checks if this id
> is really unique. But it seems that isn't so.
>
> For better understanding here a short view of my structure:
>
> EClass Field
> |
> +- EAttribute id, Type "ID <java.lang.String>"
> |
> +- Unique "true"
>
>
> But if i now set the same id for 2 Fields, no error is shown. Do i
> have to increase the priority for the validation provider. It's now
> set to "medium". Or do i have to add an extra Audit Rule for that?
>
> Sorry for the crossposting, but i thought this could match both
> newsgroups.
>
> reagards
> Jens K.
>
>
> ** f'up set to eclipse.modeling **


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Unique Id and Validation [message #592338 is a reply to message #380000] Tue, 17 April 2007 11:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jens,

The unique attribute only has meaning if the upper bound of the typed
element is greater than one and in that case it implies that the same
value may not occur more than once among the values of that one
feature. You'd use EAttribute.isID to specify that the value represents
an ID that must be unique within the containing resource; this will also
cause that feature's value to be used as the ID for references to the
object carrying that ID.

Cross posting to EMF's newsgroup rather than the general Modeling
newsgroup would be better in the future.


Jens Krause wrote:
> Hi there,
>
> i have a GMF diagram and want to use the EMFT Validation in there.
>
> I thougth if i set the attribute "unique" of an EClass attribute to
> true in my ecore file, the validation automatically checks if this id
> is really unique. But it seems that isn't so.
>
> For better understanding here a short view of my structure:
>
> EClass Field
> |
> +- EAttribute id, Type "ID <java.lang.String>"
> |
> +- Unique "true"
>
>
> But if i now set the same id for 2 Fields, no error is shown. Do i
> have to increase the priority for the validation provider. It's now
> set to "medium". Or do i have to add an extra Audit Rule for that?
>
> Sorry for the crossposting, but i thought this could match both
> newsgroups.
>
> reagards
> Jens K.
>
>
> ** f'up set to eclipse.modeling **


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Unique Id and Validation
Next Topic:[OMCW] Open Source CourseWare in the Modeling Area
Goto Forum:
  


Current Time: Thu Apr 25 15:57:07 GMT 2024

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

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

Back to the top