[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.m2m] Re: [ATL] href in IN model
|
- From: mllacer@xxxxxxxxxxxxx (Miguel Llácer)
- Date: Tue, 15 Apr 2008 10:20:45 +0000 (UTC)
- Newsgroups: eclipse.modeling.m2m
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
I don't know if you have understood me.
I have a metamodel CatalogMM and this metamodel has an element Instance
that has a reference (called type) to EModelElement of Ecore metamodel.
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.
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
that instance.type.oclType() is CATALOG!EClass.
I thought that instance.type.name as you tell me too, should return
Generalization or Class but it return as this reference (instance.type)
doesn't reference to any element of UML.ecore.
I copy a fragment of my atl code an its result:
ATL CODE
let s : String = '' in ('Instance '+elem.type.toString()).println();
let s : String = '' in ('Instance
'+elem.type.oclType().toString()).println();
let s : String = '' in ('Instance
'+elem.type.name.oclType().toString()).println();
let s : String = '' in ('Instance
'+UML!"uml::Generalization".name.toString()).println();
let s : String = '' in ('Instance
'+UML!"uml::Generalization".oclType().toString()).println();
RESULT EXECUTION
INFO: Instance IN!<notnamedyet>
INFO: Instance OclUndefined
INFO: Instance CATALOG!EClass
INFO: Instance Generalization
INFO: Instance MOF!EClass
What is it happening ?¿