Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL - two sources (with restrictions) in one rule
ATL - two sources (with restrictions) in one rule [message #1748470] Wed, 23 November 2016 12:41 Go to next message
Guisella Angulo is currently offline Guisella AnguloFriend
Messages: 17
Registered: September 2016
Junior Member
Good morning,
I want to use two sources (with restrictions) in one rule but show it's wrong, when I put the two sources without restrictions the eclipse does not show errors.

rule MethodDeclarationToMethodUnit
{
from
source: KDM!MethodUnit (source.kind = #constructor)
,parametros: KDM!ParameterUnit

[Updated on: Wed, 23 November 2016 12:43]

Report message to a moderator

Re: ATL - two sources (with restrictions) in one rule [message #1748474 is a reply to message #1748470] Wed, 23 November 2016 13:12 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
The filter must be at the end of all the "sources".
By the way, be careful that - as such - this rule will be activated for every possible couple of (MethodUnit,ParameterUnit) in your model, I don't think that is what you want to achieve here (so you probably have to add another condition that specify the precise link that should exist between those two elements for the rule to be activated).
Re: ATL - two sources (with restrictions) in one rule [message #1748475 is a reply to message #1748474] Wed, 23 November 2016 13:23 Go to previous message
Guisella Angulo is currently offline Guisella AnguloFriend
Messages: 17
Registered: September 2016
Junior Member
thanks a lot!
I try to complete all the parameter the each method, You have another idea of how to do this?
PD: I'm working in transformation Model to Model (KDM model to Java Model), for now only with method constructor.

rule MethodDeclarationToMethodUnit
{
from
parametros: KDM!ParameterUnit,
source: KDM!MethodUnit (source.kind = #constructor)

to
target:JAVA!ConstructorDeclaration
(
name <- source.name
,modifier <- variavelModifier
,body <- variavelBody
,parameters <- variavelParameters
)
,variavelModifier:JAVA!Modifier(
visibility <- source.attribute -> collect(f | f.value)
)
,variavelBody:JAVA!Block(

)
,variavelParameters:JAVA!SingleVariableDeclaration(

)

}

[Updated on: Wed, 23 November 2016 13:28]

Report message to a moderator

Previous Topic:OclExpression decomposition in ATL HOT
Next Topic:Simple Transformation Question
Goto Forum:
  


Current Time: Thu Apr 25 20:14:19 GMT 2024

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

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

Back to the top