Wednesday, May 11, 2011

Java Callout with Collection in OSB


Java callout in OSB normally works well with primitives , however at times you may need to call java callout for custom objects/collections.
The guide says "You can also use Java callouts to create Java objects to store in the pipeline and to pass Java objects as parameters to other Java callouts. "

What does that mean: To pass a Collection to a java callout , call another java callout that returns the collection and pass this to the main java callout. Like :

- I have list of Strings
- And the java method1 takes ArrayList as input

What i did :
1. Created another java callout for method2 to convert strings to Arraylist
2. passed this Arraylist to method1

This approach looks tedious but strangely thats the way out .

Happy coding !!

1 comment:

  1. Hi, do you have sample code for the above example. Please share me if you have..nagarur.nitk@gmail.com

    ReplyDelete