Wednesday, September 29, 2010

BPEL Fault Generation - adapter framework

Recently we had to dig into how BPEL was generating Runtime or Binding Fault. E.g. we were calling BRM adaper and based on BRM logs we could see, it was returning and error code. On BPEL console, we saw that error code was prefixed with BRM-. We had no idea what part was doing this conversion and that brought us to the point to analyze BPEL and Adapter code to figure out how it works with EIS system and how EIS fault gets converted to BPEL fault. It should be generic across all the adapter, as BPEL PM would be just calling the adapter and getting generic exception.

It was quite obvious that BRM- would be somewhere in the BRM adapter and that exception would be converted to Fault XML, but we wanted to find exact place where it would happen. Upon analyzing multiple files, we ended up with following findings.

Summary
  • oracle.tip.adapter.brm.BRMInteraction had hard coded BRM- when it was throwing PCResourceException
  • com.collaxa.cube.ws.WSIFInvocationHandler.WSIFInvocationHandler is getting this exception and converting this in to Fault XML message which is seen in the BPELConsole
Details
  • Each adapter entry point would be Interaction, and all adapter will implement that interface
  • com.collaxa.cube.ws.WSIFInvocationHandler.WSIFInvocationHandler.invoke seems to be the master piece which calls all the adapters via WSIF - especially you can see invokeRequestHeaderHandlers and invokeLocalService calls here
  • invokeLocalService converts adapter level exception (PCResourceException) to WSIFException
  • invoke constructs SOAP fault XML message based on WSIFException

No comments: