Business processes in Oracle WebLogic Integration are transactional in nature. Every step of a process is executed within the context of a JTA transaction. A transaction ensures that one or more operations execute as an atomic unit of work. If one of the operations within a transaction fails, then all of them are rolled-back so that the application is returned to its prior state. Depending on whether you design your business process logic such that your process is stateful or stateless (see, Building Stateless and Stateful Business Processes), there may be one or more transactions within the context of a given business process.
When you are building a business process, implicit transaction boundaries are formed based on where in the process you place blocking elements. The transaction boundaries within a business process change as you add process nodes to the business process. You can also create explicit transaction boundaries by selecting contiguous nodes and declaring them to be in a transaction separate from those created implicitly by the application. Resources accessed by a business process may also be part of the transaction, depending on the nature of the resource and the control that provides the access.
Implicit transactions are implicit both because their behavior is automatically determined (or implied) by your business process logic and because they are not visible in your process diagram. In the section, An Implicit Transaction Boundary Example, the implicit transaction boundaries in the diagrams are added for illustration; implicit transaction boundaries are not visible in the Oracle Workshop for WebLogic graphical design environment. Explicit transactions, on the other hand, are explicit because they are defined by you and they are visible in the business process diagram in Oracle Workshop for WebLogic.
This following sections deal specifically with transactions in the context of Oracle WebLogic Integration and business processes:
Recall that implicit transaction boundaries are formed based on where in the process you place blocking elements and that these boundaries change as you add process nodes to the business process. Additionally, a business process is stateless by default, and blocking elements that change transaction boundaries can change the process to stateful (see, Building Stateless and Stateful Business Processes). For more information about The following rules apply to transaction boundaries when you are building a business process:
Note: | By default, the beginning and the end of a parallel group node mark the boundaries of new transactions. However, you can specify that the active transaction is continued when entering and exiting a parallel block. To use this functionality, in Design view, select a Parallel node in your business process, then, in the JPD Configuration pane, change the continue transaction property to true. |
The following example illustrates the rules listed in the Implicit Transaction Boundary Rules section. In each of the figures in this section, the transaction boundaries are added to illustrate where they are implied in Oracle WebLogic Integration business processes.
Since the business process now contains two transactions, the Start node icon changes to indicate that the business has changed from Stateless to Stateful . For more information about Stateless and Stateful business processes, see Building Stateless and Stateful Business Processes.
This concludes the implicit boundaries example, you can also create transactions by adding explicit transaction boundaries to your business process. For information about how to do this, see Explicit Transaction Boundaries.
Recall that you define explicit transaction boundaries and that they are visible in the business process diagram in Oracle Workshop for WebLogic.You can create explicit transaction boundaries in your business process by selecting contiguous nodes and declaring them to be within their own transaction. The following rules apply for explicit transaction boundaries:
If you violate any of these rules when you create your business process, the application displays the transaction boundaries, but the offending nodes are marked with a . If you place your cursor over this icon, Oracle Workshop for WebLogic will display a message about the violation.
To invoke a JWS using JMS transport using request/response paradigm the caller must not be within a transaction. When business process is the caller, user must explicitly suspend the current business process transaction before calling the service control that sends the message to the JWS and resume the transaction after the invocation. The implications of suspending and resuming a transaction is as follow:
Transaction savedTxn =
TransactionHelper.getTransactionHelper().getTransactionManager().forceSuspend();
//call service control
TransactionHelper.getTransactionHelper().getTransactionManager().forceResume(savedTxn);
Explicit transaction boundaries are drawn around the nodes you selected as shown in Figure 24-6.
You can rename your transaction block by right-clicking Transaction and selecting Rename from the drop-down menu.
Transaction boundaries are created in the business process.
After you create an explicit transaction, you can set the properties for the transaction in the Properties view.
The related properties are displayed in the JPD Configuration view. If the JPD Configuration view is not visible in Oracle Workshop for WebLogic, choose Window > Show View > Other > General > JPD Configuration from the Oracle Workshop for WebLogic menu bar.
Note: | The default Process view displays only the Properties pane. The JPD Configuration view and the Properties pane can not be used together in the Process perspective. |
Note: | To modify values in the JPD Configuration pane, you need to first close the Properties pane and then open the JPD Configuration pane and reload the JPD. To return to the Properties pane, close the JPD Configuration pane, open the Properties pane and reload the JPD. |
To learn about exception handling in business processes, see Handling Exceptions. How exceptions are handled in transaction blocks is described in Handling Exceptions in Transaction Blocks.
Building Stateless and Stateful Business Processes