Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » ANT Script for ETL
ANT Script for ETL [message #574560] Mon, 24 August 2009 07:29
Darren  is currently offline Darren
Messages: 40
Registered: September 2009
Member
Hello all,

I've been trying to get this script (script at bottom) to work for a
couple of days and don't seem to be able to spot what is going wrong. The
error message is:

BUILD FAILED
....ant-builds\ETL_DocModel.xml:63: The following error occurred while
executing this line:
....ant-builds\ETL_DocModel.xml:79: Model 'DocumentStructure' not found


ExecTransformation:
[echo] ../etl/DocXML.etl,DocumentModel,DocumentStructure
[epsilon.etl - DocXML.etl] EXCEPTION: Model 'DocumentStructure' not found
[epsilon.etl - DocXML.etl] at
org.eclipse.epsilon.eol.models.ModelGroup.<init>(ModelGroup.java:40)
[epsilon.etl - DocXML.etl] at
org.eclipse.epsilon.eol.models.ModelRepository.getModelByNam e(ModelRepository.java:68)
[epsilon.etl - DocXML.etl] at
org.eclipse.epsilon.workflow.tasks.ExecutableModuleTask.popu lateModelRepository(ExecutableModuleTask.java:177)
[epsilon.etl - DocXML.etl] at
org.eclipse.epsilon.workflow.tasks.ExecutableModuleTask.exec uteImpl(ExecutableModuleTask.java:106)
[epsilon.etl - DocXML.etl] at
org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(Epsil onTask.java:41)
[epsilon.etl - DocXML.etl] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)

<?xml version="1.0"?>
<project>

<!-- Source Details -->
<property name="SourceDataDir" value="../data/DocModel" />
<property name="SourceUri" value="DocumentModel" />
<property name="SourcePrefix" value="DocumentModel" />
<property name="SourceMetaModel"
value="../models/meta-models/xml/DocumentModelSchema.ecore" />
<!-- Define files here as order is important in creating the document
Therefore can not use loop of directory. -->
<filelist id="SourceFiles" dir="${SourceDataDir}"
files=" XMF_Prep_Main_Section_1.XML
XMF_Prep_Main_Section_2.XML
XMF_Prep_Main_Section_3.XML
XMF_Prep_Main_Section_4.XML
XMF_Prep_Appendix_Z.XML"/>

<!-- Target Details -->
<property name="TargetFile" value="../models/pop.model" />
<property name="TargetUri" value="DocumentStructure" />
<property name="TargetPrefix" value="DocumentStructure" />
<property name="TargetMetaModel"
value="../models/meta-models/tdl_v3a.ecore" />

<!-- ETL Details -->
<property name="ETLFile" value="../etl/DocXML.etl" />

<!-- ANT Taskdefs for foreach loop -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

<target name="main">
<!-- Register the meta-models -->
<epsilon.emf.register file="${SourceMetaModel}"/>
<epsilon.emf.register file="${TargetMetaModel}"/>
<!-- Load the target file. Note path to file defined in property
targetFile -->
<epsilon.loadModel name="${TargetPrefix}" type="EMF">
<parameter name="modelFile" file="${TargetFile}"/>
<parameter name="metamodelUri" value="${TargetUri}"/>
<parameter name="readOnLoad" value="true"/>
<parameter name="storeOnDisposal" value="true"/>
</epsilon.loadModel>

<!-- Load each model and execute the transformation -->
<foreach param="SourceFilename" target="ExecTransformation">
<path>
<filelist refid="SourceFiles" />
</path>
</foreach>
</target>

<target name="ExecTransformation">
<epsilon.loadModel name="${SourcePrefix}" type="XML">
<parameter name="modelFile" file="${SourceFilename}"/>
<parameter name="metamodelUri" value="${SourceUri}"/>
<parameter name="readOnLoad" value="true"/>
<parameter name="storeOnDisposal" value="false"/>
</epsilon.loadModel>

<echo>${ETLFile},${SourcePrefix},${TargetPrefix}</echo>
<epsilon.etl src="${ETLFile}">
<model ref="${SourcePrefix}"/>
<model ref="${TargetPrefix}"/>
</epsilon.etl>
</target>
</project>

Thanks for any help,

Darren
Previous Topic:[EuGENia | EGL][newbie] Standalone applications
Next Topic:Operation of includes() operation
Goto Forum:
  


Current Time: Thu Jul 31 05:35:01 EDT 2014

Powered by FUDForum. Page generated in 0.10759 seconds