This topic contains the following sections:
Use the Throw node to throw an exception within a message flow. The exception can be caught and processed by:
You can 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 it does not, the message can be passed to a Throw node that records details about the exception in the ExceptionList subtree within the message.
The Throw node is represented in the workbench by the following icon:
Look at the following samples to see how to use this node:
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, you can 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.
When you have put an instance of the Throw node into a message flow, you can configure it. Right-click the node in the editor view and select Properties. The node's basic properties are displayed.
All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk on the properties dialog.
Configure the Throw node as follows:
If you have created your own message catalog, enter the number for the message in the catalog that you want to use when this exception is thrown.
If you are using the default message catalog, specify a number between 3001 and 3049. These numbers are reserved in the WebSphere Message Broker catalog for your use. The text of each of these messages in the default message catalog is identical, but you can use a different number within this range for each situation in which you throw an exception; use the number to identify the exact cause of the error.
The default message number is 3001.
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.
Click Cancel to close the dialog and discard all the changes that you have made to the properties.
The Throw node terminal is described in the following table.
Terminal | Description |
---|---|
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 on the properties dialog 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 Basic properties are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Message Catalog | No | No | The name of the message catalog from which the error text for the error number of the exception is extracted. The default value (blank) indicates that the message is taken from the message catalog supplied with WebSphere Message Broker. | |
Message Number | No | No | 3001 | The error number of the exception being thrown. |
Message Text | No | No | Additional text that explains the cause of the error. |
The Throw node Description properties are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
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. |
Notices |
Trademarks |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
ac04830_ |