Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Unique attribute value with Audit rules
Unique attribute value with Audit rules [message #144110] Wed, 25 July 2007 10:02 Go to next message
Eclipse UserFriend
Hi !

I want to avoid that the user can use the same name for 2 components.
I tried this constraint :
self.components->isUnique(c | c.name )
and this one :
self.components->forAll(c1, c2 | c1<>c2 implies c1.name<>c2.name).

But those constraint are never raised, I can create 2 components with
the same name. Is there something wrong in those constraint ?

Thanks
Re: Unique attribute value with Audit rules [message #144909 is a reply to message #144110] Tue, 31 July 2007 04:00 Go to previous messageGo to next message
Eclipse UserFriend
Julien Forot wrote:
> Hi !
>
> I want to avoid that the user can use the same name for 2 components.
> I tried this constraint :
> self.components->isUnique(c | c.name )
> and this one :
> self.components->forAll(c1, c2 | c1<>c2 implies c1.name<>c2.name).
>
> But those constraint are never raised, I can create 2 components with
> the same name. Is there something wrong in those constraint ?
>
> Thanks
Hi.

I don't know if you have solved your problem.
I once had this problem, and in fact, the language of the constraint was
not OCL. And none of my constraints were working. Then, I made it
correct in my gmfmap and it was ok.

I don't know if it helps.

Bye,

Vincent.
Re: Unique attribute value with Audit rules [message #146723 is a reply to message #144110] Thu, 16 August 2007 08:02 Go to previous message
Eclipse UserFriend
Hi again..

The constraint is not raised when I change the attribute "name" value,
because I chose the Graph as Domain Element Target, but I have to choose
Component as Domain Element Target. Now my problem is how to access to
Graph with Component as Target ?
I tried that :
Graph.components->isUnique(c | c.name )
but the validation raise an error Unrecognized variable : (components).

Does someone can help me ?

Thanks

Julien Forot a écrit :
> Hi !
>
> I want to avoid that the user can use the same name for 2 components.
> I tried this constraint :
> self.components->isUnique(c | c.name )
> and this one :
> self.components->forAll(c1, c2 | c1<>c2 implies c1.name<>c2.name).
>
> But those constraint are never raised, I can create 2 components with
> the same name. Is there something wrong in those constraint ?
>
> Thanks
Previous Topic:GMF Notation Model vs UML Diagram Interchange
Next Topic:Information: Changing the save behaviour of your editor
Goto Forum:
  


Current Time: Wed Jul 16 21:40:04 EDT 2025

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

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

Back to the top