|EVL: How to define and use a profile and stereotypes in a model validation [message #1730972]
||Sun, 01 May 2016 08:45
| Alireza Rouhi
Registered: December 2015
Considering the following code to create a non-existing class stereotype:
// getting the existing FooProfile
var MyProfile = ProfileModel.select(p|p.name = "FooProfile");
if (not Stereotype.all.exists(s|s.name = "foo"))
// define a new stereotype named with the given name
var stereotype: Stereotype = Stereotype.createInstance();
stereotype.name = "foo";
stereotype.package = MyProfile;
stereotype.feature = "base_Class";
("foo" + " exists!").println();
1) The following error is raised when I apply the code in a UML model validation:
Cannot find meta-class 'foo' in model ''
I think, it is required here to store the created stereotype "foo" in my profile model too. Is this true? How can I add the created stereotype to my profile model file (here ProfileModel)?
2) I want to create a UML profile from scratch, i.e., the profile must be created in the pre section of my EVL module. How can I create this profile in the EOL language?
[Updated on: Sun, 08 May 2016 09:13]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02115 seconds