[ATL] HOT Transformation and TCS [message #652878] |
Mon, 07 February 2011 12:48 |
Eclipse User |
|
|
|
Originally posted by: javi.criado.gmail.com
Hello, I am developing a HOT (High Order Transformation) in ATL. This
transformation belongs to “Transformation sysntesis” class because it
creates a transformation model (conforming to ATL meta-model) from an
input model that conforms to other kind of meta-model. This other
meta-model is for modeling rules in a simple way near to ATL rules. Once
I get the output transformation model, I’m applying a TCS extraction to
get the .atl code. But I have a problem that I would try to explain with
an example:
If I would like to model an assignment like this:
currentState<-(f.smParent.parent.parent.currentEvent.eventTransition- >select(t
|t.source = f.currentState)->collect(t | t.target))->first()
In my rule model, I have:
<assignments>
<attribute nameAttribute="currentState">
<value xsi:type="rule_metamodel:OclExpression"
value="(f.smParent.parent.parent.currentEvent.eventTransition- >select(t
|t.source = f.currentState)->collect(t | t.target))->first()"/>
</assignments>
So, I apply my HOT transformation (it is shown the main rule):
rule AssignmentOclExpression
{
from rm: RMM!Assignment
(
rm.value.oclIsTypeOf(RMM!OclExpression)
)
to bind: ATLMM!Binding
(
propertyName <- rm.attribute.nameAttribute,
value <- oclexp
),
oclexp: ATLMM!NavigationOrAttributeCallExp
(
name <- rm.value.value,
source <- varexp
),
varexp: ATLMM!VariableExp
(
referredVariable <-
thisModule.resolveTemp(rm.toElement.mainRule.fromE->first(),'simple_element')
)
}
And, after the TCS extraction, I get:
currentState<-‘(f.smParent.parent.parent.currentEvent.eventTransition- >select(t
|t.source = f.currentState)->collect(t | t.target))->first()’
Note that the right part of assignment is a “string” type, so I’m not
getting what I want.
I’ve tried with multiple output elements from ATL meta-model
(VariableExp, OperationCallExp, IteratorExp, Iteration, etc) and I’ve
obtained always the same problem after applying the TCS extraction.
I know that the problem will solve if I model (in the output model) the
internal structure of the assignment but I want to avoid this.
So, anybody can help me?
Thanks and regards.
Javier Criado
|
|
|
|
Re: [ATL] HOT Transformation and TCS [message #653328 is a reply to message #653313] |
Wed, 09 February 2011 11:58 |
Eclipse User |
|
|
|
Originally posted by: javi.criado.gmail.com
Yes, but I don't want to inject ATL code in an ATL model transformation.
What I want to do is to transform a rule model to a transformation model
(HOT transformation) and then, I want to obtain the atl code through a
TCS extraction.
Regards.
Javier Criado
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04811 seconds