Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » QVTO helper fails
icon9.gif  QVTO helper fails [message #504189] Thu, 17 December 2009 10:55 Go to next message
Eclipse UserFriend
Hi!

I have the following qvto file:

modeltype genmodel uses "http://www.eclipse.org/emf/2002/GenModel";
modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";

library mutatingUtils;

helper getModelSwitchQualifiedName(gc : genmodel::GenClass) : String {
	return gc.genPackage.basePackage + '.' + gc.genPackage.ecorePackage.name + '.' + gc.genPackage.utilityPackageSuffix + '.' + gc.genPackage.prefix + 'Switch'
}


And I access to this helper in my xpt file like this:

«DEFINE createMutatingSwitch FOR gmfgen::GenDiagram»
static class EReferenceDiagramSwitch {
	public org.eclipse.emf.ecore.EReference doSwitch(org.eclipse.emf.ecore.EObject modelElement) {
		...
		«getModelSwitchQualifiedName(domainDiagramElement)» aSwitch = new «getModelSwitchQualifiedName(domainDiagramElement)»() {
		...
	}
}
«ENDDEFINE»


But when execute the transformation, an error occurs:
Exception (Can't evaluate expression: retured value is OclInvalid:in aspects::xpt::diagram::editpolicies::DiagramItemSemanticEditPolicy, line 85) while generating code
  Can't evaluate expression: retured value is OclInvalid:in aspects::xpt::diagram::editpolicies::DiagramItemSemanticEditPolicy, line 85


Could anybody help me please? I don't know what I'm doing wrong... I'm doing the same like the GMF templates, but I don't know if I must to specify certain plugins or extensions in the plugin dependency list...

Thanks!!
Marc
Re: QVTO helper fails [message #504312 is a reply to message #504189] Thu, 17 December 2009 23:49 Go to previous message
Eclipse UserFriend
Well, I solved it by adding a '.' string before:

modeltype genmodel uses "http://www.eclipse.org/emf/2002/GenModel";
modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";

library mutatingUtils;

helper getModelSwitchQualifiedName(gc : genmodel::GenClass) : String {
	return '.' + gc.genPackage.basePackage + '.' + gc.genPackage.ecorePackage.name + '.' + gc.genPackage.utilityPackageSuffix + '.' + gc.genPackage.prefix + 'Switch'
}



Solved!
Marc

[Updated on: Thu, 17 December 2009 23:50] by Moderator

Previous Topic:[XPAND] perform OAW code without creating physical files
Next Topic:Problems accessing to QVTO operations
Goto Forum:
  


Current Time: Sun Jul 06 07:58:41 EDT 2025

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

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

Back to the top