[ATL] ResolveTemp to lazy rule with multiple source elements [message #492948] |
Thu, 22 October 2009 13:27 |
Marcel Messages: 54 Registered: July 2009 |
Member |
|
|
I have a lazy rule of the following form:
lazy rule some_rule{
from i_in : MM1!p,
j_in : MM1!q
to i_out: MM2!r,
j_out: MM2!s
}
Now I would like to refer to element j_out from another lazy rule.
How should I do that?
I tried something like the following.
Suppose in metamodel MM1, there is a model element x with a reference to model element p. Let's call this reference ref_to_p.
In the lazy rule where x is processed, I added the following:
thisModule.resolveTemp(ref_to_p, 'j_out')
This is obviously wrong, since the lazy rule works on multiple model elements and not just one.
In the lazy rule where x is processed, the model element that j_in matches to is also known.
How should I solve this?
Any help is much appreciated!
[Updated on: Thu, 22 October 2009 13:28] Report message to a moderator
|
|
|
A new attempt [message #493456 is a reply to message #492948] |
Mon, 26 October 2009 11:12 |
Marcel Messages: 54 Registered: July 2009 |
Member |
|
|
I tried to solve it in another way, i.e., using tuples.
The code for the lazy rule is now as follows:
lazy rule some_rule{
from t_in : TupleType(a : MM1!p, b : MM1!q)
to i_out: MM2!r,
j_out: MM2!s
}
Now I try to call resolveTemp as follows:
thisModule.resolveTemp(Tuple{a : ref_to_p, b : ref_to_q}, 'j_out')
When I try to run this, I get the following error:
org.eclipse.m2m.atl.engine.vm.VMException: Could not find operation getNamedTargetFromSource on Void having supertypes: [OclAny]
at A.resolveTemp(1 : J, 2 : S) : ??(SLCO_2_PROMELA.atl)
local variables = {name='i_out', value=Tuple {vertex = IN!DRightRunning, object = IN!Double}, self=SLCO_2_PROMELA : ASMModule}
local stack = []
(This is output from the real example, not the shortened version I gave earlier.)
I assume that this means that the target of the resolveTemp operation cannot be found.
However, when I modify my transformation such that the resolveTemp is not called and I add the following to some_rule:
do{t_in.toString().println();}
I see amongst others the following being printed:
Tuple {vertex = IN!DRightRunning, object = IN!Double}
So this must mean that the target of the resolveTemp operator does exist.
Any ideas or suggestions on how I should implement a resolveTemp to acquire a reference generated by a lazy rule with multiple source model elements?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03380 seconds