Move functionality from QVTo to a library. [message #866333] |
Mon, 30 April 2012 21:05 |
Eclipse User |
|
|
|
Sometime before, I have implemented a helper method in my QVTo as below, now this method is required to call by many other QVTOs in my project. So, I am trying to create a common library and move this helper to library, so that I can import that library in all my qvto files.
The main problem is how to pass transformation parameter (z) to library method.
my qvto is as below and I would like to move somehelper() to library, so that I can call from other qvtos
modeltype X "strict" uses '.../X';
modeltype Y "strict" uses '.../Y';
modeltype Z "strict" uses '.../Z';
transformation X2Y(in x : Y, out y : Y, out z : Z);
main(){
x.objectsOfType(X::X1).map toY1();
}
mapping X::X1::toY1() : Y:Y1
{
name := self.name;
somehelper('test',self.resolveone(X::ABC));
}
helper somehelper(str1:String, obj : OclAny)
{
var keyName:String := getKeyName(obj); //this is black box function.
var z1 := object Z::z1@z{};
z1.name := 'z1name';
var z2 := object Z::z2@z{
name := keyName;
};
return;
}
I tried adding a property as below in library and assigning value from transformation, this is not working because it treats as a different type.
Please help me with details as I am new to QVTO transformation.
Thanks in advance,
Satya
[Updated on: Mon, 30 April 2012 21:06] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02900 seconds