|
|
Re: Transformations chaining for inout model [message #1250878 is a reply to message #1250851] |
Wed, 19 February 2014 17:41 |
Naif Mokhayesh Messages: 31 Registered: November 2011 |
Member |
|
|
thanks Ed for your reply and cooperation
regarding to the transformation1 and transformation2 model parameters direction are as follow , sorry for not copy in the original message.
Im using latest version of qvto 3.4.0M5 (2014/01/29)
I doubt it is bug, maybe I'm doing something wrong that is not following the execution flow of transformation chaining ! correct me please if I'm wrong
please advice
import transformation1;
import transformation2;
modeltype UML uses 'http://www.eclipse.org/uml2/2.1.0/UML';
transformation chainTransformation( inout mainModel : UML, in model1 : UML, in model2 : UML)
access transformation transformation1
access transformation transformation2;
main() {
new transformation1(mainModel, model1).transform();
-- do something .....
new transformation2(mainModel , model2).transform(); // the passed mainModel here should be the updated one from transformation1.... but in the execution it passes the original loaded one !!
}
// In-Place transformation
transformation transformation1(inout mainModel : UML, in model1 : UML);
the result of transformation1 modified the passed inout model. Now chainTransformation will call transformation2 and pass the resulted inout model from transformation1
// updatedModel here is the result of transformation1
transformation transformation2( inout updatedModel : UML, in model2 : UML);
[Updated on: Wed, 19 February 2014 17:47] Report message to a moderator
|
|
|
Re: Transformations chaining for inout model [message #1250965 is a reply to message #1250878] |
Wed, 19 February 2014 19:40 |
Ed Willink Messages: 7669 Registered: July 2009 |
Senior Member |
|
|
Hi
It looks sensible to me; raise a Bugzilla.
Regards
Ed Willink
On 19/02/2014 17:41, Naif Mokhayesh wrote:
> thanks Ed for your reply and cooperation
> regarding to the transformation1 and transformation2 model parameters
> direction are as follow , sorry for not copy in the original message.
> I doubt it is bug, maybe I'm doing something wrong that is not
> following the execution flow of transformation chaining !
>
> please advice
>
> import transformation1;
> import transformation2;
>
> modeltype UML uses 'http://www.eclipse.org/uml2/2.1.0/UML';
>
> transformation chainTransformation( inout mainModel : UML, in model1 :
> UML, in model2 : UML)
> access transformation transformation1
> access transformation transformation2;
>
> main() {
>
> new transformation1(mainModel, model1).transform();
>
> -- do something .....
>
> new transformation2(mainModel , model2).transform(); // the
> passed mainModel here should be the updated one from
> transformation1.... but in the execution it passes the original loaded
> one !!
> }
>
>
>
>
>
>
> // In-Place transformation
> transformation transformation1(inout mainModel : UML, in model1 : UML);
>
>
>
> the result of transformation1 modified the passed inout model. Now
> chainTransformation will call transformation2 and pass the resulted
> inout model from transformation1
>
>
>
> // updatedModel here is the result of transformation1
> transformation transformation2( inout updatedModel : UML, in model2 :
> UML);
>
>
|
|
|
Re: Transformations chaining for inout model [message #1257296 is a reply to message #1250878] |
Wed, 26 February 2014 09:05 |
Sergey Boyko Messages: 171 Registered: July 2009 |
Senior Member |
|
|
Naif Mokhayesh wrote on Wed, 19 February 2014 12:41
Im using latest version of qvto 3.4.0M5 (2014/01/29)
I doubt it is bug, maybe I'm doing something wrong that is not following the execution flow of transformation chaining ! correct me please if I'm wrong
Hi Naif,
I've checked that transformation parameters are correctly updated inside and transferred between transformations chaining. There must be something wrong in the logic which is used to update 'mainModel' parameter inside transformation1().
Scripts I used:
import NewTransformation1;
import NewTransformation2;
modeltype UML uses 'http://www.eclipse.org/uml2/2.1.0/UML';
transformation NewTransformation( inout mainModel : UML, in model1 : UML, in model2 : UML)
access transformation NewTransformation1
access transformation NewTransformation2;
main() {
new NewTransformation1(mainModel, model1).transform();
new NewTransformation2(mainModel , model2).transform();
}
modeltype UML uses 'http://www.eclipse.org/uml2/2.1.0/UML';
transformation NewTransformation1(inout mainModel : UML, in model1 : UML);
main() {
object Class@mainModel {name := "foo"};
}
modeltype UML uses 'http://www.eclipse.org/uml2/2.1.0/UML';
transformation NewTransformation2(inout mainModel : UML, in model1 : UML);
main() {
var c = mainModel.objects()[Class]->any(name = "foo");
assert fatal (c <> null);
}
Regards,
Sergey.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03752 seconds