Transforming two model instances into a single model instance [message #1234575] |
Wed, 22 January 2014 09:43 |
Ben Haldo Messages: 6 Registered: October 2013 |
Junior Member |
|
|
I am trying to learn model transformation using QVTO. I have two simple source models (VehicleMM , DriverMM )each with a single class and a single attribute. My target metamodel (CarMM )has also one class but has two attributes. I want to transform VehicleMM and DriverMM attributes to the first and the second attributes of MMC.
So far I managed to write a transformation like this:
modeltype CarMM uses ".....";
modeltype VehicleMM uses ".....";
modeltype DriverMM uses ".....";
transformation VehitoCar(in vehiSource:VehicleMM, out carTarget:CarMM);
main() {
vehiSource.rootObjects()[Vehicle] . map vehi2Car( ????? );
}
mapping Vehicle::vehi2Car(driverInst:Driver):Car{
brand := self.brand;
driver := driverInst.drivName;
}
I couldn't figure how to instantiate the Driver model to pass it to the vehi2Car mapping. I mean what kind of construct should be placed in place of ????? Any ideas on how to achieve this?
[Updated on: Wed, 22 January 2014 09:45] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04778 seconds