Oracle BPEL - Invoking a BPEL Process Using APIs
Knowing how to invoke a BPEL Process using the APIs is important as in an application there will come a point after gathering all the data you need, you will have to invoke a BPEL Process and pass the data to the process.
The APIs are relatively easy to use but the construction of the payload is the tricky part. As all web services (BPEL Process included) accepts and returns XML data, the Oracle BPEL API provides the com.oracle.bpel.client.NormalizedMessage class to help us do just that.
Nice, that helps a lot. After normalizing the message, we will then add the xml data into the payload and pass it as a invocation parameter.
Easy so far ? Alright, but the question new BPEL developer will ask is, "What is the xml data that we should sent ?" As far as I know if the data is incorrect, you may just get null as your result.
So how do we know what to send ?
If you are a web service expert, this is not much of a problem only tedious. You will know how to construct the message. But here is the tip if you are not.
Here is what you should do.
1. Go to the BPEL Console, click on the Dashboard tab.
2. Click the link of the deployed bpel process (the one you want to invoke)
3. Choose "HTML Form" and enter the value.
4. Click on the "Post XML Message".
5. Once executed, Click on the "Audit Instance".
6. Click on the "View Raw XML" link.
There you can see the details of the XML data used to invoke the process. You can just copy those data and change the input value when you create your own XML data for the payload. It should invoke the BPEL process and pass it the correct XML data.
p.s. Would like give a shout out to Siew Leng (my colleague) for pointing out this issue out and learning it the hard way.

0 Comments:
Post a Comment
<< Home