Invocation from Ant
<taskdef resource="antscriptella.properties" classpath="/path/to/scriptella.jar[;additional_drivers.jar]"/> <etl file="path/to/etl/file/> <!-- Execute ETL file from specified location -->
Command-Line Execution
Just type scriptella to run the file named etl.xml in the current directory. Alternatively you can use Java launcher:
java -jar scriptella.jar [arguments]
Executing ETL Files from Java
It is extremely easy to run Scriptella ETL files from java code. Just make sure scriptella.jar is on classpath and use any of the following methods to execute an ETL file:
EtlExecutor.newExecutor(new File("etl.xml")).execute(); //Execute etl.xml file EtlExecutor.newExecutor(getClass().getResource("etl.xml")).execute(); //Execute etl.xml file loaded from classpath EtlExecutor.newExecutor( servletContext.getResource("/WEB-INF/etl.xml")).execute(); //Execute etl.xml file from web application WEB-INF dir
Integration with Spring Framework
<beans> <!-- Spring beans declarations --> <!-- Spring managed bean which executes etl.xml file --> <bean id="executor" class="scriptella.driver.spring.EtlExecutorBean"> <property name="configLocation" value="etl.xml"/> </bean> </beans>
The usage of executor is straightforward:
EtlExecutor exec = (EtlExecutor) beanFactory.getBean("executor"); exec.execute();
See Spring Driver JavaDoc for additional details.