Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Move functionality from QVTo to a library.(QVTO library question.)
Move functionality from QVTo to a library. [message #866333] Mon, 30 April 2012 17:05
Satya Muddu is currently offline Satya Muddu
Messages: 1
Registered: April 2012
Junior Member
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 17:06]

Report message to a moderator

Previous Topic:Regla que cree y retorne coleccion de objetos
Next Topic:Official excuses
Goto Forum:
  


Current Time: Tue Jul 29 15:04:02 EDT 2014

Powered by FUDForum. Page generated in 0.01713 seconds