Drived attributes and custom bodies with EAttribute annotations with OCL [message #1698746] |
Wed, 17 June 2015 14:54 |
Claus Rorbech Messages: 2 Registered: June 2015 |
Junior Member |
|
|
I am trying to customize the Java API generated from an example Ecore model by using EAnnotations with OCL, but have not managed to see any changes in the generated code.
My class includes a 'Name'-attribute and a 'DerivedName'-attribute with the following annotation:
<eAnnotations source="http://www.eclipse.org/2007/OCL">
<details key="derive" value="self.Name"/>
</eAnnotations>
I have updated the GenModel to use dynamic templates, added the plugin dependencies by adding OCL_ECORE=org.eclipse.ocl.ecore to the Model Plug-in Variables, and tried setting the transient and volatile attributes.
Any pointers to the below would be appreciated?
- documentation on the various eAnnotation-source accessible features and their constraints
- example projects where the EAnnotations are used to do derived attributes and customized bodies with OCL
|
|
|
|
Re: Drived attributes and custom bodies with EAttribute annotations with OCL [message #1698919 is a reply to message #1698918] |
Thu, 18 June 2015 19:13 |
|
Looks like this:
https://www.eclipse.org/articles/article.php?file=Article-EMF-Codegen-with-OCL/index.html
Apparently, the entire Eclipse Corner article repository is deprecated.
Cheers,
Christian
On 2015-06-18 19:08:26 +0000, Ed Willink said:
> Hi
>
> I've no idea where you got http://www.eclipse.org/2007/OCL. I'm
> guessing that you're following some seriously vintage document.
>
> Follow the OCLinEcore tutorial in the OCL documentation.
>
> Regards
>
> Ed Willink
>
>
> On 18/06/2015 19:21, Claus Rorbech wrote:
>> I am trying to customize the Java API generated from an example Ecore
>> model by using EAnnotations with OCL, but have not managed to see any
>> changes in the generated code.
>> My class includes a 'Name'-attribute and a 'DerivedName'-attribute with
>> the following annotation:
>> <eAnnotations source="http://www.eclipse.org/2007/OCL">
>> <details key="derive" value="self.Name"/>
>> </eAnnotations>
>>
>> I have updated the GenModel to use dynamic templates, added the plugin
>> dependencies by adding OCL_ECORE=org.eclipse.ocl.ecore to the Model
>> Plug-in Variables, and tried setting the transient and volatile
>> attributes.
>> Any pointers to the below would be appreciated?
>> - documentation on the various eAnnotation-source accessible features
>> and their constraints
>> - example projects where the EAnnotations are used to do derived
>> attributes and customized bodies with OCL
|
|
|
|
Powered by
FUDForum. Page generated in 0.03721 seconds