[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt.amw] Re: dynamic attribute type

        What I'd like to do is best shown by this example:

        class Modification
        {
                attribute type : EcoreType;
                attribute newValue : type;
        }

        so the newValue depends on the selected type. Of course, the sample above
is not correct. Is there any way to do this? This should be possible in the
weaving tool rather then in the further steps when I read the weaving
model.

        thanks in advance very much.

        regards,
                Aram.


Marcos Didonet Del Fabro wrote:

> Hello,
> 
> I am not sure if I understood what you mean by "dynamic type"..
> 
> Anyway, you can define enumerations as you did in the weaving metamodel,
> since it is typically specified using KM3. Then, you can read the
> attribute value to do some special treatment, following your own
> requirements.
> 
> Regards,
> 
> Marcos.
> 
> Aram Hovsepyan wrote:
>>                         Hi Marcos,
>> 
>>         Another question on the definition of the weaving metamodel.
>> 
>>         Is it possible to add dynamic attribute types.
>>         
>>         Here is a simple example
>> 
>>         class Modification
>>         {
>>                 attribute type : EcoreType;
>>                 attribute newValue : Integer;
>>         }
>> 
>>         enumeration EcoreType {
>>                 literal "Boolean";
>>                 literal "String";
>>                 literal "Integer";
>>         }
>> 
>>         I would like to have the type of attribute to depend on the
>>         selected
>> EcoreType rather than Integer.
>> 
>>         thnx in advance.
>>         
>>         regards,
>>                 Aram.
>>

-- 
Aram Hovsepyan
Distrinet research group
Katholieke Universiteit Leuven