|OCL evaluating derived stereotype attributes [message #1712416]
||Fri, 23 October 2015 21:46
| Johan Van Noten
Registered: July 2009
Version: Papyrus 1.1.2 Nightly (2015-10-21)|
As my colleague Klaas posted before (https://www.eclipse.org/forums/index.php/t/469618/) there are some limitations as to defining the value for derived values through OCL.
As far as I saw, it doesn't cover what I tried today: use a derived value in an OCL constraint.
As an example, I used the derived "derived" attribute of a SysML Requirement.
The model shown below (and included in the attached zip) shows the problem.
Starting the interative Xtext OCL console and performing the shown OCL queries, shows that the derived "derived" attribute is oclInvalid, while the diagram correctly shows its value as "Requirement2".
You don't have to look in any profiles to find derived values. Also UML has derived values. E.g. the "part" attribute of a Component is a derived value.
When I try to use that in an OCL query, it seems to work fine.
* Does this mean that derived attributes of stereotypes cannot be used in OCL queries?
* As a consequence: constraints defined on profiles cannot make use of derived attributes?
* If OCL doesn't know the value, is it Papyrus that is calculated the value?
Powered by FUDForum
. Page generated in 0.02264 seconds