|Re: EMFTVM - Matched rules do not match cross referenced model elements [message #1066277 is a reply to message #1065496]
||Mon, 01 July 2013 20:23
|| Dennis Wagelaar
Registered: September 2012
Op 26-06-13 09:17, Michal Kleczek schreef:|
> Dennis Wagelaar wrote on Tue, 25 June 2013 14:07
>> You need to add any models you want processed by matched rules to the list
>> of input (or in/out) models in your launch config.
> This is pretty unfortunate since it means the launch config depends on the
> contents of the model and cannot be static :cry: At least it does not need to
> be declared in the module.
Your launch config also depends on the URI of your specific input model. Hence
it is already specific for your particular model contents. The transformation
module is indeed intended to be general.
> May I ask what are the reasons for such design?
The VM needs to know up-front over which model elements it needs to iterate
when matching rules.
For metamodels, we use eager metamodel traversal to find the metamodel's
Resource import closure. In other words: we try to load everything reachable
from the "starting" metamodel by navigating every reference of every object.
This works for metamodels as they are relatively small. Eagerly resolving all
referenced elements for a regular input model before starting the
transformation is generally not feasible. It typically cuts your performance
in half - just by navigating the entire input model(s) twice - or worse,
depending on how many external model elements there are to traverse.
Also, you cannot just rely on EMF's ResourceSet lazy loading during the rule
matching, as that would give different transformation results depending on the
rule ordering (against ATL design). New elements may appear in a ResourceSet
as you navigate over a Resource.
Knowing this, it's not so bad to explicitly specify to ATL which models you
want transformed ;-).
Powered by FUDForum
. Page generated in 0.03288 seconds