Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Default value specified in OCL for properties
icon5.gif  Default value specified in OCL for properties [message #1721727] Fri, 29 January 2016 13:54 Go to next message
Sebastien GABEL is currently offline Sebastien GABELFriend
Messages: 16
Registered: July 2013
Junior Member
Hi,

Does anymore know if it's still possible to use OCL expressions to initialize default value for (derived) properties coming from a profile ?
After reading the "OCL in UML (using Papyrus)" chapter of the OCL documentation (Cf. section Property Initializers), I tried this from Papyrus Mars SR1 and Neon (Nighlty build) without success. Nothing particular into the Error log.
The documentation applies only to Papyrus Luna, in the newest versions, for example, it is no more possible to specify the context through the property pages.
Any clarification or any status on this point are welcome.
Thanks !
Re: Default value specified in OCL for properties [message #1721781 is a reply to message #1721727] Sat, 30 January 2016 10:09 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

This is an area that has been a bit vague in Ecore (no specification)
and UML/OCL (inadequate specification). The UML specification can be
interpreted as prohibiting it but I think we have drifted to trying to
make it work. There are however a number of hurdles to fall at between
your source and execution. Please provide a repro of what doesn't work
for you.

Regards

Ed Willink


On 29/01/2016 13:54, Sebastien GABEL wrote:
> Hi,
> Does anymore know if it's still possible to use OCL expressions to
> initialize default value for (derived) properties coming from a profile ?
> After reading the "OCL in UML (using Papyrus)" chapter of the OCL
> documentation (Cf. section Property Initializers), I tried this from
> Papyrus Mars SR1 and Neon (Nighlty build) without success. Nothing
> particular into the Error log.
> The documentation applies only to Papyrus Luna, in the newest versions,
> for example, it is no more possible to specify the context through the
> property pages.
> Any clarification or any status on this point are welcome.
> Thanks !
Re: Default value specified in OCL for properties [message #1721786 is a reply to message #1721727] Sat, 30 January 2016 13:30 Go to previous messageGo to next message
Klaas Gadeyne is currently offline Klaas GadeyneFriend
Messages: 165
Registered: July 2009
Senior Member
Hi Sebastien,

Sebastien GABEL wrote on Fri, 29 January 2016 08:54
Hi,

Does anymore know if it's still possible to use OCL expressions to initialize default value for (derived) properties coming from a profile ?


Do you refer to the specification of the initialValue, or to the evaluation of the expression you specify in a model to which your profile is applied?

The former is possible, although the context is not correctly set (yet?) the first time you type an expression. Don't know if there is a bug report about this in papyrus. You will/should note that, when you revisit the expression, that the expression parses correctly.

The latter is only possible if you use a static profile, IIRC. This is https://bugs.eclipse.org/bugs/show_bug.cgi?id=417845

Quote:

After reading the "OCL in UML (using Papyrus)" chapter of the OCL documentation (Cf. section Property Initializers), I tried this from Papyrus Mars SR1 and Neon (Nighlty build) without success. Nothing particular into the Error log.
The documentation applies only to Papyrus Luna, in the newest versions, for example, it is no more possible to specify the context through the property pages.
Any clarification or any status on this point are welcome.
Thanks !


The context should be set 'automatically', but it (at least on my mac) appears it is not yet set correctly the first time.

HTH,

Klaas



Re: Default value specified in OCL for properties [message #1721875 is a reply to message #1721786] Mon, 01 February 2016 08:58 Go to previous messageGo to next message
Sebastien GABEL is currently offline Sebastien GABELFriend
Messages: 16
Registered: July 2013
Junior Member
Hi Klass, Hi Ed,
Thanks for your feedbacks.
Yes, I was referring to the specification of the initial value. I have to point out that my tests had been done in the context of a dynamic profile, probably the source of my initial question.
Re: Default value specified in OCL for properties [message #1721882 is a reply to message #1721875] Mon, 01 February 2016 09:51 Go to previous message
Klaas Gadeyne is currently offline Klaas GadeyneFriend
Messages: 165
Registered: July 2009
Senior Member
Hi,

https://bugs.eclipse.org/bugs/show_bug.cgi?id=486924 submitted for the initialization problem
Previous Topic:Add menu items disabled within diagrams
Next Topic:UML Profile and SMD
Goto Forum:
  


Current Time: Fri Apr 19 14:24:59 GMT 2024

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

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

Back to the top