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.
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)