Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » EMFTVM - Matched rules do not match cross referenced model elements
EMFTVM - Matched rules do not match cross referenced model elements [message #1065351] Tue, 25 June 2013 11:50 Go to next message
Michal Kleczek is currently offline Michal Kleczek
Messages: 27
Registered: May 2013
Junior Member
Hi,

I have a model that has cross-references to objects from another model:
A references B (in another model)

rule Test {
from META!B
to
...
}

is not executed by EMFTVM.
Is there a way to force EMFTVM to process referenced models?

BTW - lazy rules work as expected

Thanks,
Michal

[Updated on: Tue, 25 June 2013 12:07]

Report message to a moderator

Re: EMFTVM - Matched rules do not match cross referenced model elements [message #1065356 is a reply to message #1065351] Tue, 25 June 2013 12:14 Go to previous messageGo to next message
Michal Kleczek is currently offline Michal Kleczek
Messages: 27
Registered: May 2013
Junior Member
Checkd EMFTVM source and there is this piece of code in RuleImpl.matchOne():
if (!inmodels.isEmpty() && !(value instanceof EObject && inmodels.contains(env.getModelOf((EObject) value)))) {
  return false;
}

Is this check necessary?

Thanks,
Michal
Re: EMFTVM - Matched rules do not match cross referenced model elements [message #1065445 is a reply to message #1065356] Tue, 25 June 2013 18:07 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member


  1. 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.
  2. Yes, this check is necessary Wink. It performs the containment check in case you specify an "in" clause in the rule's "from" part (which you did not).


Cheers,
Dennis


Cheers,
Dennis
Re: EMFTVM - Matched rules do not match cross referenced model elements [message #1065496 is a reply to message #1065445] Wed, 26 June 2013 07:17 Go to previous messageGo to next message
Michal Kleczek is currently offline Michal Kleczek
Messages: 27
Registered: May 2013
Junior Member
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 Crying or Very Sad
At least it does not need to be declared in the module.
May I ask what are the reasons for such design?

Thanks,
Michal
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 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

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?
>
> Thanks,
> Michal

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 ;-).

Cheers,
Dennis


Cheers,
Dennis
Re: EMFTVM - Matched rules do not match cross referenced model elements [message #1066444 is a reply to message #1066277] Tue, 02 July 2013 16:58 Go to previous message
Michal Kleczek is currently offline Michal Kleczek
Messages: 27
Registered: May 2013
Junior Member
Dennis Wagelaar wrote on Mon, 01 July 2013 16:23
Op 26-06-13 09:17, > This is pretty unfortunate since it means the launch config depends on the
> contents of the model and cannot be static Crying or Very Sad 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.


This is ok if transformation is done manually. But in my scenario I perform it in a chain - previous steps do some model weaving/merging etc. So it is not known in advance what resources make up the logical model.

Anyway - I've solved it with a custom ant task that traverses the input model and resolves all cross references.

Thanks,
Michal
Previous Topic:ATL Metamodel
Next Topic:retreive every package and subpackage from model
Goto Forum:
  


Current Time: Sat Oct 25 00:46:56 GMT 2014

Powered by FUDForum. Page generated in 0.07952 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software