Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Problem ATL
Problem ATL [message #988633] Fri, 30 November 2012 18:49 Go to next message
Rafael Durelli is currently offline Rafael DurelliFriend
Messages: 67
Registered: September 2012
Member
Hello guys, i'm new at ATL and I'm trying to create a simple transformation that transform a SQLMODEL, which I've devised, to a KDMSQL, which correspond to a extension to the KDM to model SQL statements. However, when I have to create the Datatype I always get an exception. Please, see the code below


-- @path MM=/SQLMODEL/model/sqlmodel.ecore
-- @path MM1=/KDMSQLExtesion/model/kdmSQL.ecore

module transformation;
create OUT : MM1 from IN : MM;



rule table2TableUnit {
	from
		table : MM!Table
	to 
		tableUnit : MM1!TableUnit (
			name <- table.name,
			codeElement <- table.columns
		)
}

rule column2ColumnUnit {
	from
		column : MM!Column
	to 
		columnUnit : MM1!ColumnUnit (
			name <- column.name,
			type <- column.type //the error of Casting is happing here.
                       //type is Datatype and column.type is a String, how can I create a Datatype correctly?
		)
}


Thanks guys, please help.
Re: Problem ATL [message #988693 is a reply to message #988633] Sat, 01 December 2012 11:50 Go to previous messageGo to next message
Rafael Durelli is currently offline Rafael DurelliFriend
Messages: 67
Registered: September 2012
Member
Someone knows how to fix it? Please let me know. Thanks.
Re: Problem ATL [message #988814 is a reply to message #988693] Mon, 03 December 2012 10:31 Go to previous messageGo to next message
Rafael Durelli is currently offline Rafael DurelliFriend
Messages: 67
Registered: September 2012
Member
-- @path MM=/SQLMODEL/model/sqlmodel.ecore
-- @path MM1=/KDMSQLExtesion/model/kdmSQL.ecore

module transformation;
create OUT : MM1 from IN : MM;



rule table2TableUnit {
	from
		table : MM!Table
	to 
		tableUnit : MM1!TableUnit (
			name <- table.name,
			codeElement <- table.columns
		)
}

rule column2ColumnUnit {
	from
		column : MM!Column
	to 
		columnUnit : MM1!ColumnUnit (
			name <- column.name,
			type.name <- column.type -- Herein is the problem...
		) 
}


I have been tried make type.name (String) <- column.type (also string) but the source code don't compile. Could someone please help me on this?
Re: Problem ATL [message #988816 is a reply to message #988633] Mon, 03 December 2012 10:34 Go to previous messageGo to next message
Rafael Durelli is currently offline Rafael DurelliFriend
Messages: 67
Registered: September 2012
Member
-- @path MM=/SQLMODEL/model/sqlmodel.ecore
-- @path MM1=/KDMSQLExtesion/model/kdmSQL.ecore

module transformation;
create OUT : MM1 from IN : MM;



rule table2TableUnit {
	from
		table : MM!Table
	to 
		tableUnit : MM1!TableUnit (
			name <- table.name,
			codeElement <- table.columns
		)
}

rule column2ColumnUnit {
	from
		column : MM!Column
	to 
		columnUnit : MM1!ColumnUnit (
			name <- column.name,
			type.name <- column.type -- Herein is the problem...
		) 
}



I have been tried make type.name (String) <- column.type (also string) but the source code don't compile. Could someone please help me on this?
Re: Problem ATL [message #988822 is a reply to message #988816] Mon, 03 December 2012 10:58 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 523
Registered: July 2009
Senior Member
rule column2ColumnUnit {
	from
		column : MM!Column
	to 
		columnUnit : MM1!ColumnUnit (
			name <- column.name,
			type <- type
		),
		type : MM1!Datatype (
			name <- column.type
		)
}
Re: Problem ATL [message #988849 is a reply to message #988822] Mon, 03 December 2012 13:03 Go to previous message
Rafael Durelli is currently offline Rafael DurelliFriend
Messages: 67
Registered: September 2012
Member
Thanks Sylvain EVEILLARD. It worked.
Previous Topic:Accessing Data Type Converters
Next Topic:different transformed results between ATL configuration and Java programming transformation
Goto Forum:
  


Current Time: Mon Dec 29 11:02:54 GMT 2014

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

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