Developing ABCS to Participate in a Global Transaction How to Transaction-Enable AIA Services

13-30 Developers Guide for Oracle Application Integration Architecture Foundation Pack

13.6.4 Developing ABCS to Participate in a Global Transaction

In SOA 11g, you do not need to set up any configuration properties on the calling consuming process to chain an execution into a single global transaction. You only need to set the appropriate transaction flag on the Callee BPEL component. You can do this in the composite editors source by adding bpel.config.transaction into a BPEL component, with value as required as shown in Example 13–8 : Example 13–8 Setting the transaction flag on the callee BPEL component component name=SamplesCreateCustomerSiebelReqABCSImplProcess implementation.bpel src=SamplesCreateCustomerSiebelReqABCSImplProcess.bpel property name=bpel.config.transactionrequiredproperty component With the transaction flag set as shown, BPEL inherits the transaction that is already there, started by the parent process. If the parent process has not started a transaction, BPEL creates a new one. For a global transaction, the transaction is committed when the initiator commits. If BPEL has an inbound interface with an adapter, you must set the appropriate transaction flag in the composite of the adapter. Example 13–9 shows how transaction properties should be set on the BPEL adapter interface: Example 13–9 Setting transaction properties on the BPEL adapter interface component name=SamplesCreateCustomerSiebelJMSConsumerProcess implementation.bpel src=SamplesCreateCustomerSiebelJMSConsumerProcess.bpel property name=bpel.config.transactionrequiredproperty component In the case of BPEL invoking Mediator, the Mediator participates in the existing transaction if a transaction is present. If a transaction is not present, then Mediator starts a transaction.

13.6.5 How to Transaction-Enable AIA Services

The following sections provide details on how to transaction enable AIA services in different scenarios: ■ Section 13.6.5.1, Synchronous Request-Response Scenarios ■ Section 13.6.5.2, AIA Services in Asynchronous MEP ■ Section 13.6.5.3, Asynchronous Operation from an ABCS in the Same Thread but in a Different Transaction

13.6.5.1 Synchronous Request-Response Scenarios

Invoking a synchronous BPEL process results in creation of BPEL instance within its local transaction by default. This transaction can be enlisted to a global transaction given proper configurations. Completing ABCS Development 13-31 Hence, the transaction settings in the ABCS services should be as shown in Example 13–10 : Example 13–10 Transaction Settings in the composite.xml of the RequesterABCS component name=SamplesCreateCustomerSiebelJMSConsumerProcess implementation.bpel src=SamplesCreateCustomerSiebelReqABCSImplProcess.bpel property name=bpel.config.transactionrequiredproperty component This setting ensures that the callers transaction is joined, if there is one, or a new transaction is created when there is not one. The EBS inherits the transaction initiated by the Requester ABCS. A Mediator always enlists itself into the global transaction propagated through the thread that is processing the incoming message. Figure 13–11 illustrates the transaction boundary. Figure 13–11 Transaction Boundary

13.6.5.2 AIA Services in Asynchronous MEP

Invoking an asynchronous BPEL process results in persistence of invocation message in invoke message table within part of the callers transaction. The Callers transaction ends. The asynchronous BPEL executes in its own local transaction. For the Callee to be executed within the Callers transaction, the transaction flag must be set to required, as shown below, for the BPEL component, in the Callees composite. bpel.config.transaction=required 13-32 Developers Guide for Oracle Application Integration Architecture Foundation Pack To ensure a single threaded execution of the Callee, a case of a one-way operation, you must have a sync-type call. Set the property for the BPEL component in the Callees composite as shown below: bpel.config.oneWayDeliveryPolicy=sync Therefore, the transaction settings in the ABCS services should be as shown in Example 13–11 : Example 13–11 Transaction settings for asynchronous MEP component name=SamplesCreateCustomerSiebelReqABCSImplProcess implementation.bpel src=SamplesCreateCustomerSiebelReqABCSImplProcess.bpel property name=bpel.config.transactionrequiredproperty property name=bpel.config.oneWayDeliveryPolicysyncproperty If the Requester ABCS has an inbound interface with an adapter, then in the adapters composite, set the property at the BPEL component level, that is, bpel.config.oneWayDeliveryPolicy=sync. Example 13–12 shows how transaction properties are set on the adapter component: Example 13–12 Transaction properties set on adapter component component name=SamplesCreateCustomerSiebelJMSConsumerProcess implementation.bpel src=SamplesCreateCustomerSiebelJMSConsumerProcess.bpel property name=bpel.config.transactionrequiredproperty property name=bpel.config.oneWayDeliveryPolicysyncproperty component Figure 13–12 illustrates the transaction boundary. Completing ABCS Development 13-33 Figure 13–12 Transaction Boundary in Asynchronous MEP

13.6.5.3 Asynchronous Operation from an ABCS in the Same Thread but in a Different Transaction

When an ABCS has to invoke an asynchronous operation on a process, which must be executed in the same thread as that of ABCS but in a different transaction, set the following configuration in the called BPEL composite: property name=bpel.config.oneWayDeliveryPolicysyncproperty Note that, in this case, the transaction configuration, bpel.config.transaction, need not be set in the called BPEL composite because the called BPEL should be executed in a transaction different from that of the Caller.

13.7 Guaranteed Message Delivery