[Xpand] Extension: class is not responsible for java type [message #1404812] |
Tue, 05 August 2014 23:05 |
Christoph Winter 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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03545 seconds