I am spending a couple of days evaluating Scriptella - to see if it would work better than just writing a Java (or Python - or Groovy) app.
I have been successful with Scriptella scripts to read from one db and just write to another.
What I have not had any luck doing is transforming values from the input query - and then putting them into the output query.
For example here - I really want to see if a value on input is a negative one (-1) and if so set it's value to null ( or maybe the empty string).
I don't know where to put the Jexl expression to do this transformation. I may have a bunch of transformations I want to do on the input values before writing them to the output table.
I don't have much more time to evaluate Scriptella so any help would be appreciated.
For example -- I need to see if 'assigned_to' is -1 if so - set it to null.
<etl>
<description>Scriptella ETL File Template.</description>
<properties>
<include href="etl.properties"/>
</properties>
<!-- Connection declarations -->
<connection id="con1" driver="$driver" url="$url" user="$user" password="$password" classpath="$classpath"/>
<connection id="new" driver="$driver" url="$new_url" user="$new_user" password="$new_password" classpath="$classpath"/>
<connection id="out" driver="csv" url="report.csv" />
<connection id="log" driver="script" url="log.txt"/>
<connection id="jexl" driver="jexl"/>
<!--ETL Queries and Scripts -->
<query connection-id="con1">
select submission_id, applicant_id, assigned_to, umi, approval_date, college, committee_email_address, email_hash, degree_type from vireosubmission
<script connection-id="new">
insert into submission (id, submitter_id, assignee_id, umirelease, committeeapprovaldate, college, committeecontactemail, committeeemailhash, degree) values
(?submission_id, ?applicant_id, ?assigned_to, ?umi, ?approval_date, ?college, ?committee_email_address, ?email_hash, ?degree_type)
</script>
</query>
</etl>