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

Srimathi C srimathi.c at gmail.com
Thu Feb 3 05:37:24 CST 2011


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)

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


More information about the gme-users mailing list