Guide to Building Business Processes

     Previous  Next    Open TOC in new window  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Transaction Boundaries

Business processes in 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 BEA WorkSpace Studio 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 BEA WorkSpace Studio.

This following sections deal specifically with transactions in the context of WebLogic Integration and business processes:


Implicit Transaction Boundary Rules

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:


An Implicit Transaction Boundary Example

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 WebLogic Integration business processes.

  1. Start with an empty business process, as shown in Figure 24-1.
  2. Figure 24-1 Empty Business Process

    Empty Business Process

  3. If we configure the Starting Event to be a Client Receive node, the following transaction boundaries are implied, as shown in Figure 24-2.
  4. Figure 24-2 Transaction for Client Receive Node

    Transaction for Client Receive Node

  5. When we add a Control Send node, the implied transaction boundary extends to include the new node (see Figure 24-3).
  6. Figure 24-3 Implied Transaction Boundary

    Implied Transaction Boundary

  7. By adding a Control Receive node, we add a blocking element to the business process and therefore create a new transaction (see Figure 24-4).
  8. Figure 24-4 New Transaction Boundaries

    New Transaction Boundaries

    Since the business process now contains two transactions, the Start node icon changes to indicate that the business has changed from Stateless New Transaction Boundaries to Stateful New Transaction Boundaries. For more information about Stateless and Stateful business processes, see Building Stateless and Stateful Business Processes.

  9. If we add a Client Response node to the business process, the second transaction’s boundaries expands to include the new node as shown in Figure 24-5.
  10. Figure 24-5 Client Response Node Transaction node

    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.


Explicit Transaction Boundaries

Recall that you define explicit transaction boundaries and that they are visible in the business process diagram in BEA WorkSpace Studio.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 Client Response Node Transaction node. If you place your cursor over this icon, BEA WorkSpace Studio 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 = 
//call service control

Creating Explicit Transaction Boundaries

To Create an Explicit Transaction—Alternative 1
  1. Select the nodes that you want to include in your transaction by clicking and dragging your mouse around them, or holding down your Ctrl key while clicking them.
  2. Right-click one of the selected nodes and select Create Transaction from the drop-down menu.
  3. Explicit transaction boundaries are drawn around the nodes you selected as shown in Figure 24-6.

    Figure 24-6 Explicit Transaction Boundaries

    Explicit Transaction Boundaries

    You can rename your transaction block by right-clicking Transaction and selecting Rename from the drop-down menu.

To Create an Explicit Transaction—Alternative 2
  1. In the Design view, drag and drop Explicit Transaction Boundaries Transaction from the Node Palette onto the business process, placing it on the business process at the point at which you want to create explicit transaction boundaries.
  2. Transaction boundaries are created in the business process.

  3. Drag and drop nodes from the Node Palette onto the business process, placing them within the transaction boundaries.

Setting the Explicit Transaction Properties

After you create an explicit transaction, you can set the properties for the transaction in the Properties view.

To Set the Transaction Properties
  1. Select the transaction for which you want to set the properties.
  2. The related properties are displayed in the JPD Configuration view. If the JPD Configuration view is not visible in BEA WorkSpace Studio, choose Window > Show View > JPD Configuration from the BEA WorkSpace Studio menu bar.

  3. In the JPD Configuration pane, set the following properties:


Handling Exceptions in Transaction Blocks

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.

Related Topics

Building Stateless and Stateful Business Processes

  Back to Top       Previous  Next