|
|
Re: Acces QVT-O transformations from other folders or plug-ins [message #991527 is a reply to message #990722] |
Wed, 19 December 2012 16:57 |
Dietrich Travkin Messages: 13 Registered: July 2009 |
Junior Member |
|
|
Hi Ed,
thank you, that was the right hint. Now, I have another problem:
I'm trying to call a transformation within another transformation, but there seems to be no way to create an input model for the called transformation which is not empty, but contains a certain set of objects. My calling transformation looks something like the following:
import MyModel2Ecore;
modeltype Mapping uses ...
transformation CallingTransformation(inout inputMapping:Mapping)
access transformation MyModel2Ecore(inout inputMapping:Mapping)
{
main()
{
var inputObject:= inputMapping.rootObjects()![SomeRoot].applications->select(newInput: SomeType| newInput.name = 'Some Name')![SomeOtherType];
// 1. idea: create an empty model and add the desired objects
//var model : Mapping := design2PatternMapping.createEmptyModel().oclAsType(Mapping);
// inputObject cannot be added to the empty model or set to be the root of the model
// 2. idea: copy the given model end remove all elements, but the desired ones
var model : Mapping := design2PatternMapping.copy().oclAsType(Mapping);
// this seems to remove the root including all contained elements :-(
// I only want to replace the root with another object that is contained in the root
model.removeElement(model.rootObjects()![PatternApplications]);
// call the transformation with the selected input object
var retC := (new MyModel2Ecore(model))->transform();
}
}
I wanted to use this calling transformation for debugging purposes. I want to debug the called transformation which is usually called by Java code with a selected set of objects as input model. When debugging the Java code of the plug-in, I cannot step into the executed QVT code for debugging. So, I decided to directly run the transformation and to use this calling transformation to select the input.
Regards,
Dietrich
|
|
|
Re: Acces QVT-O transformations from other folders or plug-ins [message #991536 is a reply to message #991527] |
Wed, 19 December 2012 17:15 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
Sorry; no ideas other than to dive into the QVTo tooling code to find
out what is really happening at the root.
Regards
Ed Willink
On 19/12/2012 16:57, Dietrich Travkin wrote:
> Hi Ed,
>
> thank you, that was the right hint. Now, I have another problem:
>
> I'm trying to call a transformation within another transformation, but
> there seems to be no way to create an input model for the called
> transformation which is not empty, but contains a certain set of
> objects. My calling transformation looks something like the following:
>
>
> import MyModel2Ecore;
>
> modeltype Mapping uses ...
>
> transformation CallingTransformation(inout inputMapping:Mapping)
> access transformation MyModel2Ecore(inout inputMapping:Mapping)
> {
> main()
> {
> var inputObject:=
> inputMapping.rootObjects()![SomeRoot].applications->select(newInput:
> SomeType| newInput.name = 'Some Name')![SomeOtherType];
>
> // 1. idea: create an empty model and add the desired objects
> //var model : Mapping :=
> design2PatternMapping.createEmptyModel().oclAsType(Mapping);
> // inputObject cannot be added to the empty model or set to be
> the root of the model
>
> // 2. idea: copy the given model end remove all elements, but
> the desired ones
> var model : Mapping :=
> design2PatternMapping.copy().oclAsType(Mapping);
>
> // this seems to remove the root including all contained
> elements :-(
> // I only want to replace the root with another object that is
> contained in the root
> model.removeElement(model.rootObjects()![PatternApplications]);
>
> // call the transformation with the selected input object
> var retC := (new MyModel2Ecore(model))->transform();
> }
> }
>
>
> I wanted to use this calling transformation for debugging purposes. I
> want to debug the called transformation which is usually called by
> Java code with a selected set of objects as input model. When
> debugging the Java code of the plug-in, I cannot step into the
> executed QVT code for debugging. So, I decided to directly run the
> transformation and to use this calling transformation to select the
> input.
>
> Regards,
> Dietrich
|
|
|
Powered by
FUDForum. Page generated in 0.03042 seconds