WebSphere Message Brokers
File: ac04680_
Writer: Terry Cowling

Reference topic

This build: July 31, 2007 21:17:32

DataDelete node

This topic contains the following sections:

Purpose

Use the DataDelete node to interact with a database in the specified ODBC data source. The DataDelete node is a specialized form of the Database node, and the interaction is restricted to deleting one or more rows from a table within the database. You specify what is deleted by defining mapping statements that use the data from the input message in some way to identify the action required.

You can set a property to control whether the update to the database is committed immediately, or deferred until the message flow completes, at which time the update is committed or rolled back, according to the overall completion status of the message flow.

The DataDelete node is represented in the workbench by the following icon:

DataDelete node icon

Using this node in a message flow

Consider a situation in which you are running a limited promotion. The goods are available only for the period of the promotion, and each customer can have only one item. When stocks of the sale goods run out, you want to remove their details from the stock database. When a message containing an order for the last item comes in, the DataDelete node is triggered to remove all the details for that item from the database.

Configuring the DataDelete node

When you have put an instance of the DataDelete node into a message flow, you can configure it. To display its properties, right-click the node and click Properties. (If you double-click the Compute node, you open the New Message Map dialog box.)

All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk.

Configure the DataDelete node as follows:

  1. Optional: On the description tab, enter a short description, a long description, or both. You can also change the name of the node on this tab.
  2. On the Basic tab:
    1. Specify in Data Source the name by which the appropriate database is known on the system on which this message flow is to execute. The broker connects to this database with user ID and password information that you have specified on the mqsicreatebroker, mqsichangebroker, or mqsisetdbparms command.

      z/OS platform On z/OS systems, the broker uses the broker started task ID, or the user ID and password that were specified on the mqsisetdbparms command JCL, BIPSDBP in the customization data set <hlq>.SBIPPROC.

    2. In Statement, identify the associated mapping routine that is to be executed in this node. By default, the name assigned to the mapping routine is identical to the name of the mappings file in which the routine is defined. The default name for the file is the name of the message flow concatenated with the name of the node when you include it in the message flow (for example, MFlow1_DataDelete.mfmap for the first DataDelete node in message flow MFlow1). You cannot specify a value that includes spaces.

      If you click Browse next to this entry field, a dialog box is displayed that lists all available mapping routines that can be accessed by this node. Select the routine that you want and click OK; the routine name is set in Statement.

      To work with the mapping routine that is associated with this node, double-click the node, or right-click the node and click Open Mappings. If the mapping routine does not exist, it is created for you with the default name in the default file. If the file exists already, you can also open file <flow_name>_<node_name>.mfmap in the Broker Development view.

      A mapping routine is specific to the type of node with which it is associated; you cannot use a mapping routine that you have developed for a DataDelete node with any other node that uses mappings (for example, a DataInsert node). If you create a mapping routine, you cannot call it from any other mapping routine, although you can call it from an ESQL routine.

      For more information about working with mapping files, and defining their content, see Developing message mappings.

    3. Select the Transaction setting from the drop-down menu. The values are:
      • Automatic (the default). The message flow, of which the DataDelete node is a part, is committed if it is successful; that is, the actions that you define in the mappings are performed and the message continues through the message flow. If the message flow fails, it is rolled back. Therefore, if you choose Automatic, the ability to commit or roll back the action of the DataDelete node on the database depends on the success or failure of the entire message flow.
      • Commit. To commit any uncommitted actions performed in this message flow on the database connected to this node, irrespective of the success or failure of the message flow as a whole, select Commit. The changes to the database are committed even if the message flow itself fails.
    4. For database warning messages to be treated as errors, and the node to propagate the output message to the failure terminal, select Treat Warnings as Errors. The check box is cleared initially.

      When you select the check box, the node handles all positive return codes from the database as errors and generates exceptions in the same way as it does for the negative, or more serious, errors.

      If you do not select the check box, the node treats warnings as normal return codes, and does not raise any exceptions. The most significant warning raised is not found, which can be handled as a normal return code safely in most circumstances.

    5. For the broker to generate an exception when a database error is detected, select Throw Exception on Database Error. The check box is selected initially.

      If you clear the check box, you must handle the error in the message flow to ensure the integrity of the broker and the database: the error is ignored if you do not handle it through your own processing because you have chosen not to invoke the default error handling by the broker. For example, you could connect the Failure terminal to an error processing subroutine.

Terminals and properties

The terminals of the DataDelete node are described in the following table.

Terminal Description
In The input terminal that accepts a message for processing by the node.
Failure The output terminal to which the input message is propagated if a failure is detected during the computation. If you have selected Treat warnings as errors, the node propagates the message to this terminal even if the processing completes successfully.
Out The output terminal that outputs the message following the execution of the database statement.

The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the bar file to deploy it).

The Description properties of the DataDelete node are described in the following table.

Property M C Default Description
Node name No No The node type, DataDelete The name of the node.
Short Description No No   A brief description of the node.
Long Description No No   Text that describes the purpose of the node in the message flow.

The DataDelete node Basic properties are described in the following table.

Property M C Default Description
Data Source No Yes   The ODBC data source name of the database in which reside the tables to which you refer in the mappings that are associated with this node (identified by the Statement property).
Statement Yes No DataDelete The name of the mapping routine that contains the statements that are to be executed against the database or the message tree. The routine is unique to this type of node.
Transaction Yes No Automatic The transaction mode for the node. Valid values are Automatic and Commit.
Treat Warnings as Errors Yes No Cleared If you select this check box, database SQL warnings are treated as errors.
Throw Exception on Database Error Yes No Selected If you select this check box, database errors cause the broker to throw an exception.
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:17:32

ac04680_ This topic's URL is: