[gme-users] OCL constraint question-simple -help needed urgent-beginner

James H. Hill hillj at cs.iupui.edu
Thu Feb 3 10:57:08 CST 2011


Hi,

On Feb 3, 2011, at 6:37 AM, Srimathi C wrote:

> Dear folks
> I have a atom called User which has a attribute Username. It is a
> source to a connector.
> I want to make the username unique.
> I have tried the following constaints
> 1.User.allInstances()->forAll(p1, p2 |
> p1 <> p2 implies p1.Username <> p2.Username )-i am attaching a
> constraint to that of the atom
> 2.self.allInstances()->forAll(p1, p2 |
> p1 <> p2 implies p1.name <> p2.name )
> It says that in both that method meta::user:allInstances does not  
> exist
> 3. Let unameID=project.allInstancesOf(user) in unameID.isUnique(
> i:user | i.Username)

How about simply trying:

  gme::project::allInstancesOf (User)->isUnique (User : u | u.Username)

HTH,

James

>
> But this constraint is not working. I know this is simple.
> But I am breaking my head for past one week for this.
> please help me out anyone. I will be much thankful
> regards
> srimathi.c
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users



More information about the gme-users mailing list