You have two options, each with its pros and cons:
Option 1. Extract payload from process instance data (i.e. "cube instance")
- Lookup instance handle using conversation Id or instance Id
- Call the com.oracle.bpel.client.IInstanceHandle.getField("bpelVariableName") API to get the payload. If the variable is a message type, the returned object is a Map and you can get the Element via map.get("partName"). If the variable is an element type, the returned object is an Element object.
Caveats:
- If your BPEL process change the value of the input variable, this API It will get the latest value, not the initial one.
- It may not be able to get the variables from the faulted instances. It may only work with successful instances
Option 2. Extract payload from audit trail
- Lookup instance handle using conversation Id or instance ID
- Fetch audit trail from instance handle using IInstanceHandle.getAuditXXX() API
- Use substring functions to extract initiating payload
Caveats:
- You need to do your own parsing of XML in order to extract the initial payload
- If you use auditLevel to dial down the audit trail to a certain degree, or even totally suppress it, you may not be able get the payload from audit trail
Interesting. But there are other ways around as well. For instance directly sql quering the dehydration database. Off course the Audit trail entry is encoded but a simple decoder functionality gives you the entire XML payload for an instance.
ReplyDeleteThank you for the input. Would you mind post your sample code here?
DeleteHi Francis, this is useful bit of tool to have, Arun I am having to rely on the dehydration database queries a lot, however I haven't seen the Actual XML payload so far...
DeleteCan you send me a few of these queries and the decoder link etc ...
Thanks in advance.