Page 1 of 1

Set Property Default Value with Opaque Expression

PostPosted: Wed Feb 17, 2021 8:57 am
by christopher.t.oravetz@lmco.com
When defining a custom stereotype for my model, I am attempting to create a property with a default value that is calculated based on other attributes within the custom stereotype. Through searching these forums, I've discovered this is possible by setting the "default value" of the property to an opaque expression and using either OCL2.0 or Jython to write a script.

My issue seems basic, but once I write this script (say for example, we just want to set the default value to "1" for simplicity), I cannot figure out how to execute that script and have all the existing elements with that custom stereotype to have this new property with its value set to "1".

Am I missing a step after defining the property's default value in the stereotype definition that would populate this value across all the existing objects?