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 WebLogic Workshop 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 WebLogic Workshop.

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

Note: To learn about how WebLogic Workshop transactions work, see Default Transactional Behavior in WebLogic Workshop.

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 illustrated in the following figure.
  2. image

  3. If we configure the Starting Event to be a Client Receive node, the following transaction boundaries are implied.
  4. image

  5. When we add a Control Send node, the implied transaction boundary extends to include the new node.
  6. image

  7. By adding a Control Receive node, we add a blocking element to the business process and therefore create a new transaction.
  8. image

    Since the business process now contains two transactions, the Start node icon changes to indicate that the business has changed from Stateless image to Stateful image . 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.
  10. image

    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 WebLogic Workshop.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 image . If you place your cursor over this icon,WebLogic Workshop will display a message about the violation.

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.

    image

    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 image Transaction from the 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 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 Property Editor.

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 Property Editor. If the Property Editor is not visible in WebLogic Workshop, choose View —> Property Editor from the menu bar.

  3. In the Property Editor, 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

Implicit Transactions in WebLogic Workshop

Transaction Basics

Default Transactional Behavior in WebLogic Workshop

Building Stateless and Stateful Business Processes

Configuring and Managing Transactions at http://download.oracle.com/docs/cd/E13222_01/wls/docs81/jta/admtrx.html

Previous Document Next Document