Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Passing Parameters into ETL from Ant
Passing Parameters into ETL from Ant [message #526545] Mon, 12 April 2010 08:51 Go to next message
Eclipse UserFriend
Originally posted by: c.k.holmes.lboro.ac.uk

Hi,
I can pass model references from Ant into ETL via:
<epsilon.etl src="${EtlFile}">
<model ref="${SourceName}" as="Source"/>
<model ref="${TargetName}" as="Target"/>
</epsilon.etl>

What's the syntax required to allow me to pass in variables (constants
as far as ETL is concerned) from Ant?

e.g. I could enable/disable logging from ETL via a Boolean declared in Ant:

in Ant:
<property name="LoggingEnabled" value="true"/>
<epsilon.etl src="${EtlFile}">
<model ref="${SourceName}" as="Source"/>
<model ref="${TargetName}" as="Target"/>
<!-- pass in property LoggingEnabled -->
</epsilon.etl>


in ETL:
rule Blah
transform sourceThing : Source!Thing
to targetThing : Target!Thing {
if (LoggingEnabled) {
'rule: Blah invoked'.println();
}
}

How do I declare 'LoggingEnabled' in Ant? How do I pass 'LoggingEnabled'
into to ETL? And how do I access 'LoggingEnabled' from within ETL?

Regards
Chris
Re: Passing Parameters into ETL from Ant [message #526640 is a reply to message #526545] Mon, 12 April 2010 13:43 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Chris,

You can use <parameter/> nested elements to pass parameters to Epsilon
programs via ANT tasks (all parameters are strings so you'll have to
transform them to booleans, integers etc. using the respective
asBoolean(), asInteger() methods):

<epsilon.eol>
LoggingEnabled.asBoolean().println();
<parameter name="LoggingEnabled" value="true"/>
</epsilon.eol>

Cheers,
Dimitris

On 12/04/2010 11:51, Chris Holmes wrote:
> Hi,
> I can pass model references from Ant into ETL via:
> <epsilon.etl src="${EtlFile}">
> <model ref="${SourceName}" as="Source"/>
> <model ref="${TargetName}" as="Target"/>
> </epsilon.etl>
>
> What's the syntax required to allow me to pass in variables (constants
> as far as ETL is concerned) from Ant?
>
> e.g. I could enable/disable logging from ETL via a Boolean declared in Ant:
>
> in Ant:
> <property name="LoggingEnabled" value="true"/>
> <epsilon.etl src="${EtlFile}">
> <model ref="${SourceName}" as="Source"/>
> <model ref="${TargetName}" as="Target"/>
> <!-- pass in property LoggingEnabled -->
> </epsilon.etl>
>
>
> in ETL:
> rule Blah
> transform sourceThing : Source!Thing
> to targetThing : Target!Thing {
> if (LoggingEnabled) {
> 'rule: Blah invoked'.println();
> }
> }
>
> How do I declare 'LoggingEnabled' in Ant? How do I pass 'LoggingEnabled'
> into to ETL? And how do I access 'LoggingEnabled' from within ETL?
>
> Regards
> Chris
Re: Passing Parameters into ETL from Ant [message #527190 is a reply to message #526640] Wed, 14 April 2010 12:03 Go to previous message
Eclipse UserFriend
Originally posted by: c.k.holmes.lboro.ac.uk

Hi Dimitris,
Many thanks, I implemented it like this:
<epsilon.ecl src="${EclFile}" exportmatchtrace="matchTrace">
<!--
Enable or disable transformation logging messages
-->
<parameter name="LoggingEnabled" value="true"/>
<!--
Provide referenced model components to ECL transformation
-->
<model ref="${LeftModel}" as="Left"/>
<model ref="${RightModel}" as="Right"/>
</epsilon.ecl>

Thanks for your help.

Best Wishes
Chris

Dimitris Kolovos wrote:
> Hi Chris,
>
> You can use <parameter/> nested elements to pass parameters to Epsilon
> programs via ANT tasks (all parameters are strings so you'll have to
> transform them to booleans, integers etc. using the respective
> asBoolean(), asInteger() methods):
>
> <epsilon.eol>
> LoggingEnabled.asBoolean().println();
> <parameter name="LoggingEnabled" value="true"/>
> </epsilon.eol>
>
> Cheers,
> Dimitris
>
> On 12/04/2010 11:51, Chris Holmes wrote:
>> Hi,
>> I can pass model references from Ant into ETL via:
>> <epsilon.etl src="${EtlFile}">
>> <model ref="${SourceName}" as="Source"/>
>> <model ref="${TargetName}" as="Target"/>
>> </epsilon.etl>
>>
>> What's the syntax required to allow me to pass in variables (constants
>> as far as ETL is concerned) from Ant?
>>
>> e.g. I could enable/disable logging from ETL via a Boolean declared in
>> Ant:
>>
>> in Ant:
>> <property name="LoggingEnabled" value="true"/>
>> <epsilon.etl src="${EtlFile}">
>> <model ref="${SourceName}" as="Source"/>
>> <model ref="${TargetName}" as="Target"/>
>> <!-- pass in property LoggingEnabled -->
>> </epsilon.etl>
>>
>>
>> in ETL:
>> rule Blah
>> transform sourceThing : Source!Thing
>> to targetThing : Target!Thing {
>> if (LoggingEnabled) {
>> 'rule: Blah invoked'.println();
>> }
>> }
>>
>> How do I declare 'LoggingEnabled' in Ant? How do I pass 'LoggingEnabled'
>> into to ETL? And how do I access 'LoggingEnabled' from within ETL?
>>
>> Regards
>> Chris
>
Re: Passing Parameters into ETL from Ant [message #588255 is a reply to message #526545] Mon, 12 April 2010 13:43 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Chris,

You can use <parameter/> nested elements to pass parameters to Epsilon
programs via ANT tasks (all parameters are strings so you'll have to
transform them to booleans, integers etc. using the respective
asBoolean(), asInteger() methods):

<epsilon.eol>
LoggingEnabled.asBoolean().println();
<parameter name="LoggingEnabled" value="true"/>
</epsilon.eol>

Cheers,
Dimitris

On 12/04/2010 11:51, Chris Holmes wrote:
> Hi,
> I can pass model references from Ant into ETL via:
> <epsilon.etl src="${EtlFile}">
> <model ref="${SourceName}" as="Source"/>
> <model ref="${TargetName}" as="Target"/>
> </epsilon.etl>
>
> What's the syntax required to allow me to pass in variables (constants
> as far as ETL is concerned) from Ant?
>
> e.g. I could enable/disable logging from ETL via a Boolean declared in Ant:
>
> in Ant:
> <property name="LoggingEnabled" value="true"/>
> <epsilon.etl src="${EtlFile}">
> <model ref="${SourceName}" as="Source"/>
> <model ref="${TargetName}" as="Target"/>
> <!-- pass in property LoggingEnabled -->
> </epsilon.etl>
>
>
> in ETL:
> rule Blah
> transform sourceThing : Source!Thing
> to targetThing : Target!Thing {
> if (LoggingEnabled) {
> 'rule: Blah invoked'.println();
> }
> }
>
> How do I declare 'LoggingEnabled' in Ant? How do I pass 'LoggingEnabled'
> into to ETL? And how do I access 'LoggingEnabled' from within ETL?
>
> Regards
> Chris
Re: Passing Parameters into ETL from Ant [message #588305 is a reply to message #526640] Wed, 14 April 2010 12:03 Go to previous message
Eclipse UserFriend
Originally posted by: c.k.holmes.lboro.ac.uk

Hi Dimitris,
Many thanks, I implemented it like this:
<epsilon.ecl src="${EclFile}" exportmatchtrace="matchTrace">
<!--
Enable or disable transformation logging messages
-->
<parameter name="LoggingEnabled" value="true"/>
<!--
Provide referenced model components to ECL transformation
-->
<model ref="${LeftModel}" as="Left"/>
<model ref="${RightModel}" as="Right"/>
</epsilon.ecl>

Thanks for your help.

Best Wishes
Chris

Dimitris Kolovos wrote:
> Hi Chris,
>
> You can use <parameter/> nested elements to pass parameters to Epsilon
> programs via ANT tasks (all parameters are strings so you'll have to
> transform them to booleans, integers etc. using the respective
> asBoolean(), asInteger() methods):
>
> <epsilon.eol>
> LoggingEnabled.asBoolean().println();
> <parameter name="LoggingEnabled" value="true"/>
> </epsilon.eol>
>
> Cheers,
> Dimitris
>
> On 12/04/2010 11:51, Chris Holmes wrote:
>> Hi,
>> I can pass model references from Ant into ETL via:
>> <epsilon.etl src="${EtlFile}">
>> <model ref="${SourceName}" as="Source"/>
>> <model ref="${TargetName}" as="Target"/>
>> </epsilon.etl>
>>
>> What's the syntax required to allow me to pass in variables (constants
>> as far as ETL is concerned) from Ant?
>>
>> e.g. I could enable/disable logging from ETL via a Boolean declared in
>> Ant:
>>
>> in Ant:
>> <property name="LoggingEnabled" value="true"/>
>> <epsilon.etl src="${EtlFile}">
>> <model ref="${SourceName}" as="Source"/>
>> <model ref="${TargetName}" as="Target"/>
>> <!-- pass in property LoggingEnabled -->
>> </epsilon.etl>
>>
>>
>> in ETL:
>> rule Blah
>> transform sourceThing : Source!Thing
>> to targetThing : Target!Thing {
>> if (LoggingEnabled) {
>> 'rule: Blah invoked'.println();
>> }
>> }
>>
>> How do I declare 'LoggingEnabled' in Ant? How do I pass 'LoggingEnabled'
>> into to ETL? And how do I access 'LoggingEnabled' from within ETL?
>>
>> Regards
>> Chris
>
Previous Topic:Problem resolving object slots from ECL
Next Topic:[eugenia] specifying compartments in an abstract class
Goto Forum:
  


Current Time: Sat Nov 22 05:01:40 GMT 2014

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

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