Developing Cameo Validation Rules Using Groovy

Cameo Systems Modeler 2022x Refresh2

I have built validation rules before on a constraint using OCL, but am having trouble completing my first one using Groovy as the language. What is the syntax/grammar of a groovy statement to access a tag value of an element? The context for the body of the constraint specification (groovy code) is validate(THIS) : boolean. On the THIS element I have a tag defined as myDate and a tag value set. The body of my constraint specification currently looks like:

try {
   Date date = Date.parse('MM/dd/yyyy', myDate)
   println(myDate) //prints to csm.log
   return true
} catch (Exception e) {
   return false
}

 

Instead of myDate I have tried THIS.myDate,  THIS.getmyDate(), getmyDate(), but none of them seem to actually retrieve the tagged value. I have noted that THIS.getName() returns the element's name successfully.

 

Thanks!