Blog

OpenTool in ODI using Java

Hi Guys !!! 🙂
Today I am going to write something interesting for ODI Lovers. Whenever you are creating a package you can see a lot of OdiTools like OdiSendMail, OdiFileDelete, OdiSqlUnload etc. You may not know this but good thing is that you can develop your own tool by adding a desired image/icon with few lines of codes. But the only thing that might worry you is that you should have sound knowledge on java to create couple of class files and wrap it into a Jar. Best option would be to develop it in eclipse which will automatically generate the class file and finally you can export it as a Jar file. If you are not familiar with Java and Eclipse IDE try writing couple of small programs and create Jar out of it.

/**
* Name of the provider of this Open Tool.
* @return A string containing ‘My Company, Inc.’
*/
public String getProvider()
{
return “Bhabaniranjan.com”;
}

/**
* Returns an array containing the parameters of this Open Tool.
* @return An array of two ISnpsOpenToolParameter objects.
*/
public OpenToolParameter[] getParameters()
{
return mParameters;
}
}

You just need to insert your customized java codes inside the function body. you create a jar file based on your class files and put it in odi client directory as well as driver directory. Then start odistudio.

Go to ODI menu and click on add/remove odiopentools..Click on the binocular button to open your class files under the package. Select the class file and click ok. Now click on the plus symbol to add the opentool. You can see the screenshot here.
Once the opentool is added you can see this in the oditool box of package as given below.
Just provide the values in the options and execute it. Very simple, powerful and of-course a great feature provided by ODI. Keep visiting for more tips and tricks and feel free to ask in case you got some questions.

About the author

Bhabani(http://dwteam.in) - Currently Bhabani is working as Sr Development Engineer at Harman International. He has good expertise on Oracle, Oracle Data Integrator, Pervasive Data Integrator, MSBI, Talend and Java. He is also contributing in ODI-OTN forum for last 5 years. He is from India. If you want to reach him then please visit contact us page.
If you have any doubts or concerns on the above article, please put your question here. Dw Team will try to respond it as soon as possible. Also dont forget to provide your comments / suggestions / feedback for further improvement. Thanks for your time.

14 comments

Just one word ‘WOW’. I know basics of java and I was searching for such codes where I can create my own opentool in odi. Thanks for the post and i will definitely try this one and if i face any problem i will disturb you again Bhabani. 🙂

hi bro..
h ru
well im facing one problem in odi..one of my procedure is failing everyday..in that procedure have some java code and i don’t have any idea about the java code..
can u tell me why its failing?
where should run this java code at outside of my odi.
thanks

Are you using any custom jar files or extra jar files for your cutsom java codes? If it is then put them in the local lib directory and restart agent,odi studio. Now you are good to go. Also let me know what java code you are using with the error message, so that i can better track the issue.
Thanks

Hru,hope u feeling good,
I have doubt, which is in geocode procedure. If I run the geocode in production it’s failing and giving this error:
org.apache.bsf.BSFException: exception from Jython:
Traceback (most recent call last):
File “”, line 577, in
TypeError: ReportError() takes exactly 3 arguments (2 given)
And same code if I run development it’s giving this error:
org.apache.bsf.BSFException: exception from Jython:
Traceback (most recent call last):
File “”, line 82, in
IOError: (13, ‘EACCES’, ‘c:/bulkfiles/GEOCODES-2013-08-28_03-31-44’)
Development and production code is same but why these errors are different. Not able to understand. Please try to advise me a solution.

Now I’m getting a problem.
ODI-1228: Task Copy of NOLDriver (Integration) fails on the target MICROSOFT_SQL_SERVER connection USEREDWProd.
Caused By: com.microsoft.sqlserver.jdbc.SQLServerException: The multi-part identifier “NDR.QUOTE_#” could not be bound.
what is this multi part identifer ,why im getting this,what should i do for resoulation
Any idea…

Hi I have made a open tool on same lines. the code is working perfectly in studio. I have made a j2ee agent and am trying to call the scenario using the agent can u please let me know the procedure to do it.

I am able to deploy the agent and call the scenario where I have used by the ODI built in components but am facing problems where I am using my custom open tool. can u please let me know where should I place my jars for the j2ee agent?

/**
* Description of the Open Tool. This description is displayed when adding
* the Open Tool.
*
* @Returns A string containing the description.
*/
public String getDescription() {
return “This ODI Open Tool is used to sending log count of DJ.”;
}

Hi Guys,
I created one java jar file. this file is placed in odi server as well as local. after that i executed in odi through procedure technology (Jython) its working in local only(means local agent), but not working in server(ODIAgent)(job is success) but i did not get any output values. job is success i am getting the output as file.can you please guide me what is the issues.

Disclosure

The views expressed on this blog are those of the author and do not necessarily reflect the views of Oracle. All content and s/w code on this site are offered without any warranty, or promise of operational quality or functionality.