ODI – getSession("SESS_PARAMS" )

Published on March 17, 2010

Get our e-books Discover the Oracle Data Integrator 11g Repository Data Model and Oracle Data Integrator Snippets and Recipes
In response to my article on the ODI variable debug procedure Craig Stewart has pointed out an undocumented parameter of the getSession method that does the same with one big limitation.
The parameter SESS_PARAMS will print out any variables that have been passed into a scenario generated from a package. Unfortunately this is the limitation of this method. Variables that you dynamically assign inside the package will not print out to the Operator. The reason for this is the inner workings of the ODI multi-pass parser. Basically, ODI prints out the parsed command text of your procedure, interface etc. to the Operator before it assigns a value to a variable. As a result this value only becomes available at execution time and we need to force a printout by raising an execption.
Anyway, let’s try out Craig’s suggestion. I will adapt the debug procedure from the previous article and include the following command:
Next we generate a scenario from this package and encapsulate this inside a parent package and pass in a value for the v_raise variable
Let’s verify that the value was printed out in the Operator Module.
This is very neat and works because we pass the value into our child scenario and as a result the value of the variable is already available before ODI writes out to the Operator module.
Thanks to Craig for sharing this information with us.
In order to master scripting in ODI I recommend the following books.
Java BeanShell
Scripting in Java: Languages, Frameworks, and Patterns
The Definitive Guide to Jython: Python for the Java Platform.
Jython Essentials (O’Reilly Scripting)