Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to run Extra in-place gmfgen transformation after a reconcile step
How to run Extra in-place gmfgen transformation after a reconcile step [message #647749] Sat, 08 January 2011 14:49 Go to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

I want to add Gen Navigator information to my gmfgen model by using a qvt transformation. As a template I used the transformation from org.eclipse.gmf.test/transforms/PrePostReconcileHook.qvto and changed it to:

modeltype GMFGEN uses gmfgen('http://www.eclipse.org/gmf/2009/GenModel');
	
transformation postRec(inout gmfgenModel : GMFGEN);

property genNavigator : GenNavigator = null;
 
main() {
	this.genNavigator := gmfgenModel.rootObjects()[GenNavigator]->asOrderedSet()->first();
	this.genNavigator.childReferences := OrderedSet{};
	log("GenNavigator", this.genNavigator);	
	--assert fatal (genEditor.navigator <> null);
	--genEditor.navigator := null;
	--assert fatal (genEditor.navigator = null);
}


I added the path to this transformation on the last page of the Create generator model but the transformation shows no effect. I have no output on the console (log statement) and the Gen Navigator.childReferences is not empty too. What am I missing? Is there something special to take care of for getting my transformation to run? The path to the transformation is correct, because I do not get an entry into the error log stating that the transformartion could not be found.

Thanks,

Ralph
Re: How to run Extra in-place gmfgen transformation after a reconcile step [message #647757 is a reply to message #647749] Sat, 08 January 2011 16:20 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

the error is in calling the rootObjects() method change it to:

modeltype GMFGEN uses gmfgen('http://www.eclipse.org/gmf/2009/GenModel');
	
transformation postRec(inout gmfgenModel : GMFGEN);

property genNavigator : GenNavigator = null;
 
main() {
	this.genNavigator := gmfgenModel.objects()[GenNavigator]->asOrderedSet()->first();

	--Clear all child entries
	this.genNavigator.childReferences := OrderedSet{};

	var modelChildReference := new gmfgen::GenNavigatorChildReference();
	modelChildReference.child := gmfgenModel.objects()[GenDiagram]->asOrderedSet()->select(n | n.editPartClassName = "GenDiagramEdiPartName")->first();

	this.genNavigator.childReferences += OrderedSet{modelChildReference};
}
Previous Topic:One mapping element for several meta model elements
Next Topic:Display Diagram Content in form of Tree View
Goto Forum:
  


Current Time: Fri Apr 19 21:07:23 GMT 2024

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

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

Back to the top