Home » Modeling » ATL » Checking whether ATL module may be used for given target MM and model
Checking whether ATL module may be used for given target MM and model [message #1713058] |
Fri, 30 October 2015 09:09  |
Eclipse User |
|
|
|
Hi.
We are developing a project with use of EMF, where we have one main metamodel (MM1) and a number of 'small' metamodels that are a 'subset' of MM1. Each of this small metamodels needs its own set of tools (parsers, analyzers, configuration generators), and we do not want to work with MM1 while developing them, as MM1 is redundunt. So, we need to transforms models.
We are currently using ATL/EMFTVM and for some reason allow users to transforms instances of MM1 to instance of any other metamodel with any ATL module. Instances of MM1 consist of a big number of 'components' and each also can be transformed using our wizard (we run emftvm programatically).
The problem is that there is a great total number of components that can be transformed, while only few the potentially may be used with given ATL module. So we need to filter models that can be IN models for some module. The obvious way to do it is just to run a module under each of these models and accept those, which do not fail (throw exceptions), but it may be time consuming and 'not academic'.
So the question is, aren't there any tools or ATL/EMFTVM SDK support for checking these condtions?
|
|
| | | |
Re: Checking whether ATL module may be used for given target MM and model [message #1716504 is a reply to message #1715172] |
Fri, 04 December 2015 07:54   |
Eclipse User |
|
|
|
Thanks, Dennis.
We've implemented some obvious 'checks', that emftvm module may be used with given MM (whether IN or OUT). We check, whether each rule of module uses only metaclasses, specified in MM. Another question is now how to check it in more academic way, as we just compare type literals, which may be unreliable.
The problem now is to think of a way to filter models (EObjects), that may be used with given IN MM, OUT MM and emftvm module (given that model conforms to IN MM). Is it appropriate to check for example that at least one rule of module will be executed? By 'executed' I mean, that input model (EObject) has in its content all the elements, specified in the FROM clause of module. Here we assume, that if no rule may be matched, the transformation has no semantic sense, despite technically it may be legal. Are there some other checks of this kind?
|
|
|
Re: Checking whether ATL module may be used for given target MM and model [message #1716738 is a reply to message #1716504] |
Mon, 07 December 2015 16:34   |
Eclipse User |
|
|
|
Dmitry Tatarinov wrote on Fri, 04 December 2015 13:54
We've implemented some obvious 'checks', that emftvm module may be used with given MM (whether IN or OUT). We check, whether each rule of module uses only metaclasses, specified in MM. Another question is now how to check it in more academic way, as we just compare type literals, which may be unreliable.
EMFTVM only links its modules against real metamodels at load-time, which is why the .emftvm files only contain lexical references to metaclasses. When loading an EMFTVM module into an ExecEnv instance, the actual metaclasses will be resolved against the registered metamodels, and the "eType" property of the various typed elements will have been filled in. Using such a loaded EMFTVM module should allow you to check - using the actual EMFTVM type resolver algorithm - whether the exact same metaclasses of the MM are also used in the EMFTVM module.
Dmitry Tatarinov wrote on Fri, 04 December 2015 13:54
The problem now is to think of a way to filter models (EObjects), that may be used with given IN MM, OUT MM and emftvm module (given that model conforms to IN MM). Is it appropriate to check for example that at least one rule of module will be executed? By 'executed' I mean, that input model (EObject) has in its content all the elements, specified in the FROM clause of module. Here we assume, that if no rule may be matched, the transformation has no semantic sense, despite technically it may be legal. Are there some other checks of this kind?
You may check whether the intersection of metaclasses referenced by the input model and the InputRuleElement instances of "#automaticSingle" Rules in the EMFTVM model is non-empty. That means that there are ATL matched rules that take instances of those metaclasses as input. Keep in mind that this approach ignores any OCL filter expression used on the rule's "from" part, however, and the actual rule may still not trigger due to the filter expression evaluating to"false".
|
|
| | | |
Goto Forum:
Current Time: Wed Jul 23 21:12:55 EDT 2025
Powered by FUDForum. Page generated in 0.06266 seconds
|