Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-Relations » Pivot to CS for QVTd transformations
Pivot to CS for QVTd transformations [message #1810062] Tue, 30 July 2019 08:08 Go to next message
Aurélien Pepin is currently offline Aurélien PepinFriend
Messages: 1
Registered: July 2019
Junior Member
Hello,

I would like to know if it is possible to save RelationModel and RelationalTransformation objects as a QVT-R file.
Here is what I would like to do:

TopLevelCS root = (TopLevelCS) resource.getContents().get(0);
RelationModel rm = (RelationModel) root.getPivot();

Set<RelationalTransformation> transformations = new HashSet<>();
for (TransformationCS transfCS : root.getOwnedTransformations()) {
    transformations.add((RelationalTransformation) transfCS.getPivot());
}

// Perform some changes inside transformations...
performSomeChanges(rm, transformations);

// What I want to do:
for (RelationalTransformation transformation : transformations) {
    TransformationCS transfCS = transformation.getCS(); // ?
}


By then having the concrete syntax of the transformations, I think we can easily reconstruct a QVT-R file. I saw that there is a Pivot2CS class but I'm not sure it applies to the QTVd elements.

Thanks in advance
Aurélien
Re: Pivot to CS for QVTd transformations [message #1810505 is a reply to message #1810062] Mon, 12 August 2019 20:09 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I added support two years ago for *.qvtras to *.qvtr serialization to help in debugging the ATL2QVTr transformation.

See /org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrSerializeTests.java for programmatic examples.

Interactively you should just be able to open a *.qvtras file with the QVTr editor and save as *.qvtr. If that fails cut and paste the conent to an empty *.qvtr file.

(You should not be using the CS. Use the AS that is vaguely as specified by OMG plus some bug fixes. The CS is proprietary and subject to change without notice. If you really want to use the CS you will have to dig into the two AS2CS, CS2Text serialization stages.)

Regards

Ed Willink
Previous Topic:Problem with Setting a Property with cardinality 1..*
Next Topic:Running QVTr transformations
Goto Forum:
  


Current Time: Thu Mar 28 20:29:51 GMT 2024

Powered by FUDForum. Page generated in 0.05536 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top