In my DSL, I have two stereotypes, namely, System and Deployed System. System stereotype is an extension of a class and also, it inherits from a block. DeployedSystem stereotype is an extension of a part property. In my model, I have SystemA which is a DeployedSystem, so, its applied stereotype is set to DeployedSystem. Also, I have SystemB which is a System, so, its applied stereotype is set to System. Now, in the specification window of SystemA, its type value is set to SystemB.
I have written a OCL statement to validate the above requirement. The requirement is that any element with the applied stereotype of DeployedSystem should have a type, where the value specified in the type should have an applied stereotype of System. Here is the OCL statement I have written for it:
- Code: Select all
context Main1 inv:
self.base_class.getAllProperties()->forAll(p:Property|p.getAppliedStereotype('AHFW_Profile1::DeployedSystem') <> null)
In the above statement, Main1 is a block whose part property is SystemA. On trying to evaluate the OCL statement in the evaluation mode, I get this error message: Context Metaclass is not specified.
I am really not sure what metaclass it is referring to or what I am missing here. So, it would be really great if someone could help me with this issue.