how to use get, set in janino to manipulate result set ?

379 views
Skip to first unread message

Anji

unread,
Aug 17, 2010, 6:22:51 AM8/17/10
to Scriptella ETL
Hi,

i am a new to scriptella. i am using janino driver to perform some
computations in java. i have an outer ldap query and need to
manipulate the result set (for each row) and insert the modified
result set date into another ldap.

still, after changing the varaible with set, the get() and the ?uid
still referring the same old value ?

please help me if i am doing something wrong.


Ex: code
---------------
<query connection-id="ldap1" >
Select uid from ou=People,o=sct.com,o=cp WHERE objectClass
= 'inetOrgPerson'

<query connection-id="janino">

if(get("uid").equals("")){
set("uid","undefined");
System.out.println(" UID modified"); // this statement
is executing
}

System.out.println("UID: "+ get("uid")); // still
printing the old value - that is empty string

next();

<script connection-id="ldap2">
INSERT INTO uid,ou=People,o=cp (uid)
VALUES (?uid);
</script>

</query>

Fyodor Kupolov

unread,
Aug 17, 2010, 8:10:12 AM8/17/10
to Scriptella ETL
Before posting please use search to find answers on the forum, some of
your problems have already been discussed -
http://groups.google.com/group/scriptella/browse_thread/thread/a75a1f34eede6749/0091ef057dd2d5c3

In Janino, set() nethod makes a value of the variable to be read by
inner elements, that's why you cannot see the change in the current
element.

Fyodor Kupolov

unread,
Aug 17, 2010, 8:25:22 AM8/17/10
to Scriptella ETL
One additional note. Try to use Janino driver only for cases when
there is no alternative solution. In your case embedded JEXL
expressions easily solves the problem without introducing an
additional Janino wrapper element. If you find additional
transformations missing in the list of methods provided by etl.date
etl.text variables. Let me know and I'll add it to 1.1 version, so you
can eliminate the need for an extra query in future.


On Aug 17, 2:10 pm, Fyodor Kupolov <kupo...@gmail.com> wrote:
> Before posting please use search to find answers on the forum, some of
> your problems have already been discussed -http://groups.google.com/group/scriptella/browse_thread/thread/a75a1f...
Reply all
Reply to author
Forward
0 new messages