assign value to model element automatically [message #1232181] |
Thu, 16 January 2014 06:22  |
Eclipse User |
|
|
|
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 03:20  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.06025 seconds