[gme-users] OCL constraint question
Larry Howard
larry.howard at vanderbilt.edu
Fri Sep 25 14:42:23 CDT 2009
Jared,
Seems like a trick question.
let jira=project.allInstancesOf(StartTestCase) in jira.isUnique
( i:StartTestCase | 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.
Regards,
lph
--
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?
>
> Thanks
>
> Jared Crace
> Pitney Bowes
> Software Engineer
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20090925/80aa0a0d/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2682 bytes
Desc: not available
Url : http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20090925/80aa0a0d/attachment.bin
More information about the gme-users
mailing list