Hello everyone,
I have a question about ATL. Hope you can help me.
I'm facing a problem about how to transform to an element without knowing in advance its existence in the metamodel. Say I have a class A, I want to check whether there's a class named "A1" inherited from A and if yes, transform a given value to A1. Any help will be appreciated.

Hello again,
Could anyone help me on this problem? To be more specific, I'll give an example like this. I want to transform MM1!A to MM2!B. In MM2 I have many classes inheriting from B (B1, B2, ...). In MM1!A I have an attribute typed String like "inheritingClass:String". Now within the transformation rule, basing on the inheritingClass attribute form MM1!A (its value could be 'B1', 'B2', ...), is there any way to determine the subclass form B to which I will transform A's values?
Best regards.

Hi Zheng,
Firstly, thank you for your answer. In fact, my problem is we don't know the value of inheritingClass attribute before writing the rule. I mean, is there a similar approach like this snippet of code:

for all subclasses of B
if there exists a subclass whose type name is equal to A.inheritingClass
then transform A's value to that subclass's value

Because my question is still not answered yet, I reparaphrase it to this question: Is it possible to reason about the existence of the elements of the meta-model in an ATL rule during the rule creation? Is it feasible to write a kind of code with the following philosophy:
If there exists an element named A in the target metamodel then transform a given value to it, else do nothing?
Regards.

On 17/02/12 11:11, Capi Tali wrote:
> Because my question is still not answered yet, I reparaphrase it to this
> question: Is it possible to reason about the existence of the elements of the
> meta-model in an ATL rule during the rule creation? Is it feasible to write a
> kind of code with the following philosophy:
> If there exists an element named A in the target metamodel then transform a
> given value to it, else do nothing?
> Regards.

First of all: this goes against the philosophy of MDE and model
transformation. Models are first-order, and transformations should not reflect
on the metamodels but just use them.

The way around this first-order limitation, is to use a second transformation:
a higher-order transformation. This second transformation will generate your
first-order transformation, made to measure for your specific metamodel.