Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » add a new attributes to the new model
add a new attributes to the new model [message #1064463] Wed, 19 June 2013 12:05 Go to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
Hi,

if we focus on family to person transformation example.
how can i do to add to new attributes to the model person when that new attributes are not ammapping any ones in the family model.

that means if i have:


a model A ( families) with 2 classes:

the class: Family with attribute lastName:String
and the class Member with attribute firstName:String

and after applying my transformation and want to have

a model B (persons) with 1 classes:

the class : persons with 3 atributes:
lastName:String from the attribute lastName of the class Family
firstName:String from the attribute firstName of the class Member
and a new attribute gender: String.

hw should i notice in a atl code that the attibute gender is a new one from scratch and had nothing to do with the model A.


thks in advance,

Frank
Re: add a new attributes to the new model [message #1065125 is a reply to message #1064463] Mon, 24 June 2013 12:51 Go to previous message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member
I don't think that there is a way to know if an attribute in the target model has a direct mapping to the source model or not.

You don't need to have a one-to-one mapping anyway, but you'll have to get the gender value by using the available information on the source. Let's say there is a way to obtain gender information from the person's name and you created a helper method for it. Then you can simply assign the return value of that method to the gender


name <- src.name,
gender <- thisModule.getGender(src.name)


Previous Topic:[ATL] Define types in ATL
Next Topic:Problem with Helper
Goto Forum:
  


Current Time: Tue Apr 23 16:43:19 GMT 2024

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

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

Back to the top