Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » assign value to model element automatically (assign value to model element automatically )
assign value to model element automatically [message #1232181] Thu, 16 January 2014 11:22 Go to next message
Salwa Alzahmi is currently offline Salwa AlzahmiFriend
Messages: 37
Registered: June 2013
Member

HelLo,

Is there is a way where i can assign a value to a model elements automatically. for instance when I have an element(A) with attribute that reference another model element (B), i need to build the other attributse of elemnt(A) based on some attribute of element (B)...
Can we achieve that through OCL , or I need to modify the generated code ...

Salwa

Re: assign value to model element automatically [message #1240916 is a reply to message #1232181] Fri, 07 February 2014 08:20 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30352
Registered: July 2009
Senior Member
Salwa,

Comments below.

On 16/01/2014 12:22 PM, Salwa Alzahmi wrote:
>
> HelLo,
> Is there is a way where i can assign a value to a model elements
> automatically. for instance when I have an element(A) with attribute
> that reference another model element (B), i need to build the other
> attributse of elemnt(A) based on some attribute of element (B)...
> Can we achieve that through OCL , or I need to modify the generated
> code ...
This is probably something you want to do in the editor, not directly in
the model. But then again, it sounds a little bit like such other
attributes are derived (should not be modified in a way that's
inconsistent with the reference to B). Is that the case? You can
express the logic for derived attributes using OCL (or with Xcore)...
>
> Salwa
>
>
Previous Topic:Create own PropertyDescriptor
Next Topic:Why code shows class as interface
Goto Forum:
  


Current Time: Mon Aug 19 08:42:35 GMT 2019

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

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

Back to the top