Use the Throw node to throw an exception in a message flow.
An exception can be caught and processed by:
- A preceding TryCatch node
- The message flow input node (the built-in nodes, for example HTTPInput and MQInput, have Catch terminals)
- A preceding AggregateReply node
Include a Throw node to force an error path through the message flow if the content of the message contains unexpected data. For example, to back out a message that does not contain a particular field, you can check (using a Filter node) that the field exists; if the field does not exist, the message can be passed to a Throw node that records details about the exception in the exception list subtree in the message.
The Throw node is contained in the Construction drawer of the palette, and is represented in the IBM® Integration Toolkit by the following icon:
Using this node in a message flow
Include a Throw node with a TryCatch node in your message flow to alert the systems administrator of a potential error situation; for example, if you have a Compute node that calculates a number, test the result of this calculation and throw an exception if the result exceeds a certain amount. The TryCatch node catches this exception and propagates the message to a sequence of nodes that process the error.
Terminals and properties
When you have put an instance of the Throw node into a message flow, you can configure it; see Configuring a message flow node. The properties of the node are displayed in the Properties view. All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk.
The Throw node terminal is described in the following table.
|In||The input terminal that accepts a message for processing by the node.|
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 Throw node Description properties are described in the following table.
|Node name||No||No||The node type: Throw||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 Throw node Basic properties are described in the following table.
|Message Catalog||No||No||The name of the message catalog from which the error text for the error number of the exception is extracted. Enter the fully-qualified path and file name of the message catalog that contains the message source. This file can be your own message catalog, or the default message catalog that is supplied with IBM Integration Bus. To use the default supplied catalog, leave this property blank.|
|Message Number||No||No||3001||The error number of the exception that is being
|Message Text||No||No||Additional text that explains the cause of the
error. Enter any additional free format text that contains information
that you want to include with the message when it is written to the
local error log; for example, if you have checked for the existence
of a particular field in a message and thrown an exception when that
field is not found, you might include the text:
The message did not contain the required field: Branch numberIf you are using the default message catalog, this text is inserted as &1 in the message text.
|Events||No||No||None||Events that you have defined for the node are
displayed on this tab. By default, no monitoring events are defined
on any node in a message flow. Use Add, Edit,
and Delete to create, change or delete monitoring
events for the node; see Configuring monitoring event sources by using monitoring properties for details.
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.