Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [Xtend] Couldn't find extension 'transform(null::Specifications)'
[Xtend] Couldn't find extension 'transform(null::Specifications)' [message #546886] Wed, 14 July 2010 13:47 Go to next message
Messages: 17
Registered: June 2010
Junior Member

I'd like to import files in a special XMI Format into an editor generated with GMF. For this, I wrote a new Import Wizard that invokes an xtend transformation in its performFinish() method.

	IFile file = mainPage.createNewFile();
        if (file == null)
            return false;
        final String transformation = "model/ascet2kaom";
        final String fun = "transform";
        URI input = URI.createURI("");
        URI output = URI.createURI("");
        EPackage p1 = ComponentSpecificationPackage.eINSTANCE;
        EPackage p2 = KaomPackage.eINSTANCE;
        try {
        	// get input and output models
	        input = URI.createFileURI(mainPage.editor.getStringValue());
        	output = URI.createURI(file.getFullPath().toString());
            .model2ModelTransform(transformation, fun, input, output, p1, p2);
        } catch (Exception e) {

The XtendTransformationUtil is a class in our project that takes two packages, two files, a file with transformations, and the name of one of the transformations, performs the transformation on the first file and saves the result in the second one. It also registers the two packages in the workflow.

It has been used before and it works. However, when I use it, I get this exception:

org.eclipse.emf.mwe.core.WorkflowInterruptedException: Couldn't find extension 'transform(null::Specifications)'!
	at org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent.invokeInternal(
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(
	at org.eclipse.emf.mwe.core.container.CompositeComponent.internalInvoke(
	at org.eclipse.emf.mwe.core.container.CompositeComponent.invoke(
	at de.cau.cs.kieler.core.model.util.XtendTransformationUtil.model2ModelTransform(
	at de.cau.cs.kieler.core.model.util.XtendTransformationUtil$1.execute(
	at de.cau.cs.kieler.core.ui.util.MonitoredOperation.runOperation(
	at de.cau.cs.kieler.core.ui.util.MonitoredOperation.access$0(
	at de.cau.cs.kieler.core.ui.util.MonitoredOperation$

My transformation looks like this:

import ComponentSpecification;
import kaom;

extension org::eclipse::xtend::util::stdlib::io;
extension org::eclipse::xtend::util::stdlib::crossref;
extension org::eclipse::xtend::util::stdlib::cloning;
extension org::eclipse::xtend::util::stdlib::tracing;
extension org::eclipse::xtend::util::stdlib::issues;

//     @author: schm
//Start Model Transformation here.
create kaom::Entity this transform(ComponentSpecification::DocumentRoot in):
 	this.setName("I'm a specification!")

From the exception I understand that a transformation with a parameter of the type 'null::Specifications' is needed but not found. I wonder why. I generated the model 'ComponentSpecification' (of which an instance serves as the input model) from an XSD. The resulting model contains a class 'DocumentRoot' that contains a reference 'specifications' of the type 'SpecificationsType'. This means there is no class 'Specifications', only a class 'SpecificationsType'. Why does he not ask for that instead? And why is it 'null::Secifications' and not 'ComponentSpecification::Specifications'?

The fact that ComponentSpecification::DocumentRoot can be resolved proves that the ecore model is found. Another question is why the top level component in the model is a 'Specifications' and not a 'DocumentRoot'.

[Updated on: Wed, 14 July 2010 13:47]

Report message to a moderator

Re: [Xtend] Couldn't find extension 'transform(null::Specifications)' [message #547269 is a reply to message #546886] Fri, 16 July 2010 07:39 Go to previous message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
The error message states that it couldn't find a transform extension that takes a null::Specification argument.

Having already had this type of errors, you should look at how you call the transformation, the error is more probably there hidden somewhere (I guess somewhere in XtendTransformationUtil class).

PS : you should rather use the M2T forum for any question pertaining Xtend, even for a M2M transformation, you will get quicker answers, and from people with more skills than I.
Previous Topic:[ATL]Several relations between classes
Next Topic:[ATL] Set a mixed attribute (EFeatureMapEntry)
Goto Forum:

Current Time: Thu Jan 19 11:10:19 GMT 2017

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

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