0

我需要使用 QVT 更改模型实例(保留原始模型)。我想使用 QVT 文档中定义的 copy() 操作(作为模型上的 Orerations 之一),但我不明白如何使用它,我尝试执行下一个代码并查看 Out 实例从 In 实例复制,但没有任何运气:

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();

}
4

1 回答 1

0

看起来像总模型分配中的错误。请提出一个 Bugzilla。我认为您应该收到无法分配给已创建模型的警告。

尝试使用根元素的深度克隆,或分配副本的内容。

问候

埃德·威林克

于 2017-07-25T10:02:02.693 回答