[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.m2m] [ATL] Re-usable modules with metamodels as formal parameters?

Hi all,

my metamodels have common subsets of metaclasses. For these metaclasses, I have fixed transformation rules. Is it possible to put these rules into a separate "rule library" module and use them from several other transformations?

Example:

Metamodels MA, MB and MC all share the same metaclass MClass with the same set of attributes. There are transformations that transform MA into MB or MB into MC.

So, I'd like to be able to write something like this:

module MClassLibrary (param1, param2);

create OUT: param2 from IN: param1;

-- Copy all MClasses from one model to the next
rule MClassToMClass {
	from mclassIn : param1!MClass
	to mclassOut : param2!MClass (
        name <- mclassIn.name
        ,someOtherAttribute = mclassIn.someOtherAttribute
	)
}

And then:

module TransformAtoB;
create OUT: MB from IN: MA;
uses MClassLibrary (MA, MB);
-- more rules that operate especially on MA go here.

As well as:

module TransformBtoC;
create OUT: MC from IN: MB;
uses MClassLibrary (MB, MC);
-- more rules that operate especially on MB go here.

Is this possible? How?

Cheers,
Matthias at andromda.org