[gme-users] OCL constraint question

Jared Crace Jared.Crace at pb.com
Sat Sep 26 22:42:47 CDT 2009


Thanks for your help.  That was the problem.


From: gme-users-bounces at list.isis.vanderbilt.edu [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Larry Howard
Sent: Friday, September 25, 2009 1:42 PM
To: A list for GME users to share thoughts and discuss bugs and fixes.
Subject: Re: [gme-users] OCL constraint question


Seems like a trick question.

let jira=project.allInstancesOf(StartTestCase) in jira.isUnique( i:StartTestCase | i.name<http://i.name>)

So perhaps the matter has to do with enforcement (or "checking".)  You can use the "on change property" event to check the constraint whenever a "StartTestCase" atom is renamed.  One consequence of this choice is that each atom must be given a unique name before the creation of the next, since all are created with the same name ("StartTestCase").

If you want to force aborting a renaming operation on the constraint violation, you can change the constraint's Priority attribute to 1.

Hope that helps.

Larry Howard, Sr. Research Scientist
Institute for Software Integrated Systems, Vanderbilt University

On Sep 25, 2009, at 1:20 PM, Jared Crace wrote:

Hi All,

I have created an atom named "StartTestCase" that has an attribute called "JiraItem".  I have written a constraint to verify that all JiraItems must have a unique name.  The constraint I wrote was:

let jira=project.allInstancesOf(StartTestCase) in jira.isUnique( i:StartTestCase | i.JiraItem)

The constraint works just fine.  But I would also like to write another constraint that makes sure the user renames the "StartTestCase" atom to a unique name.  Could you please let me know how to accomplish this?


Jared Crace
Pitney Bowes
Software Engineer
gme-users mailing list
gme-users at list.isis.vanderbilt.edu<mailto:gme-users at list.isis.vanderbilt.edu>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20090926/c7ab6d71/attachment.html 

More information about the gme-users mailing list