Oracle SOA Suite Best Practices

Enabling Oracle Integration B2B and Oracle BPEL Process Manager Interoperability


by Jeffrey Hutchins, E-Commerce Strategist, Oracle SOA Suite Product Management

Published December 2006

Background

Whether extending a business process within your enterprise or into the supply chain, there are two basic items that must be addressed from the business perspective: The data and the process. Each endpoint will have its own representation and business-to-business (B2B) is no exception. In the B2B arena the following general statements can be made:

  • B2B is document centric.
  • At the business level, document are asynchronous.
  • Header information is not in the payload.
  • Ordering is not guaranteed.
  • There are multiple documents standards.
  • When implemented, there are multiple variations in each standard.

Therefore, when the process sends/receives a document to/from a B2B gateway, it must be able to:

  • Identify the document
  • Manage multiple documents
  • Manage document variances
  • Correlate multiple documents
  • Manage error

For this technical note two transaction sets (documents) from the "order-to-cash" process will be used as examples: Purchase Order: outbound and Payment: Inbound

Document Management

How Does the Process Identify the Document?

Documents are exchanged between Integration B2B and BPEL Process Manager using Oracle Advanced Queues (IP_IN_QUEUE and IP_OUT_QUEUE). In Integration B2B these queues are called the Internal Delivery Channel. In the BPEL Process Manager these queues are accessed via a Partnerlink.

Integration B2B Routing Id Each document definition can be assigned a unique routing id that translates to the AQ consumer. The default is B2BUSER
BPEL Process Manager Partnerlink Each partnerlink can be assigned a "Consumer." The process identifies the document to be de-queued by the Consumer.

A process receives a document from the B2B Gateway (Inbound). Set the AQ consumer and the routing_id to 820_PAYMENT. This enables the process to identify the inbound document.

Payment Inbound
Integration B2B: Document Definition
Routing id = 820_PAYMENT
BPEL Process Manager: AQ Adapter
Consumer =

A process sends a document to the B2B Gateway (Outbound). Set the AQ recipient B2BUSER and the routing_id to <blank>. This enables the process to deliver the outbound document.

Purchase Order Outbound
Integration B2B: Document Definition
Routing id = <blank>
BPEL Process Manager: AQ Adapter
Recipient = B2BUSER

More than one process uses a document (Inbound/Outbound). To enable the process to identify the inbound document, set the AQ consumer and the routing_id to 850_PurchaseOrder. To enable the gateway to identify the outbound document, set the AQ recipient to B2BUSER; the routing_id is ignored.

Purchase Order Outbound
Integration B2B: Document Definition
Routing id = 850_PurchaseOrder
BPEL Process Manager: AQ Adapter
Recipient = B2BUSER
Inbound
Integration B2B: Document Definition
Routing id = 850_PurchaseOrder
BPEL Process Manager: AQ Adapter
Consumer = 850_PurchaseOrder

How Does the Process Manage Document Differences?

Even if you use one standard there will always be variations to a document. The implementer may:

  • Adhere to the standard
  • Apply variations within the specification (additional codes, changing mandatory/option fields, changing placement/semantics of the data, etc.)
  • Apply extensions
  • Take the document out of specification—a "one-off"

Addressing variances in the same standard. In an ideal world each participant would adhere to the standard but in practice, variations are the rule and must be accommodated. It is neither scaleable nor reusable to carry these variations throughout the end-to-end integration; therefore, if a superset XML schema can be utilized, this is the best practice. That approach will give you the most flexibility.

Integration B2B
  • Option 1: Retains the original definition with validation enabled
  • Option 2: Utilizes the superset XML Schema with validation disabled
BPEL Process Manager
  • Utilizes the superset XML Schema
  • Validates the XML instance
  • Invokes the appropriate XSLT map using the IP_MESSAGE_TYPE data to identify the trading partner

Using a BPEL Pick Process Activity

When the superset XML Schema cannot represent the variations in the document, or your business requirements dictate that your business process manage multiple standards and/or endpoints, then create multiple partnerslinks and utilize a Pick activity:

  1. Use the On Message activity within the Pick activity to manage each partnerlink interaction.
  2. Set a flag (Boolean variable) enabling the process to identify the appropriate flow.
  3. Invoke the appropriate XSLT Map using information provided by tthe  IP_MESSAGE_TYPE. (Discussed later in Tech Note)

Integration B2B Defines the original document with validation enabled
BPEL Process Manager
  • Defines a separate partnerlink for each document
  • Defines a Pick process activity for each partnerlink (sets flag for process flow and invokes appropriate XSLT map)


The Oracle Application Development Framework (ADF)

The focus of this Tech note is modeling, not coding and the best practice is to model. Note: There is functionality in the adapter framework that can enable the identification of the document, assign an XSD, and initiate a process or process step from a coding perspective. You can find more information on this topic in the Application Development Framework Developers Guide 10g Release (10.1.3.0) (Chapters 1 and 20).

Why Establish a Common Data Model?

To avoid point-to-point mapping that creates an nn-1 scenario, establish a common data model to represent the business object —e.g. a Purchase Orrder and Payment. This best practice requires work up front, but the result is a scalable and flexible solution. The instantiation of a canonical XML Schema based on that model provides a consistent target—in this case, the Purchase Orrder and  Payment documents—to which each endpoint system maps.

Process Management


How Does the Process Correlate Multiple Documents?


As stated previously:
  • B2B is document centric.
  • At the business level, document are asynchronous.
  • Header information is not in the payload.
  • Ordering is not guaranteed.

Therefore, when a process receives a message from a B2B gateway, it must be able correlated the documents by content in the payload.

  • The Oracle AQ consumer identifies the document and the correlation identifies the correct process instance. Example: Correlating the initiating document, Purchase Order  to the responding document, Payment.
  • In BPEL Process Manager a correlation set can be created to accomplish this task. (Note: There must be a unique identifier in the payload to perform the correlation.)
  • There may be multiple correlation sets based on the complexity of the process.

Document Correlation: Steps
  1. Create the Correlation Set.
  2. Create the Property.
  3. Create the Property Alias.

Correlation Set Correlation set name PO_Payment_Cor_Set
Property Variable to hold value PO_Payment_Value
Property Alias

xPath: Extracts PO value /ns2:PurchaseOrder/ns2:PO_Number
xPath: Extracts PO value

/ns4:Payment/ns4:PO_Number

In this example the PO Number is the unique identifier used to correlate the initiating and responding documents.

How Does the Process Obtain Information about the Document?

When extending your business processes beyond your enterprise, the differences between the B2B standards/protocol and those used within the enterprise must be recognized and addresses:


Extending process beyond the Enterprise (B2B)
Extending process within the Enterprise (EAI / A2A)
Security Well defined & certified Options vary
Transports Well defined & certified Options vary
Documents Standards (header & payload) Usually the B2B (payload only)
Partner information Inherent User defined/protocol dependent
Header Information Inherent User defined/protocol dependent

Oracle Integration B2B provides a structure with addition information that bridges some of theses gaps. The IP_MESSAGE_TYPE is a header that enables interoperability across these components.

Outbound

Set in BPEL Process Manager Enables Integration B2B to identify the Agreement
Inbound Set in Integration B2B Provides the BPEL Process additional information

IP_MESSAGE_TYPE (Example)

Field Description
Msg_Id

A unique identification for the document
  • GUID assigned by Trading Partner (inbound documents)
  • GUID assigned by middleware process (outbound document)
Inreplyto_Msg_Id

The MSG_ID received when responding to a previous document. Assigned to Null if the middleware is initiated the document.
Assigned to the MSG_ID when in response to previous document

From_Party The Trading Partner who is sending the document.
To_Party The Trading Partner who is to receive the document
Action_Name The Business Action that defines the document can be null
Doctype_Name The Document Type as defined in Integration B2B ex: “850”
Doctype_Revision The Document Revision as defined in Integration B2B ex: “4010”
Msg_Type Assigned to 1, 2, 3 (Request | Response | Acknowledgement)
Payload Assigned in the process
Attachment Assigned in the process


Error Handling


An error handling process should be created to mitigate errors across all endpoints. The B2B gateway provides a number of sources of error information. With this information, a centralized error process can be created to address business and compliance requirements. The structures are:
  • IP_EXCEPTION: When an error occurs the IP_EXCEPTION data is sent back to the process using consumer B2BERRORUSER.
  • IP_MESSAGE_TYPE: When an error occurs the IP_MESSAGE_TYPE provides basic information.
  • b2b_InstanceMessage: This public view of the runtime repository provides detail information of each transition. The unique key for these structures is b2bMessageId.
With this information the error process can identify exactly what the error was and initiate the appropriate business process.

IP_EXCEPTION (Example)

Field Example
correlationId null
b2bMessageId A9FE198110F30698B9B0000014B6C510
errorCode AIP-50079
errorText Transport error: [IPT_HttpSendConnectionRefused] HTTP connection is refused. Connection refused: connect
errorDescription Transport error: [IPT_HttpSendConnectionRefused] HTTP connection is refused. Connection refused: connect
errorSeverity 2

IP_MESSAGE_TYPE (Example)

Field Example
Msg_Id A9FE198110F30698B9B0000014B6C510
Inreplyto_Msg_Id
From_Party Acme
To_Party GlobalChips
Action_Name Exception
Doctype_Name Exception
Doctype_Revision 1.0
Msg_Type 3
Payload
Attachment

DB View: b2b_InstanceMessage (Structure)

Field Description
id System generated message id
referToId The id of the parent message if any(id of 850, 855 etc)
b2bMessageId ID used in the message when the message is sent or received
receiverId Receiver id type and value. Example: DUNS 987654321
senderId Sender id type and value. Example: DUNS 123456789
senderName Sender name. Example: Acme
receiverName Receiver name. Example: GlobalChips
acknowledgeMode Sync/Async
messageDateTime Timestamp the message was sent / received from the backend system
messageType The message type such as Request/Acknowledgment
state The message state such as Complete/Error
remainingRetry The number of remaining retries.
direction The direction of this message. Example: Inbound/Outbound
timeToAck Time to acknowledge in minutes
errorCode If there was an error processing Example: AIP-11111
errorText If there was an error processing
errorDescription If there was an error processing
protocolMessageId Used to correlate messages based on protocol
documenttype The document type of this message. Example: 850 1.0
b2btimestamp The timestamp the message was sent / received on the wire
conversationId Used to correlate more than 2 messages
protocolworkarea Used as a temporary storage for this message
correlationId Used to correlated 2 messages
transactionControlNumber The transaction control number. Example: 1001
groupControlNumber The group control number. Example: 1001
interchangeControlNumber The interchange control number. Example: 1001
agreement The agreement id of this message
documentProtocol The document protocol of this message. Example: X12 4010
exchangeProtocol The exchange protocol of this message. Example: AS2 1.0
transportProtocol The transport protocol of this message. Example: HTTP 1.1
url The sending transport URL of this message. Example: http://machine:port/b2b
payload The unpackaged payload
wirePayload The packaged payload


Conclusion

Traditionally, business-to-business integration is viewed as a separate exercise from all other types of integration, which  is counter to the philosophy of an SOA. The reality is, for any integration project to succeed it must be solutions based, driven by the business requirements, and address the complete end-to-end solution. B2B is just another endpoint.

In summary, to extend your process beyond your enterprise, the process must be able to::
  • Identify the document
  • Manage multiple documents
  • Manage document variances
  • Correlate multiple documents
  • Manage errors
This Tech Note illustrated some of the techniques to accomplish these goals.
Discuss this technical note in the SOA Suite Discussion Forum or Integration B2B Discussion Forum.

Jeffrey Hutchins works in the Oracle SOA Product Management Team and is responsible for e-commerce strategy. He has created methodologies addressing compliance, security, visibility, scalability, and standards from the business and IT aspects. His focus is Business-to-Business (B2B) standards, best Practices, and complete end-to-end integration (ESB, BPM, B2B, BAM). He has presented new products and technologies via business and technical white papers, hands-on sessions and presentations at national and international events from 1996 and is recognized as Oracle's subject matter expert in the e-commerce arena.

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy