Class | Description |
---|---|
Driver |
Driver for JEXL.
|
JexlConnection |
Scriptella connection adapter for JEXL.
|
JexlContextMap |
Mutable
JexlContext implementation for
integration into Scriptella execution environment. |
Exception | Description |
---|---|
JexlProviderException |
Thrown to indicate a problem with JEXL script.
|
The driver uses commons-jexl library which is a part of Scriptella Core. JEXL scripts are interpreted at runtime and generally work slower than compiled scripts (e.g. Janino), nevertheless JEXL scripts are easier to write and maintain especially for non-Java developers.
Driver class: | scriptella.driver.jexl.Driver |
Runtime dependencies: | None |
Bind variables from parent elements are accessible as simple variables. Assignment operator
v="value" makes variable v
available for nested ETL elements.
Implicit variable query
is available in <query> elements. This variable
should be used to produce a result set:
<query>
i=0; while(i lt 10) {
i=i+1;
query.next(); // Causes child script to be executed
}
<script>......</script>
</query>
See ParametersCallbackMap class Javadoc for more details.
Note: It is important to call query.next() so that the row produced by set(...) methods is created and
inner elements are executed.
<connection id="jexl" driver="jexl"/>
<connection id="out" driver="oracle" url="jdbc:oracle:thin:@localhost:1521:DB"/>
<query connection-id="jexl">
i=0;while (i lt 10) {
i=i+1;
login='login'+i;
query.next();
}
<script connection-id="out">
INSERT INTO Table(ID, Login) VALUES (?i, ?login);
</script>
</query>
The query executes a child script 10 times. As the result of execution 10 records
are inserted in a database table.Copyright © Copyright 2006-2019 The Scriptella Project Team.