JBoss.orgCommunity Documentation
This section outlines the support provided for the direct integration between RiftSaw and JBossESB.
Bi-directional loose integration is available through the use of web services. For example, an ESB action may invoke a BPEL process running within RiftSaw by invoking the appropriate web service represented by a WSDL interface. Similarly, a BPEL process can invoke an ESB managed service that is capable of presenting itself as a web service.
However this section will describe how integration between RiftSaw and JBossESB actions can be achieved without the use of web services (i.e. WSDL and SOAP).
The BPELInvoke ESB action can be used within a jboss-esb.xml to request an invocation on a BPEL process running inside RiftSaw. The only constraints are that RiftSaw is installed within the same Java VM and that the requested BPEL process must have been deployed to the local RiftSaw engine.
The following example illustrates the BPELInvoke ESB action being used as part of the bpel_helloworld sample.
<action name="action2" class="org.jboss.soa.esb.actions.bpel.BPELInvoke">
<property name="service" value="{http://www.jboss.org/bpel/examples/wsdl}HelloService"/>
<property name="port" value="HelloPort" />
<property name="operation" value="hello" />
<property name="requestPartName" value="TestPart" />
<property name="responsePartName" value="TestPart" />
</action>
The ESB action class is org.jboss.soa.esb.actions.bpel.BPELInvoke.
The properties for this ESB action are:
service
This property is mandatory, and defines the service name registered in the WSDL associated with the deployed BPEL process.
port
This property is optional, and defines the port name registered in the WSDL associated with the deployed BPEL process. This parameter is only required if port specific endpoint configuration information has been registered as part of the BPEL process deployment.
operation
This property is mandatory, and represents the WSDL operation that is being invoked.
requestPartName
This optional property can be used to define the WSDL message part that the inbound ESB message content should be mapped to. This property should be used where the ESB message does not already represent a multi-part message.
responsePartName
This optional property can be used to extract the content of a response multi-part WSDL message, and place this in the ESB message being passed to the next ESB action in the pipeline. If this property is not defined, then the complete multi-part message value will be placed in the ESB message.
abortOnFault
This optional property can be used to indicate whether a fault, generated during the invocation of a BPEL process, should be treated as a message (when the value of this property is 'false'), or as an exception that will abort the ESB service. The default value is 'true', causing the ESB service to abort.
This ESB action supports inbound messages with content defined as either:
DOM
If the message content is a DOM document or element, then this can either be used as the complete multi-part message, or as the content of a message part defined using the requestPartName property.
If the message content is a DOM text node, then this can ONLY be used if a multi-part name has been defined in the requestPartName property.
Java String
If the message content is a string representation of an XML document, then the requestPartName is optional. If not specified, then the document must represent the multipart message.
If the message content is a string that does not represent an XML document, then the requestPartName must be specified.
When the message content represents the complete multipart message, this must be defined as a top level element (whose name is irrelevant) with immediate child elements that represent each of the multiple parts of the message. Each of these elements must then have a single element/node, that represents the value of the named part.
<message>
<TestPart>
Hello World
</TestPart>
</message>
This shows an example of a multipart message structure. The top element (i.e. message) is unimportant. The elements at the next level represent the part names - in this case there is only a single part, with name TestPart. The value of this part is defined as a text node, with value "Hello World". However this could have been an element representing the root node of a more complex XML value.
The following diagram illustrates the inter-relationship of the JBossESB bpel_helloworld quickstart and the RiftSaw BPEL process configuration files.
The normal response from a WSDL operation will be returned from the BPELInvoke ESB action as a normal message and placed on the action pipeline ready for processing by the next ESB action, or alternatively if no further actions have been defined, then returned back to the service client.
Faults, associated with a WSDL operation, are handled slightly differently. Depending on configuration it is possible to receive the fault as an ESB message or for the fault to be treated as an exception which aborts the action pipeline. The configuration property used to determine which behaviour is used is called abortOnFault. The default value for this property is "true". As an example, from the loan fault quickstart sample,
<action name="action2" class="org.jboss.soa.esb.actions.bpel.BPELInvoke">
<property name="service" value="{http://example.com/loan-approval/wsdl/}loanService"/>
<property name="operation" value="request" />
<property name="abortOnFault" value="true" />
</action>
A WSDL fault has two relevant pieces of information, the fault type (or code) and the fault details. These are both returned in specific parts of ESB message's body.
ESB message body part: org.jboss.soa.esb.message.fault.detail.code
This body part identifies the specific WSDL fault returned by the BPEL process, associated with the WSDL operation that was invoked.
ESB message body part: org.jboss.soa.bpel.message.fault.detail.code
This body part will return the textual representation of the QName for the fault code. The textual representation is of the form "{namespace}localpart" and can be converted back into a QName using the javax.xml.namespace.QName.valueOf(String) method.
ESB message body part: org.jboss.soa.esb.message.fault.detail.detail
This body part will contain the textual representation of the message content associated with the fault.