David Godoy
David Godoy

Reputation: 31

QVT copy operation on models

I need to make changes in an instance of a model (preserving the original) using QVT. I thought in using the copy() operation which is defined in the QVT Documentation (As one of Orerations on models), but I don't understand how to use it, I have tried to execute the next code and look if the Out instance is copied from the In instance, but didn't have any luck:

modeltype MMNotation "strict"
uses 'http://www.eclipse.org/gmf/runtime/1.0.2/notation';

transformation QVTONotationTransformation(in SourceNotation: MMNotation, 
        out TargetNotation: MMNotation);

main() {

    TargetNotation := SourceNotation.copy();

}

Upvotes: 0

Views: 121

Answers (1)

Ed Willink
Ed Willink

Reputation: 1498

Looks like a bug in total model assignment. Please raise a Bugzilla. I think you should have got a warning that you cannot assign to a created model.

Try using deepclone of the root element instead, or assignment of the contents of the copy.

Regards

Ed Willink

Upvotes: 0

Related Questions