Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Doubt about EGL in ANT
Doubt about EGL in ANT [message #588077] Thu, 01 April 2010 21:04 Go to next message
paolatco  is currently offline paolatco Friend
Messages: 10
Registered: March 2010
Junior Member
Hi!

I get a doubt about egl ant. I did this:
File: launch.xml

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

<target name="main">
<epsilon.emf.register file="../metamodels/MM.ecore"/>
<epsilon.loadModel name="test" type="EMF">
<parameter name="modelFile" file="../models/test.model"/>
<parameter name="metamodelUri" value="/metamodel/MM.ecore"/>
<parameter name="isMetamodelFileBased" value="false"/>
<parameter name="readOnLoad" value="false"/>
<parameter name="storeOnDisposal" value="false"/>
</epsilon.loadModel>

<epsilon.egl src="MM2txt.egl">
<model ref="test"/>
</epsilon.egl>
</target>

</project>


And executes successfully but no generates the files. I get:
File: MM2txt.egl

[% -- Generate Entities
TemplateFactory.setOutputRoot('out'); -- outputDir
var template : Template;
for(entity in DataModel.allInstances()){
template := TemplateFactory.load('other.egl');
template.populate('entity',entity);
--template.process();
template.generate(entity+'.txt');

}
%]


File: other.egl

Hello World! File: [%=entity%]


Am i missing somethig?

Thanks.
Re: Doubt about EGL in ANT [message #588087 is a reply to message #588077] Thu, 01 April 2010 22:00 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

As readonload is set to false, the contents of your model file are not
read, and thus, DataModel.allInstances() returns an empty collection, so
the body of the for loop is never executed. To fix this please set the
value of readonload to true.

Cheers,
Dimitris

paolatco <paolatco@gmail.com> wrote:
> Hi!
>
> I get a doubt about egl ant. I did this:
> File: launch.xml
>
> <?xml version="1.0"?>
> <project default="main">
>
> <target name="main">
> <epsilon.emf.register file="../metamodels/MM.ecore"/>
> <epsilon.loadModel name="test" type="EMF">
> <parameter name="modelFile" file="../models/test.model"/>
> <parameter name="metamodelUri" value="/metamodel/MM.ecore"/>
> <parameter name="isMetamodelFileBased" value="false"/> <parameter
> name="readOnLoad" value="false"/>
> <parameter name="storeOnDisposal" value="false"/>
> </epsilon.loadModel>
>
> <epsilon.egl src="MM2txt.egl">
> <model ref="test"/>
> </epsilon.egl>
> </target>
>
> </project>
>
>
> And executes successfully but no generates the files. I get:
> File: MM2txt.egl
>
> [% -- Generate Entities
> TemplateFactory.setOutputRoot('out'); -- outputDir
> var template : Template;
> for(entity in DataModel.allInstances()){
> template := TemplateFactory.load('other.egl');
> template.populate('entity',entity);
> --template.process();
> template.generate(entity+'.txt');
>
> }
> %]
>
>
> File: other.egl
>
> Hello World! File: [%=entity%]
>
>
> Am i missing somethig?
>
> Thanks.
>
Re: Doubt about EGL in ANT [message #588094 is a reply to message #588087] Thu, 01 April 2010 22:21 Go to previous messageGo to next message
paolatco  is currently offline paolatco Friend
Messages: 10
Registered: March 2010
Junior Member
Yes, that was the problem... :blush:
:d Thanks!
Re: Doubt about EGL in ANT [message #588099 is a reply to message #588094] Thu, 01 April 2010 23:04 Go to previous messageGo to next message
paolatco  is currently offline paolatco Friend
Messages: 10
Registered: March 2010
Junior Member
Hi again.
I get a problem with EGL.
When i call package.name.replace('.','_') it replace the whole string with the new character :? ...
But if for instance i write package.name.replace('T','_') it works fine.

Dot character get to be treated different?
Re: Doubt about EGL in ANT [message #588128 is a reply to message #588099] Fri, 02 April 2010 05:13 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

The first argument of replace is a regular expression and in reg exps .
means any character. Please use \\. instead of .

Cheers,
Dimitris

paolatco <paolatco@gmail.com> wrote:
> Hi again.
> I get a problem with EGL.
> When i call package.name.replace('.','_') it replace the whole string
> with the new character :? ...
> But if for instance i write package.name.replace('T','_') it works
> fine.
>
> Dot character get to be treated different?
>
>
Previous Topic:Doubt about EGL in ANT
Next Topic:ETL question
Goto Forum:
  


Current Time: Fri Apr 19 03:33:44 GMT 2024

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

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

Back to the top