Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsDefault value specified in OCL for properties
https://www.eclipse.org/forums/index.php/mv/msg/1074297/1721727/#msg_1721727
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 !]]>Sebastien GABEL2016-01-29T13:54:36-00:00Re: Default value specified in OCL for properties
https://www.eclipse.org/forums/index.php/mv/msg/1074297/1721781/#msg_1721781
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 !]]>Ed Willink2016-01-30T10:09:52-00:00Re: Default value specified in OCL for properties
https://www.eclipse.org/forums/index.php/mv/msg/1074297/1721786/#msg_1721786
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.
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
]]>Klaas Gadeyne2016-01-30T13:30:29-00:00Re: Default value specified in OCL for properties
https://www.eclipse.org/forums/index.php/mv/msg/1074297/1721875/#msg_1721875
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.]]>Sebastien GABEL2016-02-01T08:58:43-00:00Re: Default value specified in OCL for properties
https://www.eclipse.org/forums/index.php/mv/msg/1074297/1721882/#msg_1721882
https://bugs.eclipse.org/bugs/show_bug.cgi?id=486924 submitted for the initialization problem
]]>Klaas Gadeyne2016-02-01T09:51:40-00:00