Using the Extend Option

Managing Callouts 13-3 Below the illustration is a key with two letters: A and B. The key letter A which denotes the smaller upper left box inside the Host Trading Partner seller box says Source Document Definition: PurchaseOrderRequest and Target Document Definition: PurchaseOrderAcceptance. The key letter B which denotes the smaller lower left box inside the Host Trading Partner seller box says Source Document Definition: PurchaseOrderAcceptance and Target Document Definition: PurchaseOrderRequest. In this example, the host application of the host trading partner is an Oracle E-Business Suite application that does not use RosettaNet XML-formatted messages. To enable communication between these two different formats, you create two callouts, as follows: ■ One callout, callout_inbound, for example, transforms the RosettaNet XML-formatted purchase order request into an Oracle E-Business Suite XML format understood by the Oracle E-Business Suite application. The Oracle E-Business Suite application, in turn, responds to the request message with a purchase order acceptance message in Oracle E-Business Suite XML format. ■ The other callout, callout_outbound, for example, transforms the Oracle E-Business Suite XML format back into a RosettaNet XML-formatted message for the remote trading partner. These two callouts are then associated with the two agreements created for this exchange, as follows: ■ Include callout_outbound in the agreement for the outbound message, that is, the agreement for the initiating purchase order request. ■ Include callout_inbound in the agreement for the inbound message, that is, the agreement for the responding purchase order acceptance. Because a document definition is a component of an agreement, a callout is associated with a specific document definition. This purchase order example depicts a simple association of one callout to one agreement. In reality, however, the same callout can be included in many different agreements by changing the value of one or more callout parameters. See Figure 13–3 for where you add parameters and see Table 13–2 for a list of parameter attributes.

13.1.1 Transport Callouts

Another type of callout is the transport callout, which is associated with a channel. For the inbound message, B2B invokes the transport callout immediately after it receives a message from the transport. For the outbound message, B2B invokes the transport callout immediately before it sends a message to the transport. Transport callouts can be selected in the channel configuration, as shown in Figure 13–2 , and can be used with any protocol. 13-4 Oracle Fusion Middleware Users Guide for Oracle B2B Figure 13–2 Transport Callouts The image shows that Callout_transport1 is selected from the Transport Callout list. This field is on the Channel Attributes tab. Any protocol can be selected. You can use transport callouts to extract custom headers for inbound and outbound messages using the MLLP protocol. Example 13–1 shows how to set and get the CUSTOM_HEADER property in the callout. Example 13–1 Setting and Getting the CUSTOM_HEADER Property import java.util.; import oracle.tip.b2b.callout.; import oracle.tip.b2b.callout.exception.; public class SampleCallout implements Callout { public void executeCalloutContext context,List input,List output throws CalloutDomainException, CalloutSystemException { try { CalloutMessage cmIn = CalloutMessageinput.get0; String s =cmIn.getBodyAsString; for getting the CUSTOM_HEADER Properties params = PropertiescmIn.getParameters; String customHeader = Stringparams.getCUSTOM_HEADER; for setting the CUSTOM_HEADER CalloutMessage cmOut = new CalloutMessages; cmOut.setParameterCUSTOM_HEADER, your_value; output.addcmOut; } catch Exception e { throw new CalloutDomainExceptione; }