Set Property Default Value with Opaque Expression

Starting point for “ask and learn more about MagicDraw”

Moderator: Moderators

Set Property Default Value with Opaque Expression

Postby » Wed Feb 17, 2021 8:57 am

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?
Forum Newbie
Forum Newbie
Posts: 1
Posts Rating:0
Joined: Thu Jan 21, 2021 10:55 am

Return to New to MagicDraw

Who is online

Users browsing this forum: No registered users and 0 guests