rss
SOATUBE
Oracle
Custom Search SOABYTE here

Monday, November 8, 2010

Rejection Handlers

This feature lets you configure your BPEL process to process the correct records of a file and write only the rejected records to an archive directory by setting the rejectedMessageHandlersparameter in the bpel.xml file. Correct. However, the "Rejection handlers" come in four different flavors.
(Note:all the following bpel.xml properties must be defined asActivation Agent properties, for example
<BPELSuitcase>

  <BPELProcess src="ErrorTest.bpel"  id="ErrorTest">

    <activationAgents>

       <activationAgentclassName="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent"

                        partnerLink="inboundPL">

         <property name="rejectedMessageHandlers">

           file://C:/orabpel/samples/test/errorTest/rejectedMessages

         </property>
so they only apply to Inbound (WSDL) operations (~ BPEL Receive).

File system based Rejection Handler

<property name="rejectedMessageHandlers">

 file://<directory-path>

</property>
for example
<property name="rejectedMessageHandlers">

 file://C:/orabpel/domains/default/rejectedMessages

</property>
This rejection handler is straight forward - bad messages are written to the configured directory - using the file name pattern
INVALID_MSG_ + <process-name> + <operation-name> + <current-time>

RAW Oracle Advanced Queue based Rejection Handler

<property name="rejectedMessageHandlers">

 queue://jdbc:oracle:thin:@<db-host>:<tns-port>:<sid>|<user>/<password>|<queue-name>

</property>
(<password> can be encrypted) for example
<property name="rejectedMessageHandlers">

 queue://jdbc:oracle:thin:@acme-sun:1521:ORCL|scott/tiger|JCA_BAD_MESSAGES

</property>
This rejection handler allows the user to designate a Oracle Rdbms RAW AQ queue as the rejection storage. Note that the ":" and "|" must appear in the places shown. Also note that the password can be encrypted using theencrypt.batutility inorabpel/bin.

BPEL Process Rejection Handler

<property name="rejectedMessageHandlers">

  bpel://<bpel-domain:<password>>|<process-name>|<operation-name>|<input-message-part-name>

</property>
(<password> for domain if not "bpel" - can be encrypted - "[]" means optional)
for example
<property name="rejectedMessageHandlers">

  bpel://default|JCA-RejectionHandler|handleRejection|message

</property>
This rejection handler will send the bad message to another (designated error handling) BPEL process. The user can thus define a process with a Receive operation of his own choosing (WSDL and BPEL src) - the only constraint is on theMessage Typeof the message that will be sent to this rejection handler.
It must be declared to have the type "RejectedMessage". This can conveniently be achieved by importing the "xmllib" resident WSDL "RejectionMessage.wsdl" which defines such a message:
<message name="RejectionMessage">

  <part name="message" element="err:RejectedMessage"/>

</message>
An xmllib WSDL import (from another WSDL) is achieved using the "well-known" URL
<import namespace="http://xmlns.oracle.com/pcbpel/rejectionHandler"
      location="http://localhost:9700/orabpel/xmllib/jca/RejectionMessage.wsdl"/>
i.e. the Receive operation WSDL which the user defines for his Rejection Handler BPEL Process would simply contain this import and then the port type would reference this:
<definitions ...

     xmlns:rej="http://xmlns.oracle.com/pcbpel/rejectionHandler"

  <portType name="MyRejectionHandlerPortType">
    <operation name="myHandleRejectionOperation">
      <input message="rej:RejectionMessage"/>
    </operation>
  </portType>

WSIF Based Rejection Handler

<property name="rejectedMessageHandlers">
 wsif://<wsif-wsdl-location>\|<operation-name>\|<input-message-part-name>
</property>
for example
<property name="rejectedMessageHandlers">

  wsif://file:/C:/orabpel/samples/test/ErrorTest/FileAdapterWrite.wsdl|write|message

</property>
This last rejection handler lets the user configure any type ofWSIF WSDL(JCA, EJB, JMS, HTTP, Java etc), i.e. any kind of Service which can be reached via WSIF - as the bad message handler. The exact same constraint vis-a-vis theMessage Typeas described above for the BPEL Process Rejection Handler also applies here.

0 comments:

Post a Comment

 
Technology Blogs - Blog Rankings