Groovy + REST + ODI

Today, I wanted to post a little addendum to our earlier post on Groovy and REST. We’ll take a look at how you can further extend your integration capabilities, by adding ODI to your Groovy > REST calls. You might have noticed Groovy on ODI and wondered how you might use it. To access ODI’s native Groovy scripting console, navigate to Tools > Groovy from the Studio.

25_1_Groovy

Just select “New Script” and the console opens up.

25_2_Script

Now, let’s see how we can run a simple Groovy command. The following command tells us what version of Groovy is available, from ODI.

Just click on the Execute button and you should get the results as seen below.

25_3_Version

Now, let’s see how we can use our HPCM GET call from our last post. Just plop the code from that post into the console and execute it and you should get the right results.

25_4_Results

Bonus

Don’t forget, you can add this code to a procedure, so that you can execute your code snippets from a package. Set Groovy as your target technology.

25_5_Proc

Set the Context and you should be good to go.

25_6_Proc_Results

Save this off and you can use this procedure within your integrations. You can also add all of the usual ODI API references, variables, error checking etc. to enhance your automation needs.

 

Avatar

About Vijay Kurian

Known as the Clem Fandango of EPM consulting, Vijay Kurian has been developing enterprise solutions for companies for the last 12 years (increment years if reading post-2015). Having worked with Essbase, Planning, DRM and other assorted technologies during that time, he’s made the frankly, average decision, to write about them. He is, surprisingly, an Oracle ACE Associate. He hopes to contribute frequently to US Weekly, People and Sensible Chuckle magazines on improving reporting solutions, creating master data management systems and zzz…

Leave a Reply

Your email address will not be published. Required fields are marked *