Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Could we create an ATL rule without using the "TO" part([ATL] Could we create an ATL rule without using the "TO" part)
[ATL] Could we create an ATL rule without using the "TO" part [message #659331] Sat, 12 March 2011 12:11 Go to next message
bacha  is currently offline bacha Friend
Messages: 53
Registered: July 2009
Member
Hi,

I would like to know if we can create an ATL rule without using the "TO" part.
For example :

module X;
create OUT : out1 from IN : in1, IN1 : in2;

rule TargetfromSource {
from
x :in1!element
using{
-- variables declaration
}
do
{
-- The next part of the rule


In the "DO" part I invoke called rules that treat the target model element.
I tried it and it works perfectly without errors and I had my target models but I dont know if it is correct or not.

Thanks,

Regards
Re: [ATL] Could we create an ATL rule without using the "TO" part [message #659488 is a reply to message #659331] Mon, 14 March 2011 09:21 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
According to the user guide this is not allowed as "to" is not optional...

rule rule_name {
from
in_var : in_type [in model_name]? [(
condition
)]?
[using {
var1 : var_type1 = init_exp1;
...
varn : var_typen = init_expn;
}]?
to
out_var1 : out_type1 [in model_name]? (
bindings1
),
out_var2 : distinct out_type2 foreach(e in collection)(
bindings2
),
...
out_varn : out_typen [in model_name]? (
bindingsn
)
[do {
statements
}]?
}

Perhaps, you won't get an error but it isn't a good idea to write this sort of rule as you not using ATL as it was designed to be used. From what I can see with this technique you will be using ATL as an imperative/procedural language rather than using its declarative power.
Regards,
Ronan
Previous Topic:[ATL] Enrich Models with additional information
Next Topic:[QVTO] CST, Pretty Printer
Goto Forum:
  


Current Time: Thu Feb 25 17:12:44 GMT 2021

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

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

Back to the top