|
|
|
|
|
Re: [ATL] href in IN model [message #79231 is a reply to message #79173] |
Tue, 15 April 2008 13:24 |
urs zeidler Messages: 91 Registered: July 2009 |
Member |
|
|
Miguel Llácer schrieb:
> I don't know if you have understood me.
>
It seems that I don't.
> I have a metamodel CatalogMM and this metamodel has an element Instance
> that has a reference (called type) to EModelElement of Ecore metamodel.
>
That's why it is important to have allowInterModelReferences switched
on, only than the transformation will follow references to other model,
like your UML.ecore.
> An instance of this CatalogMM could be:
> ..
> Instance
> name - Clase1
> type - Class->EncapsuledClassifier,BehavioredClassifier
> Instance
> name - Generalizacion1
> type - Generalization->DirectedRelationship
> ..
> In this model of CatalogMM, type reference of Instance elements is a
> reference to elements of UML.ecore as you can see.
>
So CatalogMM is youre M2 and ecore is your M1.
>
> Now, when I want to transform this Catalog to another model, I have to
> check in my rules what is instance.type kind ?
>
> As you tell me, I could do
> instance.type.oclIsTypeOf(UML"uml::Generalization") but the problem is
I thought your are transforming an UML model.
> that instance.type.oclType() is CATALOG!EClass.
Indeed it is.
> let s : String = '' in ('Instance
> '+UML!"uml::Generalization".name.toString()).println();
>
> INFO: Instance Generalization
This is what you wanted, or better what you can get, the name of the
EClass. And it is what instance.type.name should return.
This would be your discriminator, the name of the EClass in
instance.type Generalization/Class .... what ever name the EClass has.
greetings, urs.
|
|
|
|
Re: [ATL] href in IN model [message #79405 is a reply to message #79245] |
Wed, 16 April 2008 16:09 |
urs zeidler Messages: 91 Registered: July 2009 |
Member |
|
|
Miguel Llácer schrieb:
> Yes, I have, all the time, allow inter-model references switched on.
>
>> This is what you wanted, or better what you can get, the name of the
>> EClass.
> And >it is what instance.type.name should return.
>> This would be your discriminator, the name of the EClass in
>> instance.type Generalization/Class .... what ever name the EClass has.
>
> As you say, what I want is to discriminate instance.type but the problem
> is that
> instance.type returns IN!<notnamedyet> and
> instance.type.name returns OclUndefined and not Generalization/Class.
>
> I don't understand why.
>
This is quite odd, and unexpected, based on our assumptions.
greetings, urs.
|
|
|
|
Powered by
FUDForum. Page generated in 0.07423 seconds