Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] Extension: class is not responsible for java type
[Xpand] Extension: class is not responsible for java type [message #1404812] Tue, 05 August 2014 23:05 Go to next message
Christoph Winter is currently offline Christoph WinterFriend
Messages: 2
Registered: August 2014
Junior Member
Hey all,

I tried to write some extensions for my code generator. The extensions work so far, however, when writing JAVA-extensions, that operate on Entities of my Ecore-Model, the Workflow interrupts with the error

Workflow interrupted. Reason: pulse::Task is not responsible for java type pulse.Task


It seems that Xpand can not map the Ecore model to the Java classes. Some test-extensions using the java.lang.String work; as soon as I try to write extensions for model-specific entities, the error from above is printed.

import pulse;

String test(Task t): JAVA datamodel.generator.Helper.test(pulse.Task);
String concat(String a, String b): JAVA datamodel.generator.Helper.concat(java.lang.String, java.lang.String);


package datamodel.generator

import pulse.Task;

public class Helper {
  //this works
  public static String concat(String a, String b) {
    return a+b;
  }

  //this will interrupt the workflow
  public static String test(Task t) {
    return "TEST";
  }
}


I have added the Project (PulseTooling) containing the *.ecore, *genmodel and all generated model classes/interfaces as dependency to the PulseTooling.generator project in the MANIFEST. The Build Path of the PulseTooling.generator contains the packages of the PulseTooling/src folder (model classes) and the PulseTooling/model folder (*.ecore etc.)

I guess the error is somewhere within the workflow definition:

<workflow>

<property file="workflow/workflow.properties"/>

<!-- set up EMF for standalone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
	<platformUri value=".."/>
	<registerEcoreFile value="platform:/resource/PulseTooling/model/pulse.ecore" />
<!--
	<registerGeneratedEPackage value="pulse.Application"/>
-->
</bean>

<component class="org.eclipse.emf.mwe.utils.Reader">
	<uri value="platform:/resource/PulseTooling.generator/src/model/example-model.pulse" />
	<modelSlot value="model" />
</component>

<!-- clear output directory -->
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
	<directory value="${srcGenPath}"/>
</component>

<!-- generate code -->
<component class="org.eclipse.xpand2.Generator">
	<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
		<metaModelFile value="platform:/resource/PulseTooling/model/pulse.ecore"/>
	</metaModel>
	<expand value="template::Template::main FOR model" />
	
	<!-- load slot model -->
	<outlet path="${srcGenPath}" >
		<postprocessor class="org.eclipse.xpand.support.cdt.CppBeautifier" configFile="./src/workflow/myCFormatterOptions.xml"/>
	</outlet>
	<resourceManager class="org.eclipse.xtend.expression.ResourceManagerDefaultImpl">
		<fileEncoding value="ISO-8859-1"/>
	</resourceManager>
</component>
</workflow>


Has somebody seen this error before?

Thanks in advance,
Christoph
Re: [Xpand] Extension: class is not responsible for java type [message #1405456 is a reply to message #1404812] Thu, 07 August 2014 11:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14725
Registered: July 2009
Senior Member
Didi you try to usw registerGeneratedepacke in the standalonesetup
instead


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: [Xpand] Extension: class is not responsible for java type [message #1405862 is a reply to message #1405456] Fri, 08 August 2014 10:27 Go to previous message
Christoph Winter is currently offline Christoph WinterFriend
Messages: 2
Registered: August 2014
Junior Member
Thanks Christian,

its working now:

<!-- set up EMF for standalone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
	<platformUri value=".."/>
	<registerGeneratedEPackage value="pulse.pulsePackage"/>
</bean>


, where pulse.pulsePackage is the generated model Java interface located within the source folder of the project where the *.ecore file is stored (here: PulseTooling/src/pulse.pulsePackage)
Previous Topic:Acceleo generate using transformation in workspace
Next Topic:[Acceleo] query problem
Goto Forum:
  


Current Time: Mon Oct 14 22:15:53 GMT 2024

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

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

Back to the top