This action might not be possible to undo. Are you sure you want to continue?
Use the Compute node to construct one or more new output messages. This topic contains the following sections:
Purpose Using this node in a message flow Configuring the Compute node Defining database interaction Specifying ESQL Setting the mode Validating messages Terminals and properties
The output messages that you create in the Compute node might be created by modifying the information that is provided in the input message, or by using only new information which can be taken from a database or from other sources. Elements of the input message (for example, headers, header fields, and body data), its associated environment, and its exception list can be used to create the new output message. Specify how the new messages are created by coding ESQL in the message flow ESQL resource file. For more information, see Specifying ESQL. Use the Compute node to:
Build a new message using a set of assignment statements Copy messages between parsers Convert messages from one code set to another Transform messages from one format to another
The Compute node is contained in the Transformation drawer of the palette, and is represented in theWebSphere® Message Broker Toolkit by the following icon:
Using this node in a message flow
Look at the following samples to see how to use this node:
Airline Reservations Aggregation JMS Nodes Large Messaging Message Routing Scribble Timeout Processing
The message flow. or the user ID and password that were specified on the mqsisetdbparms command JCL. the node treats warnings as typical return codes. irrespective of the success or failure of the message flow as a whole. seeConfiguring a message flow node. select Throw exception on database error. 2. which can be handled as a typical return code safely in most circumstances. modified copy of the message as an output message. The value that you choose is implemented for the one or more database tables that you have added. The Compute node does not modify its input message. The properties of the node are displayed in the Properties view. . the ability to commit or roll back the action of the Compute node on the database depends on the success or failure of the entire message flow. it is rolled back. You can use the Compute node to insert a unique identifier for your order into the output message. To force the broker to generate an exception when a database error is detected. That is. Configure the Compute node by: 1. it creates a new. 4. select Commit. To treat database warning messages as errors and have the node propagate the output message to the Failure terminal. 3. When you select the check box. of which the Compute node is a part. To commit the action of the Compute node on the database. 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. ormqsisetdbparms command. The values are: o Automatic (the default). mqsichangebroker. and does not raise any exceptions. On z/OS® systems. The check box is selected initially. The check box is cleared initially. The most significant warning raised is not found. The broker connects to this database with user ID and password information that you have specified on the mqsicreatebroker. Configuring the Compute node When you have put an instance of the Compute node into a message flow. If you do not select the check box. You can run samples only when you use the information center that is integrated with the WebSphere Message Broker Toolkit. the actions that you define in the ESQL module are performed on the message and it continues through the message flow. is committed if it is successful. the broker uses the broker started task ID. you cannot select a different value for each table. o Commit. which can be used by subsequent nodes in the message flow. or more serious. If the message flow fails. Select the Transaction setting from the list. Defining database interaction Specifying ESQL Setting the mode Validating messages Defining database interaction To access a database from this node: On the Basic tab. The database update is committed even if the message flow itself fails. Consider a message flow in which you want to give each order that you receive a unique identifier for audit purposes. select Treat warnings as errors. Video Rental You can view information about samples only when you use the information center that is integrated with the WebSphere Message Broker Toolkit or the online information center. specify in Data Source the name by which the appropriate database is known on the system on which this message flow is to run. errors. you can configure it. BIPSDBP in the customization data set <hlq>. All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk.SBIPPROC. If you chooseAutomatic.
you must include ESQL to check for any database error that might be returned after each database call that you make (you can use SQLCODE and SQLSTATE to do this).*[I]. The ESQL file. click Browse beside the ESQL Module property to display the Module Selection dialog box. which lists the available Compute node modules defined in the ESQL files that are accessible by this message flow (ESQL files can be defined in other. Code the ESQL statements that you want in an ESQL file that is associated with the message flow in which you have included this instance of the Compute node. WHILE I < J DO SET OutputRoot. or new data. If the file exists already. you might want to modify a value in the input message by adding a value from a database. you can open the appropriate ESQL file in the Broker Development view and select this node in the Outline view. the editor highlights the correct module.If you clear the check box. projects). -.CALL CopyEntireMessage().esql. If an error occurs. END. . or right-click the node and click Open ESQL. Each portion of code that is related to a specific node is known as a module. If a module skeleton is created for this node in a new or existing ESQL file.CALL CopyMessageHeaders(). For example. 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.*[I] = InputRoot. For example. using input message or database content (unchanged or modified). CREATE PROCEDURE CopyMessageHeaders() BEGIN DECLARE I INTEGER 1. The default module name is shown in this example: CREATE COMPUTE MODULE <flow_name>_Compute CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN -. If the file and the module exist already. which by default has the name<message_flow_name>. you can customize the node to create a new output message or messages. Select the appropriate module and click OK. If no suitable modules are available. you can include the ESQL THROW statement to throw an exception in this node. it consists of the following ESQL. DECLARE J INTEGER CARDINALITY(InputRoot. Specifying ESQL Code ESQL statements to customize the behavior of the Compute node. or you can use the Throw node to generate your own exception at a later point in the message flow. For example. contains ESQL for every node in the message flow that requires it. and storing the result in a field in the output message. you must handle the error in the message flow to ensure the integrity of the broker and the database. This action creates and opens a new ESQL file in the ESQL editor view. dependent. If the module that you have specified does not exist.*). RETURN TRUE. If an ESQL file does not already exist for this message flow. If you prefer. double-click the Compute node. the list is empty. it is created for you and the editor displays it.
The default value is also used whenever a PROPAGATE statement does not specify the composition of its output message. provide common functions that you might want when you manipulate messages. This default value is used when the transformed message is routed to the Out terminal when processing in the node is completed. If you do not want to use a procedure. END. Conversely. LocalEnvironment (previously specified as DestinationList). Add your own ESQL to customize this node after the BEGIN statement that follows CREATE FUNCTION. If you create your own ESQL module. Select the property to specify whether the Message. The calls in the skeleton are commented out. END. but ensure that the name you specify matches the name of the corresponding node property ESQL Module. the updates are local to this node. even if you modify those components. Setting the mode The Compute Mode property controls which components are used by default in the output message. These procedures. The seven possible values that the Compute Mode property can take are listed in the following table. to procedures CopyEntireMessage and CopyMessageHeaders. CREATE PROCEDURE CopyEntireMessage() BEGIN SET OutputRoot = InputRoot. If you want the module name to include one or more spaces.SET I = I + 1. enclose the name in double quotation marks in the ESQL Moduleproperty. defined following function Main. END WHILE. andException List components that are either generated in the node or contained in the incoming message are used. Mode Description . END MODULE. You can change the default name. remove both the call and the procedure definition from the module. You can use the two calls included in the skeleton. remove the comment markers if you want to use the procedure. you must create this skeleton exactly as shown except for the procedure calls and definitions (described later in this section). those components that are included in the selection are not passed on and the updates that are made in the node persist. Those components that are not included in your selection are passed on unchanged. and before RETURN TRUE.
the Compute node is expecting to generate all three new message trees for the Root. The value of the Compute Mode property specifies which new message trees are propagated from the Computenode. Exception and LocalEnvironment The Exception List and LocalEnvironment tree structure are generated or passed through by the Compute node as modified by the node. and ExceptionList by populating the OutputRoot. . they are lost at that node in the message flow. Exception And Message The Exception List and message are generated or passed through by the Compute node as modified by the node. All The message. if the Compute Mode property is set to All. for those message trees that are selected. SET OutputExceptionList = InputExceptionList. OutputLocalEnvironment. and OutputExceptionList. Exception The Exception List is generated or passed through by the Computenode as modified by the node. the input messages are discarded unless they are explicitly copied into the new equivalent output message tree. SET OutputLocalEnvironment = InputLocalEnvironment. If All is selected. LocalEnvironment And Message The LocalEnvironment tree structure and message are generated or passed through by the Compute node as modified by the node. and LocalEnvironment are generated or passed through by the Compute node as modified by the node. the LocalEnvironment and ExceptionList are not copied across and are not propagated to the output terminal. LocalEnvironment. Therefore. The input message trees are not passed to the output unless they are copied explicitly from the Input to the Output. you must code the following ESQL to allow the input trees to be propagated to the output terminal: SET OutputRoot = InputRoot. Exception List. LocalEnvironment The LocalEnvironment tree structure is generated or passed through by the Compute node as modified in the node.Mode Description Message (the default) The message is generated or passed through by the Computenode as modified in the node. Therefore. If the ESQL was CopyEntireMessage().
the . the Compute Mode property value might mean that the message tree propagates when you do not intend it to. but because you selected Message. InputLocalEnvironment. OutputExceptionList Exception and Message OutputRoot. InputLocalEnvironment. are passed on from the Compute node. OutputExceptionList Where an output tree is named. InputExceptionList Exception InputRoot. the following trees are propagated from the Compute or Mapping node for the following settings. you might delete a tree that was input to the node. because you did not transfer it to the output tree. ESQL creates this message tree before propagation. However. OutputLocalEnvironment.To produce a new or changed output message. OutputExceptionList Exception and LocalEnvironment InputRoot. or propagate a changed tree as you intended. You can create all three output trees in aCompute or Mapping node and these can be manipulated and exist in the node. and the input tree is not used in its place because the Compute Mode property did not indicate this option. If your ESQL does not create the tree. OutputLocalEnvironment. the Compute Modedetermines whether such output trees are used on propagation from the node. dependent on Compute Modeproperty settings and your ESQL. OutputLocalEnvironment. InputExceptionList LocalEnvironment and Message OutputRoot. If your ESQL interrogates the input trees and does not need to propagate these trees. On propagation from the node. Compute Mode Trees propagated All OutputRoot. set the Compute Mode property to Message so that the LocalEnvironment and ExceptionList that are passed to the Compute or Mapping node. OutputExceptionList Message OutputRoot. For example. no tree is propagated for that correlation name. Therefore. InputLocalEnvironment. The Compute Mode applies only to propagation from the node. The converse is also true. you might not want to propagate the LocalEnvironment and ExceptionList from aCompute node. and propagate the same LocalEnvironment and ExceptionList. OutputLocalEnvironment. InputExceptionList LocalEnvironment InputRoot.
These properties do not cause the input message to be validated. and InputExceptionList and OutputExceptionList. so that you can use ESQL to refer to fields in either message. Even if the ESQL explicitly deletes the OutputLocalEnvironment and OutputExceptionList. Out1 The first alternative output terminal to which the transformed message might be routed by a PROPAGATE statement. Its contents. You can also work with both InputLocalEnvironment and OutputLocalEnvironment.input versions of the trees are propagated. the validation has already been performed by the input node or a preceding validation node. if any. The transformed message might also be routed to this terminal by a PROPAGATE statement. It is expected that. 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 routed if an unhandled exception occurs during the computation. as well as the input and output message bodies. If you select an option (or accept the default value) that does not include a particular part of the message. For more details. if such validation is required. Out The output terminal to which the transformed message is routed when processing in the node is completed. these changes are local to that node because the Compute Mode property setting causes the input trees to be propagated. Validating messages Set the validation properties to define how the message that is produced by the Compute node is to be validated. see Validating messages and Validation properties. Terminals and properties The Compute node terminals are described in the following table. that part of the message is not included in any output message that is constructed. The Environment component of the message tree is not affected by the Compute Mode property setting. . are passed on from this node in the output message. Out2 The second alternative output terminal to which the transformed message might be routed by a PROPAGATE statement. Set this property to reflect the output message format that you require. The Compute node has both an input and output message.
see PROPAGATE statement. Long Description No No Text that describes the purpose of the node in the message flow. The following tables describe the node properties. Property M C Default Description Node name No No The node type The name of the node. Transaction Yes No Automatic The transaction mode for the node.Terminal Description Out3 The third alternative output terminal to which the transformed message might be routed by a PROPAGATE statement. The Compute node Description properties are described in the following table. 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 for deployment). The property is valid only if you have selected a . you must specify a value for theData Source property. For the syntax of the PROPAGATE statement. Out4 The fourth alternative output terminal to which the transformed message might be routed by a PROPAGATE statement. You can specify only one data source for the node. Valid options are Automatic andCommit. Short Description No No A brief description of the node. The Compute node Basic properties are described in the following table. The column headed M indicates whether the property ismandatory (marked with an asterisk if you must enter a value when no default is defined). Property M C Default Description mqsiapplybaroverridecommand property dataSource Data Source No Yes The ODBC data source name for the database that contains the tables to which you refer in the ESQL file that is associated with this message flow (identified in the ESQL Moduleproperty). If the ESQL that is associated with this node includes a PASSTHRU statement or SELECT function and a database reference.
validateMaster . see Setting the mode. ESQL Module Yes No Compute The name of the module in the ESQL file that contains the statements to run against the database and input and output messages. The Parser Options properties for the Compute node are described in the following table. Choose from: Compute Mode Yes No Message Message LocalEnvironment LocalEnvironment And Message Exception Exception And Message Exception And LocalEnvironment All For more information about setting the mode options. database errors cause the broker to throw an exception. Treat warnings as errors Throw exception on database error Yes No Cleared If you select the check box. If outgoing messages do not contain MQRFH2 headers this property has no effect. and Inherit. Property M C Default Description mqsiapplybaroverridecommand property Validate No Yes None This property controls whether validation takes place. database SQL warnings are treated as errors.Property M C Default Description mqsiapplybaroverridecommand property database table for input. see Validation properties. Valid values are None.Content and Value. allowing an external application to remain unchanged. For a full description of these properties. Yes No Selected If you select this check box. Property M C Default Description Use XMLNSC Compact Parser for XMLNS Domain No No Cleared Setting this property causes the outgoing MQRFH2 to specify the XMLNS instead of XMLNSC parser.Content. The Validation properties of the Compute node are described in the following table.
The Monitoring properties of the node are described in the following table. Valid values areUser Trace. Local Error Log. Exception. Edit. You can enable and disable events that are shown here by selecting or clearing the Enabled check box. and Delete to create. By default. seeConfiguring monitoring event sources using monitoring properties for details. You can set this property only if Validate is set to Content or Content and Value. change or delete monitoring events for the node. no monitoring events are defined on any node in a message flow. Use Add. andException List.Property M C Default Description mqsiapplybaroverridecommand property Failure Action No No Exception This property controls what happens if a validation failure occurs. Property M C Default Description Events No No None Events that you have defined for the node are displayed on this tab. .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.