Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » One to many transformation
One to many transformation [message #911862] Wed, 12 September 2012 09:16 Go to previous message
Cristiano De Faveri is currently offline Cristiano De Faveri
Messages: 13
Registered: August 2012
Junior Member
Hi All,

I have a scenario which a target model should create a sequence of classes due to the list of Strings another class holds.

The code snippet below illustrates the problem. I have FindClause which has bindingObjects whichs holds a list of aliases (EStrings).
For each Aliases I have to create a ObjectSource class which alias will be each FindClause.bindingObject.Alias of the list and className will be an String according to the type attribute of BindingObject.

I started a rule Find2From and created a helper to return the className based on FindClause.bindingObject.type, however how to fill alias attribute based on the FindClause.bindingObject.alias list ?

Many thanks in advance.

**** INModel ****

+-FindClause (clause : EString, bindingObject : BindingObject (1..*))
+-BindingObject (type : ObjectType, alias : EString (1..*))
+-ObjectType ( value : EString)

*******OUTModel*******

+-FromClause (clause : EString, objectList : ObjectSource (1.*))
+-ObjectSource(alias : EString, className : EString)

rule Find2From {
	from
		findClause : ajqlModel!FindClause
	to 
		fromClause : hqlModel!FromClause  (
			clause <- 'From',
			ObjectSource <- Sequence {source} 
			)
		source : hqlModel!ObjectSource (
   	            -- className <- thisModule.getObjectName(findClause.bindingObject.type)
		    -- alias <- ?[/color]??
	)
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:How to convert ATL-file to EMF-file?
Next Topic:ATL Plugin with 2 source metamodels
Goto Forum:
  


Current Time: Sun May 19 14:34:35 EDT 2013

Powered by FUDForum. Page generated in 0.02037 seconds