Possible problems with implicit properties of Stereotypes [message #1759300] |
Mon, 10 April 2017 11:33 |
Alexander Kraas Messages: 9 Registered: March 2015 |
Junior Member |
|
|
Hello OCL community,
I have encountered some problems with implicit properties ('extension_'Stereotype_name' and 'base_'metaclass_name') of Stereotypes for navigating from a UML element instance to a Stereotype instance. I have created a simple test Profile and a tiny UML model to reproduce the encountered proplems. Maybe, someone could give me feedback, if the below mentioned issues are problems of the Pivot-OCL implementation of Eclipse.
Many thanks in advance,
Alexander
The Package 'Package' in My.uml contains a Class named 'TClass' and an Interface named 'TInterface'. Both elements have the <<Test>> Stereotype of the 'TestProfile' profile applied. Since this stereotype extends the UML metaclasses 'Class' as well as 'Interface'. When an instance of UML Class is extended, the implicit properties 'extension_Test' and 'base_Class' shall be present in OCL to navigate from the Class instance to the <<Test>> instance and vice versa. In contrast, for an Interface instance, the implicit properties 'extension_Test' and 'base_Interface' shall be present. However, when I try to use this implicit properties in the Xtext OCL console, I have encountered the following issues:
1. Open the file My.uml file with the default UML tree-style editor
2. Open the Xtext OCL console
3. Select the UML Class "TClass" in My.uml and enter the following OCL expressions in the OCL console:
Evaluating:
self.extension_Test.base_Class
Results:
Package::TClass [OK!]
Evaluating:
self.extension_Test.base_Interface
Results:
Package::TClass [Expected: null]
4. Select the UML Interface "TInterface" in My.uml and enter the following OCL expression in the OCL console:
Evaluating:
self.extension_Test.base_Interface
Results:
Parsing failure
1: Ambiguous resolution:
Property : UML::Interface::extension_Test # TestProfile::Test::base_Interface
Property : UML::Class::extension_Test # TestProfile::Test::base_Class
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03807 seconds