Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » OCL evaluating derived stereotype attributes
OCL evaluating derived stereotype attributes [message #1712416] Fri, 23 October 2015 21:46 Go to next message
Johan Van Noten is currently offline Johan Van NotenFriend
Messages: 87
Registered: July 2009
Member
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".

index.php/fa/23689/0/

Additionally tried:
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.

index.php/fa/23691/0/

Question:
* 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?

Thanks,
Johan

Re: OCL evaluating derived stereotype attributes [message #1712427 is a reply to message #1712416] Sat, 24 October 2015 08:45 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6758
Registered: July 2009
Senior Member
Hi

The problem is that Requirement2 is a nested classifier which fails to
convert to the MOF-like OCL Pivot model that has no support for nested
classifiers. Probably just requires the nesting hierarchy to be
flattened with stylized names.

If a query mechanism is simple enough to be evaluated directly on the
UML model you see useful text.

If a more advanced internal mechanism requires conversion of the nested
classifier you get a disappointing result.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=480562 raised.

Regards

Ed Willink


On 23/10/2015 22:46, Johan Van Noten wrote:
> 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".
>
>
>
> Additionally tried:
> 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.
>
>
>
> Question:
> * 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?
>
> Thanks,
> Johan
>
>
Re: OCL evaluating derived stereotype attributes [message #1712440 is a reply to message #1712427] Sat, 24 October 2015 21:03 Go to previous message
Johan Van Noten is currently offline Johan Van NotenFriend
Messages: 87
Registered: July 2009
Member
Ed, thanks for your quick reply.
I'll keep an eye on the bug.
Previous Topic:Creating diagram from modelset?
Next Topic:Custom Property View Widget for Operation Result Parameter
Goto Forum:
  


Current Time: Sun Jul 05 11:26:45 GMT 2020

Powered by FUDForum. Page generated in 0.02264 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top