Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » QVTO helper fails
icon9.gif  QVTO helper fails [message #504189] Thu, 17 December 2009 15:55 Go to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
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] Fri, 18 December 2009 04:49 Go to previous message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
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: Fri, 18 December 2009 04:50]

Report message to a moderator

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


Current Time: Wed Oct 09 01:06:25 GMT 2024

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

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

Back to the top