Skip to main content



      Home
Home » Modeling » Epsilon » ETL file structure
ETL file structure [message #1768906] Mon, 24 July 2017 15:14 Go to next message
Eclipse UserFriend
Hi

I'm working on an application to find patterns in .etl files. Therefore I have to get a kind of AST of the file, or any other means to explore the file in a structural manner. However, I cannot find an easy way to do this.

When reading an .etl file, I use the EtlModule class to represent it internally. But, it seems that there is no way to get an AST out of the EtlModule, or any other representation that would let me explore the structure of the file easily. Do you know how this can be done? I know how to extract the transformation rules etc. out of the EtlModule, but this is as far as I get. I need to be able to explore the structure of the .etl file and its transformations.

Thanks in advance for your reply.

Best regards
Jens
Re: ETL file structure [message #1768988 is a reply to message #1768906] Tue, 25 July 2017 09:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jens,

Starting from a transformation rule you can drill down to its source/target parameters, its body etc. e.g. rule.getBody().getBody().getStatements() will return all the statements of the body of the rule.

Cheers,
Dimitris
Re: ETL file structure [message #1769016 is a reply to message #1768988] Tue, 25 July 2017 12:59 Go to previous messageGo to next message
Eclipse UserFriend
Dimitris

Thanks for your reply. However, since I am interested in the detailed representation of the .etl files, for me I think the solution is to go back to version 1.3 and use the getAst() method. Also, when trying your solution, I could not get held of the final getStatements() method you mention. This method is also not listed in the online API documentation.

Best regards
Jens
Re: ETL file structure [message #1769084 is a reply to message #1769016] Wed, 26 July 2017 07:43 Go to previous message
Eclipse UserFriend
The code below works fine with the latest interim version of Epsilon. In principle you should be able to access all information in an ETL module in this way and should not have to go back to 1.3.

public static void main(String[] args) throws Exception {
  EtlModule module = new EtlModule();
  module.parse("rule A transform b : B to c : C { f1(); f2(); }");
  System.out.println(((StatementBlock) module.getTransformationRules().
    get(0).getBody().getBody()).getStatements().size());
}


Cheers,
Dimitris
Previous Topic:ETL standalone problem
Next Topic:changing the model locally
Goto Forum:
  


Current Time: Wed Jul 23 11:02:25 EDT 2025

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

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

Back to the top