Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] HOT Transformation and TCS
[ATL] HOT Transformation and TCS [message #652878] Mon, 07 February 2011 12:48 Go to next message
Eclipse UserFriend
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 #653313 is a reply to message #652878] Wed, 09 February 2011 10:30 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
There was an 'inject' operation that allowed to inject ATL code locally in an ATL transformation but I don't know if it's still available on ATL3.0.

It worked like this :

'your ATL Expression'.inject('name of the output model', 'ebnf2', 'ATL-type of the root ATL object of the expression')
Re: [ATL] HOT Transformation and TCS [message #653328 is a reply to message #653313] Wed, 09 February 2011 11:58 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: [ATL] HOT Transformation and TCS [message #653338 is a reply to message #652878] Wed, 09 February 2011 13:13 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Yes I know that's why you would have :
to bind: ATLMM!Binding
(
propertyName <- rm.attribute.nameAttribute,
value <- rm.value.value.inject('OUT','ebnf2','ATL-NavigationOrAttributeCallExp')
)


or something of this kind.
That's a bit odd because at the extraction time TCS will re-extract it in the original form but I don't foresee another solution.
Re: [ATL] HOT Transformation and TCS [message #653538 is a reply to message #653338] Thu, 10 February 2011 08:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: javi.criado.gmail.com

Yes, that's the problem, the TCS re-extraction that converts the complex
expression to String type...
Re: [ATL] HOT Transformation and TCS [message #653543 is a reply to message #652878] Thu, 10 February 2011 08:39 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
It won't be in String with the inject operation.

'inject' transforms locally an ATL expression into it's corresponding ATL AST elements. So when you'll re-extract it, it will be transformed back to the original expression but not in string.
Previous Topic:[QVTo] Content assist and truncating file
Next Topic:simple UML2UML without results
Goto Forum:
  


Current Time: Fri Apr 19 07:58:30 GMT 2024

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

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

Back to the top