Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Call ETL rule from EOL module(Call ETL rule from EOL module)
Call ETL rule from EOL module [message #1750412] Tue, 20 December 2016 20:23 Go to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 145
Registered: October 2014
Senior Member
Hi,
Is it possible to call specific etl rule from EOL code.Can i use the transformation file that has the rules as input in the EOL launch file and then query (.etl) file and call any rule or execute specific rule by its name .

Is there any way to call rule from EOL??


Thanks,
Taghreed
Re: Call ETL rule from EOL module [message #1750507 is a reply to message #1750412] Wed, 21 December 2016 19:49 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1487
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

This is not supported out of the box I'm afraid. However, you can always implement a Java tool [1] that makes use of the ETL API to achieve this. If your tool implements the ITool interface (see linked article) it will also be passed a copy of the execution context (so that you can get hold of loaded models etc).

Cheers,
Dimitris

[1] https://eclipse.org/epsilon/doc/articles/call-java-from-epsilon/
Re: Call ETL rule from EOL module [message #1750577 is a reply to message #1750507] Thu, 22 December 2016 22:33 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 145
Registered: October 2014
Senior Member
Hi Dimitris,
First I need to know how can i query ETL file by EOL
Can i use the methods that are available here in EOL file to query etl rules :
http://download.eclipse.org/epsilon/javadoc/org/eclipse/epsilon/etl/trace/TransformationList.html

Did you mean for query ETL rules also i need to implement Java tool??
and if i implement Java tool ,can i identify which rule that i need to execute??

Thanks,
Taghreed
Re: Call ETL rule from EOL module [message #1750610 is a reply to message #1750577] Fri, 23 December 2016 09:38 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1487
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

In your Java tool (which implements the ITool interface) you need to make use of ETL's API to create and parse and EtlModule (see [1] for an example). Once you have your EtlModule you can do something like the following (I haven't tried to run this code):

EtlModule module = ...
module.setContext(getContext());
for (TransformationRule tr : module.getTransformationRules()) {
	if (tr.getName().equals("my-rule")) {
		Collection targetElements = 
			tr.execute(sourceElement, new ArrayList(), getContext());
	}
}


Does this help?

Cheers,
Dimitris

[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/examples/org.eclipse.epsilon.examples.standalone
Re: Call ETL rule from EOL module [message #1750649 is a reply to message #1750610] Fri, 23 December 2016 19:47 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 145
Registered: October 2014
Senior Member
Hi Dimitris,
Thanks for your help I am still trying to figure out how to implement the tool.
I have successful working etl transformation from UML to layered queuing network(LQN) .I made some changes to the source model (UML) and I used EMFcompare to generate the differences between source model(UML) and the changed source model ,I have also trace file that was generated automatically from the transformation. By using EOL i can query the differences file to identify which element has been changed and from trace file I can aslo query and identify which rule that transferred the changed element .Once I became able to identify the rules for the changed elements then I can execute only that rules and avoid reruning the whole transformation .I know that ETL doesn't support incremental transformation but I am thinking to use EOL and then invoke Java tool to query and execute specific rule for the changed element.
I don't know if I can use flock?? since I have two different metamodels ?.I didn't change the metamodels I changed only the source and I want to propagate the changes to the target.
Sorry for the long message ,I want to give you a general idea about my problem and I do really appreciate if you have any suggestions.

Thanks,
Taghreed

[Updated on: Fri, 23 December 2016 19:51]

Report message to a moderator

Re: Call ETL rule from EOL module [message #1750654 is a reply to message #1750649] Fri, 23 December 2016 21:46 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1487
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

Flock would probably not be a good choice for this use-case as it mainly targets migration transformations when metamodels evolve. I would strongly recommend using one of the languages suggested in [1] if you need to implement an incremental transformation.

Cheers,
Dimitris

[1] https://www.eclipse.org/forums/index.php/t/1083088/
Re: Call ETL rule from EOL module [message #1752448 is a reply to message #1750610] Mon, 23 January 2017 21:20 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 145
Registered: October 2014
Senior Member
Hi Dimitris,
I am trying to understand the org.eclipse.epsilon.examples.standalone example.
I am so confused because it has different classes. I suppose that i need to follow the same logic of EolEmfToolStandaloneExample class to be able to execute or query (.etl) file .Is that correct??

Can you please tell me which dependencies i need to use I think its
org.eclipse.epsilon.etl.dt; ?????

For the extensions i think i need to use "org.eclipse.epsilon.common.dt.tool">
as in the tutorial ????

To create and parse and EtlModule ,do i need to parse the existing etl file (the one i have already)??
I don't understand how can i do that??

I am really sorry .I might be asking silly questions but i am still a beginner .

Thanks,
Taghreed.
Re: Call ETL rule from EOL module [message #1752472 is a reply to message #1752448] Tue, 24 January 2017 08:25 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1487
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

> I suppose that i need to follow the same logic of EolEmfToolStandaloneExample class to be able to execute or query (.etl) file .Is that correct?

This is correct.

> Can you please tell me which dependencies i need to use I think its org.eclipse.epsilon.etl.dt; ?

You only need EtlModule so org.eclipse.epsilon.etl.engine would suffice.

> To create and parse and EtlModule ,do i need to parse the existing etl file (the one i have already)?

Yes.

> I don't understand how can i do that?

In your tool, you should have code like the following:

EtlModule module = new EtlModule();
module.parse(myEtlFile);
module.getContext().getModelRepository().getModels().addAll(context.getModelRepository().getModels());
module.execute();


Cheers,
Dimitris
Re: Call ETL rule from EOL module [message #1752507 is a reply to message #1752472] Tue, 24 January 2017 14:54 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 145
Registered: October 2014
Senior Member
Thanks very much.

Cheers,
Taghreed.
Re: Call ETL rule from EOL module [message #1752513 is a reply to message #1752507] Tue, 24 January 2017 15:41 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 145
Registered: October 2014
Senior Member
Hi Dmitris,
For the extensions i think i need to use "org.eclipse.epsilon.common.dt.tool">
as in the tutorial ????
Re: Call ETL rule from EOL module [message #1752514 is a reply to message #1752513] Tue, 24 January 2017 15:47 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1487
Registered: July 2009
Location: York, UK
Senior Member

This is correct.

Cheers,
Dimitris
Previous Topic:How to export .model_diagram file into a plug-in ?
Next Topic:Getting all objects with EGL
Goto Forum:
  


Current Time: Thu Nov 23 14:53:56 GMT 2017

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

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