This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA
This is bold text
The element is a mandatory element within the element. It provides information about the fault in a form that can be processed by software. It contains a element and an optional <Subcode> element. The element is a mandatory element within the element. It provides information about the fault in a form intended for a human reader. The element contains one or more elements, each of which contains information about the fault in a different language. The element contains the URI of the SOAP node that generated the fault. A SOAP node that is not the ultimate SOAP receiver must include the element when it creates a fault; an ultimate SOAP receiver is not obliged to include this element, but might do so. The element contains a URI that identifies the role in which the node was operating at the point the fault occurred. The element is an optional element, which contains application-specific error information related to the SOAP fault codes describing the fault. The presence of the element has no significance as to which parts of the faulty SOAP message were processed.
SOAP nodes A SOAP node is the processing logic which operates on a SOAP message. A SOAP node can: v Transmit a SOAP message v Receive a SOAP message v Process a SOAP message v Relay a SOAP message A SOAP node can be a: SOAP sender A SOAP node that transmits a SOAP message. SOAP receiver A SOAP node that accepts a SOAP message. Initial SOAP sender The SOAP sender that originates a SOAP message at the starting point of a SOAP message path. SOAP intermediary A SOAP intermediary is both a SOAP receiver and a SOAP sender and is Working with Web services
675
targetable from within a SOAP message. It processes the SOAP header blocks targeted at it and acts to forward a SOAP message toward an ultimate SOAP receiver. Ultimate SOAP receiver The SOAP receiver that is a final destination of a SOAP message. It is responsible for processing the contents of the SOAP body and any SOAP header blocks targeted at it. In some circumstances, a SOAP message might not reach an ultimate SOAP receiver, for example because of a problem at a SOAP intermediary. Note: A SOAP node is not the same as a WebSphere Message Broker SOAP node. Typically references to ″SOAP nodes″ in the WebSphere Message Broker Information Center are referring to WebSphere Message Broker SOAP nodes; see “WebSphere Message Broker SOAP nodes.”
WebSphere Message Broker SOAP nodes The SOAP nodes act as points in the flow where Web service processing is configured and applied. Properties on the SOAP nodes control the processing carried out and can be configured by supplying a WSDL definition, or by manually configuring properties, or both.
SOAP nodes v The SOAPInput and SOAPReply nodes are analogous to the HTTPInput and HTTPReply nodes and are used in a message flow which implements a Web service. These SOAP nodes are used to construct a message flow that implements a Web service provider. The SOAPInput node listens for incoming Web service requests, and the SOAPReply sends responses back to the client. See “SOAPInput node” on page 1112 and “SOAPReply node” on page 1122. v The SOAPRequest node is analogous to the HTTPRequest node and is used in a message flow to call a Web service provider synchronously. Calling a Web service synchronously means the node sends a Web service request and waits, blocking the message flow, for the associated Web service response to be received before the message flow continues. See “SOAPRequest node” on page 1124. v The SOAPAsyncRequest and SOAPAsyncResponse nodes are used to construct a message flow (or pair of flows) which calls a Web service asynchronously. Calling a Web service asynchronously means the SOAPAsyncRequest node sends a Web service request, but the request does not block the message flow by waiting for the associated Web service response to be received because the Web service response is received at the SOAPAsyncResponse node which is in a separate flow. The Node Correlator identifies the logical pairing of the responses against the original requests. Multiple requests can, therefore, be handled in parallel. See “SOAPAsyncRequest node” on page 1089 and “SOAPAsyncResponse node” on page 1099. v The SOAPExtract and SOAPEnvelope nodes enable you to work on the payload of the SOAP body. The SOAPExtract node can interoperate with the SOAP domain. The SOAP nodes do not require the SOAPEnvelope node, because they can directly handle non-SOAP messages (and look at the LocalEnvironment) but the SOAPEnvelope node is still required for the HTTP nodes. See “SOAPExtract node” on page 1107 and “SOAPEnvelope node” on page 1104. Note: WebSphere Message Broker SOAP nodes are not the same as the SOAP nodes; see “SOAP nodes” on page 675. Typically references to ″SOAP nodes″
676
Message Flows
in the WebSphere Message Broker Information Center are referring to WebSphere Message Broker SOAP nodes.
SOAP applications SOAP is an XML based language defined by the World Wide Web Consortium (W3C) for sending data between applications. SOAP is transport and platform neutral.
SOAP message A SOAP message comprises an envelope containing: v An optional header (containing one or more header blocks). v A mandatory body. The content of the header and body is typically defined by WSDL.
SOAP style SOAP defines two types of style: RPC
The SOAP body corresponds to a method call.
document The SOAP body is typically a coarser-grained XML document and is defined explicitly by XML Schema.
SOAP encodings SOAP defines two types of encoding: SOAP encoding With SOAP encoding the content is defined using an encoding scheme which implies a specific mapping to language-specific types. literal With literal encoding the SOAP content is defined explicitly by some schema (generally XML Schema).
SOAP style and encoding combinations Three of the four possible SOAP style and encoding combinations are supported by the WSDL importer and the WSDL generator: v RPC and SOAP encoded (supported for the WSDL importer only). v RPC and literal. v Document and literal.
SOAP versions Two versions of SOAP are available: v SOAP 1.1 v SOAP 1.2 SOAP 1.1 has some interoperability issues, mainly concerned with the use of SOAP encoding, which are addressed by a separate standard: the WS-I Basic Profile.
Working with Web services
677
Further information For more information about WSDL 1.1 refer to the World Wide Web Consortium (W3C), and in particular the SOAP 1.1 and SOAP 1.2 documents at: v http://www.w3.org v http://www.w3.org/TR/soap For more information about the WS-I Basic Profile refer to the WS-I, and in particular the WS-I Basic Profile document: v http://www.ws-i.org/ v http://www.ws-i.org/deliverables
Using the SOAP parser This topic lists the steps you need to set up a sample message flow using the SOAP parser with WebSphere Message Broker and how you test the flow. The following set of topics takes you through the process of setting up: 1. A main message flow that includes various SOAP nodes, together with: v A Filter node v A WebSphere MQ MQOutput node v Various Mapping nodes See “Building the main message flow” 2. How you test the message flow using the integrated test client; see “Testing the message flow using the integrated test client” on page 681. 3. How you deploy the message flow and test the flow using HTTP; see “Testing the message flow using HTTP” on page 682.
Building the main message flow This is the first topic in a set of instructions on creating a message flow to use the SOAP parser with WebSphere Message Broker. Use the following instructions to create a sample main message flow that uses the SOAP parser: 1. Switch to the Broker Application Development perspective. 2. Create a message flow and message set projects using the Start from WSDL and/or XSD files wizard. For details on how to do this, see “Creating an application based on WSDL or XSD files” on page 154. You need one port for the input to and response from the message flow named, for example, OrderService. You also need one port defining a web service that is called from the message flow named for example, ShippingService. 3. To import the database files, select the message flow project and right-click. a. Select New->Database Definition Files to start the Database Definition wizard. See “Adding database definitions to the workbench” on page 551 for details on how to do this. 4. Select the WSDL file you require, called, in this example, OrderService, under Deployable WSDL from the Active Working Set. a. Drag the mouse pointer to the message flow editor. b. Release the left mouse button. The Configure New Web Service Usage wizard starts.
678
Message Flows
c. See “Creating an application using the Configure New Web Service Usage wizard” on page 157 for further information. Ensure that you select: v Expose message flow as web service on page one of the wizard. v SOAP nodes on page two of the wizard. When you select Finish a skeleton message flow is generated, consisting of a: v SOAPInput node that is pre-configured for the web service, connected to a: v SOAPExtract node to remove the SOAP envelope from the incoming message, v and a SOAPReply node. 5. Select the Construction folder on the message flow palette to display the contents. 6. Select a Trace node and move the mouse to the right of the SOAPExtract node. a. Click the left mouse button to add the node to the message flow. The name is selected automatically. b. Press the Enter key to accept the default name. c. Wire the submitPORequest terminal of the SOAPExtract node to the In terminal of the Trace node. 7. Select the Trace node to display the properties. a. Use the drop down menu to set Destination to File. b. Set the File path you require. c. Enter the Pattern you require. 8. Expand the Routing folder on the palette and select Filter. 9. Add the Filter node to the right of the Trace node. a. Type in the name for the node you require and press the Enter key. b. Wire the out terminal of the Trace node to the in terminal of the Filter node. 10. Select the Filter node to display the properties. a. Enter the Data source name you require. b. Change the name of Filter expression to the name you selected for the Filter node. c. Remove the check from the Throw exception on database error check box. 11. Select the Filter node and double click the left mouse button to open the ESQL editor. Create or change the ESQL for the node; see “Creating ESQL for a node” on page 296 and“Modifying ESQL for a node” on page 299. 12. Expand the Transformation folder on the palette and select a Mapping node. 13. Add the Mapping node to the right of the Filter node. a. Type in the name for the node you require and press the Enter key. b. Wire the false terminal of the Filter node to the in terminal of the Mapping node. 14. Select the Mapping node to display the properties. a. Change the name of Mapping routine to the name you selected for the Mapping node. 15. Select the Mapping node and double click the left mouse button to open the Message Mapping editor. a. Select the map source and map target you require. Working with Web services
679
b. Click OK c. Click OK on the tip that displays to open the mapping editor. See “Creating a message map file from a Mapping node” on page 526 for further information. 16. Select Properties in both the source and target pane. a. Right-click and select Map by Name from the menu. b. Map the source properties to the target properties using drag and drop mapping. The Map by Name dialog appears. c. Click OK to perform the mapping. 17. Expand the WebSphere MQ folder on the palette and select a MQOutput node. 18. Add the MQOutput node to the right of the Mapping node. a. Type in the name for the node you require and press the Enter key. b. Wire the out terminal of the Mapping node to the in terminal of the MQOutput node. 19. Select the MQOutput node to display the properties. a. Enter the Queue name you require. b. If necessary, select the Advanced tab to change any of the fields on the next panel. 20. Expand the Transformation folder on the palette and select a Mapping node. 21. Add the second Mapping node underneath the first Mapping node. a. Type in the name for the node you require and press the Enter key. b. Wire the false terminal of the Filter node to the in terminal of this Mapping node. 22. Add the Mapping node to the right of the Filter node. a. Type in the name for the node you require and press the Enter key. b. Wire the false terminal of the Filter node to the in terminal of the Mapping node. c. Wire the out terminal of the Mapping node to the in terminal of the SOAPReply node. 23. Select the Mapping node to display the properties. a. Change the name of Mapping routine to the name you selected for the Mapping node. 24. Select the second Mapping node and double click the left mouse button to open the Message Mapping editor. The reply message is a SOAP message. Because the input message has been processed by a SOAPExtract node, it does not contain a SOAP envelope. a. Select submitPORequest as the source message. b. Select SOAP_Domain_Msg as the target message. c. Click OK. d. Click OK on the tip that displays to open the Message Mapping editor. See “Creating a message map file from a Mapping node” on page 526 for further information. 25. Select Properties in both the source and target pane. a. Right-click and select Map by Name from the menu. b. Map the source properties to the target properties using drag and drop mapping. The Map by Name dialog appears.
680
Message Flows
c. Click OK to perform the mapping. 26. Expand the SOAP_Domain_Msg, then Body and message items in the target pane. 27. Select the tns:submitPORequest item in the source pane. 28. Select the Wildcard Message item in the target pane. a. Right-click and select Create new Submap from the menu. b. Expand the Wildcard item. c. Scroll down to and select the submitPOResponse item. d. Press OK to create the submap. 29. Use drag and drop mapping to select the items you require in the Source pane. 30. Select the first item you require in the Target pane. a. Right-click and select Enter Expression from the menu. b. Enter the value you require in the expression editor and press the Enter key to complete the mapping. You must enclose any expression that is a string of characters in single quotation marks. Repeat the above steps for all the items you require in the Target pane and save the submap and map by using Ctrl+S. 31. Set up another flow that uses a Mapping node to build a ship request message, a SOAPRequest node to send the request to the ShippingService Web service and another Mapping node to create the response message back to the original requester. a. Repeat the instructions in the preceding steps that tell you how to set up a Mapping node and a sub map. Connect the True terminal of the Filter node to the In terminal of the new Mapping node. b. Select the ShippingService.wsdl file under the Deployable WSDL folder in the MessageSet project. you are using. c. While holding down the left mouse button, move the mouse pointer to the right of the new Mapping node and release the left mouse button; the New Web Service Usage wizard starts. d. Change the Web service usage to Invoke web service from message flow and select SOAP nodes on the next panel. e. Click Finish to create a SOAPRequest node. For more details on using this wizard, see “Creating an application using the Configure New Web Service Usage wizard” on page 157. Connect the Out terminal of the new Mapping node to the In terminal of the SOAPRequest node. f. Repeat the instructions in the preceding steps again that tell you how to set up a Mapping node and a sub map. Connect the: v shipPartResponse terminal of the SOAPRequest node to the In terminal of the second new Mapping node. v The Out terminal of the new Mapping node to the In terminal of the SOAPReply node. 32. Save the entire message flow.
Testing the message flow using the integrated test client This is the second of a set of instructions on setting up your system to use the SOAP parser with WebSphere Message Broker and illustrates the testing of the message flow.
Working with Web services
681
Prior to carrying out this task you must have imported a message flow into the workbench. For example, to import a zip file: 1. Select File->Import 2. Expand the Other folder, select Project Interchange and click Next 3. Click the Browse button next to the From zip file text box. 4. Navigate to the directory you are using, select the zip file you require, and click the Open button. 5. Select the check box next to the displayed project and click the Finish button to perform the import. This task topic describes the testing of the message flow you have already constructed. In this scenario you use the integrated test client. 1. Select the SOAPInput node, press the right mouse button and select Test from the menu. 2. Enter the data you require into the test message. 3. Save the values you entered in a pool for later reuse. a. Select the Envelope data element. b. Press the right mouse button c. Select Add value to Pool d. Enter a name for the value in the text box and click OK to save the current values. 4. Select the Configuration tab in the lower left corner of the test client. 5. Select Message Flows in the left column and click Add in the right hand column. 6. Select the message flow you require in the Resources pane and click OK. 7. To deploy the message flow you have just selected when you test the new message flow: a. Select Deployment in the left hand column. b. Select the Only rebuild and deploy broker archive when changes occur radio button in the right hand column. c. Select MQ Settings in the left hand column. Review the settings and ensure the Stop testing when message reaches first output monitor check box is not selected. d. Select the Events tab to return to the main tab and click the Send Message button to initiate a test. 8. You see extra screens the first time the message flow is deployed. Use the New server button if no server has been previously defined. These instructions show the case where a server has already been defined: a. Expand the Deployment locations. b. Select the desired execution group. c. Click Finish to deploy and process the flow. A progress indicator displays and when the test is complete you see an event indicating a response was received as well as the data in the response message.
Testing the message flow using HTTP This is the third of a set of instructions on setting up your system to use the SOAP parser with WebSphere Message Broker and illustrates the testing of the message flow using HTTP.
682
Message Flows
Before you carry out this task you must deploy the message flow to the runtime environment; see “Deploying the message flows” on page 749 for further details on this procedure. This task topic describes the testing of the message flow you have already constructed. In this scenario you use a tool that uses HTTP protocol rather than WebSphere MQ. You can use any tool that has the facilities described in the following procedure. 1. Start the tool and select http://localhost:nnnn/ where nnnn is the address of the port you are using. 2. As the SOAPInput node expects a SOAPAction entry in the HTTP headers you must add one. a. press the Add New Header button b. Select the Value part of the header. Enter the value you require. c. Select New Header in the Name pane. d. Change the name from New Header to SOAPAction and press the Enter key. 3. Select Load File and go to the directory containing the XML file you want to use. 4. Select the file and press the Open button. 5. Set the URL to the host, port and selection for the deployed flow. The SOAPInput nodes listen on a different port from the HTTP nodes and the listener is built into the execution group itself rather than using a different process. If you define additional execution groups each one has a different port assigned. 6. Press the Send button to test the flow. The response appears in the right hand pane.
What is WSDL? WSDL is an XML notation for describing a Web service. A WSDL definition tells a client how to compose a Web service request and describes the interface that is provided by the Web service provider. WebSphere Message Broker supports WSDL 1.1, as defined in the following document issued by the World Wide Web Consortium (W3C): Web Services Description Language (WSDL) 1.1. WebSphere Message Broker support for WSDL also adheres to the Web Services Interoperability Organization (WS-I) Basic profile 1.1; see Web Services Interoperability Organization (WS-I). A WSDL definition is divided into separate sections that specify the logical interface and the physical details of a Web service. The physical details include both endpoint information, such as HTTP port number, and binding information, which specifies how the SOAP payload is represented and which transport is used. Support for WSDL in WebSphere Message Broker includes: v Import of WSDL to create message definitions in a message set; see Importing from WSDL. v Generation of WSDL from a message set; see WSDL generation. v WSDL editor with text and graphical design views. v Use of WSDL to configure nodes in the SOAP domain; for example, you can drag WSDL onto a node. For more details, see “Using WSDL to configure message flows” on page 686 Working with Web services
683
v Use to WSDL to create a skeleton message flow by dragging WSDL onto the message flow editor canvas. For more details, see “Using WSDL to configure message flows” on page 686. When you import or generate WSDL, the WSDL is validated against the WS-I Basic Profile. You must fix validation errors before the message set can be deployed. Validation warnings do not prevent deployment, but can indicate potential interoperability problems. The validated WSDL becomes an integral part of the message set. The WSDL editor supports a graphical design view so that you can navigate from the WSDL to its associated message definitions. The message set contains all the message definitions required by message flows that are working with the Web service described by the WSDL. At development time, the message definitions support ESQL Content Assist and the creation of mappings. At run time, the deployed message set supports schema validation in the SOAP, XMLNSC, and MRM domains. In the SOAP domain, runtime checks are also made against the WSDL itself, and WSDL information is included in the SOAP logical tree.
WSDL validation The WS-I Validator can be used to check your WSDL definitions against the Basic Profile. For more information about the WS-I Basic Profile refer to the WS-I, and in particular the WS-I Basic Profile document: v Web Services Interoperability Organization (WS-I) v WS-I deliverables index You can use the WS-I Validator to check your WSDL definitions against the Basic Profile; see “WS-I Basic Profile Version 1.1” on page 739. You can run the validator in either of the following ways: v Manually against a specific .wsdl resource in the workbench. This option enables you to investigate and fix any WS-I compliance problems; any validation issues are displayed as task list errors and warnings. v Automatically, when WSDL is imported or generated. WSDL can be imported using the WSDL Quick Start wizard, the WSDL Importer wizard, or the mqsicreatemsgdefsfromwsdl command. WSDL can be generated from a message set using the WSDL Generator wizard. You can control the behavior of the validator using Preferences > Web services > Profile Compliance and Validation. . The significant settings are: v WS-I AP compliance level (WS-I Attachments Profile 1.0) v WS-I SSBP compliance level (WS-I Simple SOAP Binding Profile 1.0) You can select one of the following values: Suggest Run the validator with errors treated as unrecoverable, but warnings only notified. This is the default setting. Require Run the validator with errors and warnings treated as unrecoverable. Ignore Do no run the validator.
684
Message Flows
Note that the AP selection applies automatically to the SSBP field, so Ignore is not explicitly selectable unless the AP selection is set to Ignore. The following terms refer to the three broad categories of WSDL definition: v document-literal means the combination style="document" and use="literal" v rpc-litera[ means the combination style="rpc" and use="literal" v rpc-encoded means the combination style="rpc" and use="encoded" Common validation problems, using the preceding terminology, are listed below: Your WSDL is rpc-encoded WSDL with use="encoded" is not WS-I compliant and can lead to operational problems because products of different vendors can make different assumptions about the expected SOAP payload. WS-I: (BP2406) The use attribute of a soapbind:body, soapbind:fault, soapbind:header, and soapbind:headerfault does not have the value of ″literal″. Your WSDL is document-literal, but one or more WSDL part definitions refer to XML Schema types. In document-literal WSDL, the SOAP body payload is the XML Schema element that is referred to by the appropriate WSDL part. If a type is specified instead of an element, the SOAP payload is potentially ambiguous (the payload name is not defined) and interoperability problems are likely. WS-I: (BP2012) A document-literal binding contains soapbind:body elements that refer to message part elements that do not have the element attribute. Your WSDL is rpc-literal or rpc-encoded, but one or more WSDL part definitions refer to XML Schema elements. In rpc-style WSDL, the SOAP body payload is the WSDL operation name, and its children are the WSDL parts that are specified for that operation. If an element is specified instead of a type, the SOAP message payload is potentially ambiguous (the payload name might be the WSDL part name or the XML Schema element name), and interoperability problems are likely. WS-I: (BP2013) An rpc-literal binding contains soapbind:body elements that refer to message part elements that do not have the type attribute. Your WSDL includes SOAP header, headerfault or fault definitions that refer to XML Schema types. In rpc-style WSDL, the SOAP body is correctly defined through XML Schema types as described above. SOAP headers and faults, however, do not correspond to an rpc function call in the same way as the body. In particular, there is no concept of ’parameters’ to a header or fault, and a header or fault must always be defined in terms of XML Schema elements to avoid potential ambiguity. Effectively, header and fault definitions in WSDL are always document-literal. WS-I: (BP2113) The soapbind:header, soapbind:headerfault, or soapbind:fault elements refer to wsd:part elements that are not defined using only the ″element″ attribute. Working with Web services
685
Your WSDL is rpc-literal or rpc-encoded, but no namespace was specified for an operation. In rpc-style WSDL, the SOAP message payload is the WSDL operation name, qualified by a namespace that is specified as part of the WSDL binding. If no namespace is specified then the SOAP message payload is potentially ambiguous (the payload name might be in no namespace, or might default to use a different namespace, such as the target namespace of the WSDL definition) and interoperability problems are likely. WS-I: (BP2020) An rpc-literal binding contains soapbind:body elements that either do not have a namespace attribute, or have a namespace attribute value that is not an absolute URI. Note that web service interoperability is improved by: v Using document-style WSDL whenever possible. v Using literal encoding, if rpc-style WSDL is necessary. v Ensuring that the WSDL operation definitions are qualified by a valid namespace attribute, if rpc-encoded WSDL must be used.
Using WSDL to configure message flows How you can use WSDL to configure message flows. Message flows working with Web services typically use the SOAP nodes. For details about the SOAP nodes, see “WebSphere Message Broker and Web services” on page 669. The SOAP nodes are configured using WSDL that was previously imported or generated in a message set, and appears under Deployable WSDL in the workbench. You can drag the WSDL onto a SOAP node, or specify it by using the WSDL file name property on the node. You must always select a specific WSDL binding. If you supply a service definition, then endpoint properties are set automatically, but you can also set or override these properties manually. WSDL definitions can optionally be split into multiple files. The typical arrangement is that a top-level service definition file imports a binding file, the binding file imports an interface file, and this interface file imports or includes schema definition files. A WSDL portType (the logical WSDL interface) is not sufficient on its own to configure a SOAP node; a specific binding is required so that the SOAP payload is well-defined at runtime. A binding defines a use, which may be document (the default) or rpc. If the use is document then the SOAP payload is described by an XML Schema element in the WSDL. If the use is rpc then the SOAP payload is the WSDL operation name in a specified namespace. Often you will want to create your own message flow and then configure the nodes as just described. However, you can create a new skeleton message flow by dragging a WSDL definition onto a blank Message Flow Editor canvas, and selecting a specific WSDL binding. You can also choose the type of flow (service provider or consumer) and the operations to be handled by the flow.
686
Message Flows
The key nodes and properties in the generated message flow are configured, but you need to complete the configuration and add any other nodes you require before deploying the flow. For details about configuring a new Web service using the wizard, see Configure New Web Service Usage wizard.
Configuring the SOAP nodes The following nodes are configured explicitly by WSDL: v “SOAPInput node” on page 1112 v “SOAPRequest node” on page 1124 v “SOAPAsyncRequest node” on page 1089 The following nodes are configured implicitly by WSDL, because they inherit the WSDL configuration of the node with which they are paired: v “SOAPReply node” on page 1122 v “SOAPAsyncResponse node” on page 1099 A SOAPReply node is always used in conjunction with a SOAPInput node. For details of Web service scenarios, see “Web services scenarios” on page 755. A SOAPAsyncResponse node is always used in conjunction with a SOAPAsyncRequest node, associated by the Unique Identifier property. For SOAP node usage patterns, see “Web services scenarios” on page 755.
What is SOAP MTOM? SOAP Message Transmission Optimization Mechanism (MTOM) is the use of MIME to optimize the bitstream transmission of SOAP messages that contain significantly large base64Binary elements. The MTOM message format allows bitstream compression of binary data. Data which would otherwise have to be encoded in the SOAP message is instead transmitted as raw binary data in a separate MIME part. A large chunk of binary data takes up less space than its encoded representation, so MTOM can reduce transmission time, although it does incur a certain amount of processing overhead. Candidate elements to be transmitted in this way are defined as base64Binary in the WSDL (XML Schema). An MTOM message is identified by a Content-Type with a type of application/xop+xml. The SOAP domain handles inbound MTOM messages automatically, any MTOM parts being automatically reincorporated into the SOAP Body. The use of outbound MTOM messages can be configured on the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes. For details, see “Using SOAP MTOM with the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes” on page 688. For details of the external specification published by the World Wide Web Consortium (W3C), see “SOAP MTOM” on page 737.
Working with Web services
687
Using SOAP MTOM with the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes The use of outbound MTOM messages can be configured on the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes. The nodes have a property called Allow MTOM which defines whether MTOM can be used. An MTOM output message is written if all of the following are true: v The Allow MTOM option is checked on the WS Extensions tab v Validation is enabled. Be aware that the Validate property on the SOAPRequest and SOAPAsyncRequest nodes controls validation of the anticipated response message and not validation of the outgoing request. MTOM output is therefore suppressed unless you set Validate to Content and value on a preceding input node or transformation node. v There are no children below SOAP.Attachment in the logical tree. If children are present, SOAP with Attachments (SwA) is used. v There are elements in the output message that are identified as base64Binary in the associated XML Schema and whose length does not fall below a default threshold size of 1000 bytes. A LocalEnvironment setting called MTOMThreshold provides you with the capability to override the MTOM element size threshold. The MTOM element size threshold is set to a default value of 1 000 bytes. The Allow MTOM node option and the MTOMThreshold can both be overridden in the LocalEnvironment. The overrides that apply at a SOAPReply node are: v LocalEnvironment.Destination.SOAP.Reply.AllowMTOM which can have a value of true or false. v LocalEnvironment.Destination.SOAP.Reply.MTOMThreshold which is an integer value in bytes. The equivalent overrides for a SOAPRequest or SOAPAsyncRequest node are: v LocalEnvironment.Destination.SOAP.Request.AllowMTOM which can have a value of true or false. v LocalEnvironment.Destination.SOAP.Request.MTOMThreshold which is an integer value in bytes.
WS-Addressing Web Services Addressing (WS-Addressing) is a Worldwide Web Consortium (W3C) specification that aids interoperability between Web services by defining a standard way to address Web services and provide addressing information in messages. Start here to find out how WebSphere Message Broker supports WS-Addressing. The WS-Addressing specification introduces two primary concepts: endpoint references, and message addressing properties. This topic contains an overview of each concept. For further details, select the following links to access the WS-Addressing specifications: v W3C WS-Addressing specifications
688
Message Flows
v W3C submission WS-Addressing specification
Endpoint references (EPRs) EPRs provide a standard mechanism to encapsulate information about specific endpoints. EPRs can be propagated to other parties and then used to target the Web service endpoint that they represent. The following table summarizes the information model for EPRs. Abstract Property name
Property type
Multiplicity
Description
[address]
xs:anyURI
1..1
The absolute URI that specifies the address of the endpoint.
[reference parameters]*
xs:any
0..unbounded
Namespace qualified element information items that are required to interact with the endpoint.
[metadata]
xs:any
0..unbounded
Description of the behavior, policies and capabilities of the endpoint.
The following prefix and corresponding namespace is used in the previous table. Prefix
Namespace
xs
http://www.w3.org/2001/XMLSchema
The following XML fragment illustrates an endpoint reference. This element references the endpoint at the URI http://example.com/fabrikam/acct, has metadata specifying the interface to which the endpoint reference refers, and has application-defined reference parameters of the http://example.com/fabrikam namespace. <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:fabrikam="http://example.com/fabrikam" xmlns:wsdli="http://www.w3.org/2005/08/wsdl-instance" wsdli:wsdlLocation="http://example.com/fabrikam http://example.com/fabrikam/fabrikam.wsdl"> <wsa:Address>http://example.com/fabrikam/acct <wsa:Metadata> <wsaw:InterfaceName>fabrikam:Inventory <wsa:ReferenceParameters> 123456789 ABCDEFG
Message addressing properties (MAPs) MAPs are a set of well defined WS-Addressing properties that can be represented as elements in SOAP headers. MAPs can provide either a standard way of conveying information, such as the endpoint to which message replies should be directed, or information about the relationship that the message has with other messages. The MAPs that are defined by the WS-Addressing specification are summarized in the following table.
Working with Web services
689
Abstract WS-Addressing MAP name
MAP content type Multiplicity
Description
[action]
xs:anyURI
1..1
An absolute URI that uniquely identifies the semantics of the message. This proprety corresponds to the [address] property of the endpoint reference to which the message is addressed. This value is required.
[destination]
xs:anyURI
1..1
The absolute URI that specifies the address of the intended receiver of this message. This value is optional because, if not present, it defaults to the anonymous URI that is defined in the specification, indicating that the address is defined by the underpinning protocol.
[reference parameters]*
xs:any
0..unbounded
Correspond to the [reference parameters] property of the endpoint reference to which the message is addressed. This value is optional.
[source endpoint]
EndpointReference 0..1
A reference to the endpoint from which the message originated. This value is optional.
[reply endpoint]
EndpointReference 0..1
An endpoint reference for the intended receiver of replies to this message. This value is optional.
[fault endpoint]
EndpointReference 0..1
An endpoint reference for the intended receiver of faults relating to this message. This value is optional.
[relationship]*
xs:anyURI plus optional attribute of type xs:anyURI
[message id]
xs:anyURI
0..unbounded
A pair of values that indicate how this message relates to another message. The content of this element conveys the [message id] of the related message. An optional attribute conveys the relationship type. This value is optional. An absolute URI that uniquely identifies the message. This value is optional.
The abstract names in the previous tables are used to refer to the MAPs throughout this documentation. The following example of a SOAP message contains WS-Addressing MAPs: <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:fabrikam="http://example.com/fabrikam"> <S:Header> ... <wsa:To>http://example.com/fabrikam/acct <wsa:ReplyTo> <wsa:Address> http://example.com/fabrikam/acct <wsa:Action>... 123456789 ABCDEFG ...
690
Message Flows
<S:Body> ...
How to use WS-Addressing An overview of how you use WS-Addressing with WebSphere Message Broker.
Sending a message to an endpoint reference (EPR) When sending a message to an endpoint reference, the following processes take place: v The [destination] Message Addressing Property (MAP) is filled in from the [address] property in the EPR. v [reference parameters] are copied to top level SOAP headers from the [reference parameters] property of the EPR. v The [action] property is required, but is not populated from the EPR. In this context, action is an absolute Internationalized Resource Identifier (IRI) that uniquely identifies the semantics implied by this message, and it must be the same as the HTTP SOAPAction if a non-empty SOAPAction is specified. v The [message id] property must be specified if this message is part of a request-response Message Exchange Pattern (MEP); the message id is generated by default. When replying with a non-fault message, the following processes take place: v The EPR to reply to is selected from the [reply endpoint] MAP. – If this property contains the special address none, no reply is sent. – If this property contains the special address anonymous, the reply is sent on the return channel of the transport on which the request was received. This is the default value in the absence of any other supplied EPR. – Otherwise, the reply is sent to the [address] property in the Reply EPR, v The [message id] property of the inbound message request is placed into the [relationship] property of the response, along with the predefined relationship of the reply part of the Universal Resource Identifier (URI) - which indicates that this message is a reply. For further information on the URI see Web Services Addressing URI Specification. v A new [message id] property is specified for the reply, and this is generated by default.
WS-Addressing with the SOAPInput node The options that are available when using WS-Addressing with the SOAPInput node. The SOAPInput node has a property for processing WS-Addressing information present in the incoming message called Use WS-Addressing. If you select this property, the WS-Addressing information is processed and the process itself is called engaging WS-Addressing. The default is that WS-Addressing is not engaged.
Working with Web services
691
You can also specify this property in the WSDL, and this is configurable from the WSDL, automatically by the workbench, when the WSDL is dropped onto the node. The behavior of the node when WS-Addressing is engaged or not engaged is as follows: Addressing not engaged No WS-Addressing processing is performed. If a message is received that contains any WS-Addressing headers they are ignored, and no WS-Addressing processing of any kind is performed, unless they are marked as MustUnderstand. The inbound WS-Addressing headers in this case are visible in the message as it leaves the SOAPInput node under the Header folder of the SOAP parser in the message tree. A fault is returned to the client if there are WS-Addressing headers in the incoming message, and they meet both of the following criteria: v Marked as MustUnderstand v Targeted at the role the SOAPInput node is operating in Engaging WS-Addressing is how you instruct the node to ’understand’ the WS-Addressing headers. In this case the WS-Addressing headers remain in the SOAP Header section of the SOAP Parser, and no other SOAP node acts upon them. In all cases, they are treated as a SOAP header with no special meaning assigned to the WS-Addressing headers. Addressing engaged: WS-Addressing processing is performed as stated in the WS-Addressing specification. This processing means that messages that contain either submission addressing headers or final addressing headers are accepted. A fault is returned if both submission addressing headers and final headers are present, and either of the following conditions is met: v Neither is marked with a role. v They are both marked with same role and the SOAPInput node is acting in that role. Assuming the WS-Addressing headers are valid and the Place WS-Addressing Headers into LocalEnvironment check box is selected on the SOAPInput node, all headers (including detectable inbound reference parameters) are removed from the inbound message tree and are placed into the LocalEnvironment tree under the SOAP.Input.WSA folder. Moving the WS-Addressing headers to the LocalEnvironment indicates that they have been processed by the broker. They are removed from the message tree because they have been processed on input; otherwise they would not be valid if the message tree was sent out without further changes. They are stored in the LocalEnvironment to allow you to inspect them. Note that only reference parameters from the final specification are detectable because they have an attribute called IsReferenceParameter that allows them to be detected. Because submission reference parameter headers do not have this attribute, they are not detectable, and therefore are not moved into the LocalEnvironment tree from the message tree. You can change WS-Addressing reply headers before the SOAPReply node is reached. For more information about changing WS-Addressing information in the LocalEnvironment, see “WS-Addressing information in the LocalEnvironment” on page 695.
692
Message Flows
WS-Addressing with the SOAPReply node The options that are available when using WS-Addressing with the SOAPReply node. The SOAPReply node uses WS-Addressing if WS-Addressing is engaged on the SOAPInput node that is referenced by the reply identifier of the message entering the reply node. The SOAPReply node uses addressing information in the Destination.SOAP.Reply.WSA folder of the LocalEnvironment to determine where to send the reply and with what Message Addressing Properties (MAPs). If the Destination.SOAP.Reply.WSA does not exist, or is completely empty, when inspected by the SOAPReply node, the node uses the default addressing headers that were part of the incoming message. This means that you do not have to propagate the LocalEnvironment in the default case, and addressing still works as expected. In the case where there are folders beneath the Reply.WSA folder, these are used to update the output message. This allows you to change, add, or remove parts of the default reply information generated by the input node, because any changes that you made to the tree are reflected in the outgoing message by the SOAPReply node. For details about WS-Addressing information in the LocalEnvironment, see “WS-Addressing information in the LocalEnvironment” on page 695. If WS-Addressing is not engaged, this node does not perform any WS-Addressing processing.
WS-Addressing with the SOAPRequest node The options that are available when using WS-Addressing with the SOAPRequest node. The SOAPRequest node has a property called Use WS-Addressing, for processing WS-Addressing information that is present in the incoming message. If you select this property, the WS-Addressing information is processed and the process itself is called engaging WS-Addressing. The default is that WS-Addressing is not engaged. You can also specify this property in the WSDL and this is configurable from the WSDL, automatically by the workbench, when the WSDL is dragged onto the node. The behavior of the node when WS-Addressing is engaged or not is as follows: Addressing not engaged The node does not add any WS-Addressing headers to the outgoing message, and does not process any WS-Addressing headers that might be present in the response message that is received by the node. Addressing engaged: The node first looks at the Destination.SOAP.Request.WSA folder in the LocalEnvironment. If this folder is empty, the node automatically generates all required WS-Addressing Message Addressing Properties (MAPs) in the outgoing message, using the following default values:
Working with Web services
693
v Action, from the WSDL configuration file. If this is not explicitly specified, this defaults to the value that is defined in the WSDL Binding specification. v To, from the Web Service URL node property. v ReplyTo, using the special Anonymous address (assuming that the Operation being used is not a one-way message exchange program, in which case a ReplyTo using the special None address is specified). v MessageID, a unique UUID is used. If the Destination.SOAP.Request.WSA folder in the LocalEnvironment is not empty, any user supplied MAPs override the default ones that were listed previously, on a property by property basis. After the response to the request is received and if the Place WS-Addressing Headers into LocalEnvironment check box is selected on the SOAPRequest node, the SOAPRequest node removes all WS-Addressing headers from the response message and places them in the SOAP.Response.WSA folder. This folder allows you to query the headers in a similar manner to the way the SOAPInput node deals with the Input WS-Addressing headers.
WS-Addressing with the SOAPAsyncRequest and SOAPAsyncResponse nodes The options that are available when using WS-Addressing with the SOAPAsyncRequest and SOAPAsyncResponse nodes. To work, the SOAPAsyncRequest and SOAPAsyncResponse nodes require WS-Addressing. Therefore the remote web service must understand WS-Addressing to correctly process the WS-Addressing headers that are sent from the SOAPAsyncRequest node, and to allow the response to be sent back to the corresponding SOAPAsyncResponse node, which is specified in the address property of the ReplyTo Message Addressing Property (MAP).
SOAPAsyncRequest node The SOAPAsyncRequest node has a property called Use WS-Addressing that is read-only and defaults to true; this informs you that WS-Addressing is mandatory for this node. This property has the effect of permanently engaging WS-Addressing for this node and cannot be changed by the node, or by the WSDL that is used to configure this node. The node first looks at the Destination.SOAP.Request.WSA folder in the LocalEnvironment. If this folder is empty, the node automatically generates all required WS-Addressing MAPs in the outgoing message, using the following defaults: v Action, from the WSDL configuration file. If this is not explicitly specified, this defaults to the value defined by the WSDL Binding specification. v To, from the Web Service URL node property. v ReplyTo, the address of the corresponding SOAPAsyncResponse node. v MessageID, a unique UUID is used.
|
If the Destination.SOAP.Request.WSA folder in the LocalEnvironment is not empty, any user supplied MAPs override the default ones listed previously on a property by property basis.
694
Message Flows
However, because of the nature of the SOAP asynchronous node pair, you cannot specify the address property of the ReplyTo Message Exchange Program (MEP), and this is ignored if specified. When the main MAPs are generated, the node looks in several places to obtain various pieces of context information to send in a <wmb:context> element under the ReferenceParameters section of the ReplyTo endpoint reference. If these locations exist and are not empty, the additional information below is added to the <wmb:context>: v Destination.SOAP.Request.UserContext This is added under a subfolder called UserContext. v Destination.SOAP.Reply.ReplyIdentifier This is added under a subfolder called ReplyID. The UserContext allows you to specify an arbitrary amount of data that will be sent along with the message from the SOAPAsyncRequest to the SOAPAsyncResponse node. This allows you to pass state from one node to the other. Be careful to ensure the amount of data that you send is small because this data is placed in the message. The ReplyIdentifer allows you to automatically correlate a SOAPInput node in the flow containing the SOAPAsyncRequest node with a SOAPReply node in the flow containing the SOAPAsyncResponse node.
SOAPAsyncResponse node After the response to the request is received, the SOAPAsyncResponse node removes all WS-Addressing headers from the response message and places them in the SOAP.Response.WSA folder. This allows you to query the headers. If the response message contains a UserContext that was specified by the SOAPAsyncRequest node, this is placed in the SOAP.Response.UserContext folder in the LocalEnvironment. If the response message contains a ReplyIdentifier that was specified by the SOAPAsyncRequest node, this is placed in the SOAP.Reply.ReplyIdentifier folder in the LocalEnvironment.
WS-Addressing information in the LocalEnvironment WS-Addressing header information can be placed in the LocalEnvironment tree where it is visible to a message flow. WS-Addressing header information is only processed by the SOAP nodes.
Inbound messages Inbound information is placed in the LocalEnvironment by the SOAP node only if addressing is engaged on the node and you select the Place WS-Addressing Headers into LocalEnvironment option on either the SOAPInput, SOAPAsyncResponse, or SOAPRequest nodes. The following table describes the node specific WS-Addressing information in the LocalEnvironment tree.
Working with Web services
695
Node
Populates LocalEnvironment property
SOAPInput
LocalEnvironment.SOAP.Input.WSA.type
SOAPAsyncResponse
LocalEnvironment.SOAP.Response.WSA.type
SOAPRequest
LocalEnvironment.SOAP.Response.WSA.type
Where type is the structure of the subsection of the LocalEnvironment WS-Addressing XML schema. For details about how type maps to the WS-Addressing properties defined by the WS-Addressing specification, see LocalEnvironment property type below. The LocalEnvironment information for inbound messages is for your information only. If you engage addressing on the node, and select the Place WS-Addressing Headers into LocalEnvironment option on the node, WS-Addressing information is available for you to look at and use in your flow. The WS-Addressing properties are placed in to the LocalEnvironment after processing by the node. Note that the WS-Addressing folder and all its children are owned by an XMLNSC parser. This allows you to copy elements directly into any other tree owned by an XMLNSC parser. However you should be aware that if you copy this folder (or any of its children) to a tree not owned by an XMLNSC parser then information in the tree will be discarded unless you create an XMLNSC parser in the target tree first. This can happen if you, for example, copy from the InputLocalEnvironment tree to the OutputLocalEnvironment tree.
Outbound messages You can place outbound WS-Addressing header information in the LocalEnvironment, however this is only necessary to override the defaults automatically generated by the node. Outbound addressing headers are only created if WS-Addressing is enabled on the node. The following table describes the node specific WS-Addressing information in the LocalEnvironment tree that can be used to override the defaults for outbound messages. Node
Populates LocalEnvironment property
SOAPReply
LocalEnvironment.Destination.SOAP.Reply.WSA.type
SOAPRequest
LocalEnvironment.Destination.SOAP.Request.WSA.type
SOAPAsyncRequest
LocalEnvironment.Destination.SOAP.Request.WSA.type
Where type is the structure of the subsection of the LocalEnvironment WS-Addressing XML schema. For details about how the type maps to the WS-Addressing properties defined by the WS-Addressing specification, see LocalEnvironment property type below. You can modify LocalEnvironment information for outbound messages. The SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes generate default LocalEnvironment settings that you can override. There is one exception to this table; any attempt to override the WS-Addressing ReplyTo address on the SOAPAsyncRequest node will be ignored.
696
Message Flows
LocalEnvironment property type The LocalEnvironment property type in the above tables corresponds to the WS-Addressing part of the LocalEnvironment XML schema. The following table shows the corresponding message addressing properties (MAPs) of the WS-Addressing LocalEnvironment schema for all nodes. Element
Corresponds to abstract WS-Addressing MAP name
To
[destination endpoint]
From
[source endpoint]
ReplyTo
[reply endpoint]
FaultTo
[fault endpoint]
Action
[action]
MessageId
[message id]
RelatesTo
[relationship]
ReferenceParameters
[reference parameters]
Version
Not a MAP, but used to identify the version of WS-Addressing. There are two main versions of WS-Addressing called Submission and Final. The default used by all nodes is Final. Therefore, for outbound messages you only need to set this element if you want the version to be Submission. For incoming messages this element is automatically populated with the version of the WS-Addressing headers the inbound message used.
For more details about the message addressing properties defined by the WS-Addressing specification, see “WS-Addressing” on page 688. In the case of outbound WS-Addressing, an additional LocalEnvironment property can be set. Element
Description
AddMustUnderstandAttribute
This places the SOAPmustUnderstand attribute on each WS-Addressing header before the message is sent.
Example use of WS-Addressing information in the local environment This example shows the setting of reference parameters in the local environment, and the corresponding messages as they appear on the wire. In this example, the Web service exposes a simple ping operation.
ESQL to add reference parameters The following ESQL example shows how to specify addressing headers in the local environment. DECLARE Example_ns NAMESPACE 'http://ibm.namespace'; SET OutputLocalEnvironment.Destination.SOAP.Request.WSA.ReplyTo.ReferenceParameters.Parameter1 = 'Message Broker'; SET OutputLocalEnvironment.Destination.SOAP.Request.WSA.ReplyTo.ReferenceParameters.Example_ns:Parameter2. (SOAP.NamespaceDecl)xmlns:Example_ns = 'http://ibm.namespace'; SET OutputLocalEnvironment.Destination.SOAP.Request.WSA.ReplyTo.ReferenceParameters.Example_ns:Parameter2 = 'Ping'; SET OutputLocalEnvironment.Destination.SOAP.Request.WSA.FaultTo.ReferenceParameters.Parameter1 = 'Ping'; Working with Web services
697
SET OutputLocalEnvironment.Destination.SOAP.Request.WSA.FaultTo.ReferenceParameters.Example_ns:Parameter2. (SOAP.NamespaceDecl)xmlns:Example_ns = 'http://ibm.namespace'; SET OutputLocalEnvironment.Destination.SOAP.Request.WSA.FaultTo.ReferenceParameters.gns:Parameter2 = 'FAULT';
Request message Below is an example of an outgoing SOAP envelope in a message from a SOAPRequest node with ReplyTo and FaultTo reference parameters generated after using the above ESQL. It also shows the other message addressing properties (MAPs) that are not set in the local environment, but are generated automatically by the node as a result of engaging WS-Addressing. <wsa:To>http://localhost:7801/Service <wsa:ReplyTo> <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous <wsa:ReferenceParameters> <Example_ns:Parameter2 xmlns:Example_ns="http://ibm.namespace">Ping <Parameter1>Message Broker <wsa:FaultTo> <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous <wsa:ReferenceParameters> <Example_ns:Parameter2 xmlns:Example_ns="http://ibm.namespace">FAULT <Parameter1>Ping <wsa:MessageID>urn:uuid:020C911C16EB130A8F1204119836321 <wsa:Action>http://ibm.com/Service/Ping
In the above example, reference parameters are set for the ReplyTo and FaultTo endpoint references (EPRs). If this message is sent to a SOAPInput node with WS-Addressing engaged, these ReferenceParameters are placed in the local environment of the flow containing the SOAPInput node for use by the flow if the Place WS-Addressing Headers into LocalEnvironment option is selected. Note that this option only changes what is placed in the local environment, it does not change the contents of the response message in any way.
Response message The following SOAP envelope is a response to the outgoing message above as sent by a SOAPReply node. This shows the MAP processing that happens automatically by the SOAPReply node. In this example, the FaultTo reference parameters are not present as the reply is not a SOAP fault. This response also shows where the reference parameters that belonged to the ReplyTo EPR appear in the response message. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/ addressing"> <soapenv:Header> <wsa:To>http://www.w3.org/2005/08/addressing/anonymous <Example_ns:Parameter2 wsa:IsReferenceParameter="true" xmlns:Example_ns="http://ibm.namespace">Ping <Parameter1 wsa:IsReferenceParameter="true">Message Broker <wsa:ReplyTo> <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous
698
Message Flows
<wsa:Action>http://ibm.com/Service/PingResponse <wsa:RelatesTo RelationshipType="http://www.w3.org/2005/08/addressing/reply"> urn:uuid:020C911C16EB130A8F1204119836321 <soapenv:Body> Ping
WS-Security Web Services Security (WS-Security) describes enhancements to SOAP messaging to provide quality of protection through message integrity, message confidentiality, and single message authentication. WS-Security mechanisms can be used to accommodate a wide variety of security models and encryption technologies. WS-Security is a message-level standard that is based on securing SOAP messages through XML digital signature, confidentiality through XML encryption, and credential propagation through security tokens. The Web services security specification defines the core facilities for protecting the integrity and confidentiality of a message and provides mechanisms for associating security-related claims with the message. WS-Security provides a general-purpose mechanism for associating security tokens with messages. No specific type of security token is required by WS-Security. It is designed to be extensible, for example, to support multiple security token formats. WS-Security also describes how to encode binary security tokens and attach them to SOAP messages. Specifically, the WS-Security profile specifications describe how to encode Username Tokens and X.509 Tokens. With WS-Security, the domain of these mechanisms can be extended by carrying authentication information in Web services requests. WS-Security also includes extensibility mechanisms that can be used to further describe the credentials that are included with a message. WS-Security is a building block that can be used in conjunction with other Web service protocols to address a wide variety of application security requirements. There are numerous advantages to using WS-Security. v Different parts of a message can be secured in a variety of ways. For example, you can use integrity on the security token (user ID and password) and confidentiality on the SOAP message body. v Intermediaries can be used and end-to-end message-level security can be provided through any number of intermediaries. v WS-Security works across multiple transports and is independent of the underlying transport protocol. v Authentication of both individual users and multiple party identities is possible. Traditional Web security mechanisms, such as HTTPS, might be insufficient to manage the security requirements of all Web service scenarios. For example, when an application sends a SOAP message using HTTPS, the message is secured only for the HTTPS connection, meaning during the transport of the message between the service requester (the client) and the service. However, the application might require that the message data be secured beyond the HTTPS connection, or even
Working with Web services
699
beyond the transport layer. By securing Web services at the message level, message-level security is capable of meeting these expanded requirements. Message-level security, or securing Web services at the message level, addresses the same security requirements as for traditional Web security. These security requirements include: identity, authentication, authorization, integrity, confidentiality, nonrepudiation, basic message exchange, and so forth. Both traditional Web and message-level security share many of the same mechanisms for handling security, including digital certificates, encryption, and digital signatures. With message-level security, the SOAP message itself either contains the information needed to secure the message or it contains information about where to get that information to handle security needs. The SOAP message also contains information relevant to the protocols and procedures for processing the specified message-level security. However, message-level security is not tied to any particular transport mechanism. Because the security information is part of the message, it is independent of a transport protocol, such as HTTPS. The client adds to the SOAP message header security information that applies to that particular message. When the message is received, the Web service endpoint, using the security information in the header, verifies the secured message and validates it against the policy. For example, the service endpoint might verify the message signature and check that the message has not been tampered with. It is possible to add signature and encryption information to the SOAP message headers, as well as other information such as security tokens for identity (for example, an X.509 certificate) that are bound to the SOAP message content. Without message-level security, the SOAP message is sent in clear text, and personal information such as a user ID or an account number is not protected. Without applying message-level security, there is only a SOAP body under the SOAP envelope in the SOAP message. By applying features from the WS-Security specification, the SOAP security header is inserted under the SOAP envelope in the SOAP message when the SOAP body is signed and encrypted. To keep the integrity or confidentiality of the message, digital signatures and encryption are typically applied. v Confidentiality specifies the confidentiality constraints that are applied to generated messages. This includes specifying which message parts within the generated message must be encrypted, and the message parts to attach encrypted Nonce and time stamp elements to. v Integrity is provided by applying a digital signature to a SOAP message. Confidentiality is applied by SOAP message encryption. You can add an authentication mechanism by inserting various types of security tokens, such as the Username token (element). When the Username token is received by the Web service server, the user name and password are extracted and verified. Only when the user name and password combination is valid, will the message be accepted and processed at the server. Using the Username token is just one of the ways of implementing authentication. This mechanism is also known as basic authentication.
700
Message Flows
The OASIS Web Services Security Specification provides a set of mechanisms to help developers of Web Services secure SOAP message exchanges. For details of the OASIS Web Services Security Specification, see OASIS Standard for WS-Security Specification.
WS-Security mechanisms The WS-Security specification provides three mechanisms for securing Web services at the message level. The three mechanisms are authentication, integrity, and confidentiality.
Authentication This mechanism uses a security token to validate the user and determine whether a client is valid in a particular context. A client can be an end user, machine, or application. Without authentication, an attacker can use spoofing techniques to send a modified SOAP message to the service provider. In authentication, a security token is inserted in the request message. Depending on the type of security token that is being used, the security token may also be inserted in the response message. These types of security tokens are supported for authentication: v Username tokens v X.509 tokens Username tokens are used to simply validate user names and passwords. When a Web service server receives a username token, the user name and password are extracted and passed to a user registry for verification. If the user name and password combination is valid, the result is returned to the server and the message is accepted and processed. When used in authentication, username tokens are typically passed only in the request message, not the response message. X.509 tokens are validated using a certificate path. Both types of tokens must be protected. For this reason, if you send them over an untrusted network, take one of the following actions: v Use HTTPS. v Configure the policy set to protect the appropriate elements in the SOAP header.
Integrity This mechanism uses message signing to ensure that information is not changed, altered, or lost in an accidental way. When integrity is implemented, an XML digital signature is generated on the contents of a SOAP message. If the message data changes illegally, the signature is not validated. Without integrity, an attacker can use tampering techniques to intercept a SOAP message between the Web service client and server and then modify it.
Confidentiality This mechanism uses message encryption to ensure that no party or process can access or disclose the information in the message. When a SOAP message is encrypted, only a service that knows the appropriate key can decrypt and read the message.
Working with Web services
701
Implementing WS-Security What you need to do to configure authentication, XML encryption and XML signature for your system. You use the Policy Sets and Policy Set Bindings editor in the workbench to configure the following aspects of WS-Security: “Authentication” “Confidentiality” “Integrity” on page 703 “Expiration” on page 703 Authentication using an external security provider. Define WS-Security tokens for use by the broker security manager; see “Message flow security and security profiles” on page 713.
Authentication Both username and X.509 tokens are supported. Configuring authentication with username tokens 1. In the workbench, switch to the Broker Administration perspective. 2. Create UserName and X.509 authentication tokens; see Policy Sets and Policy Set Bindings editor: Authentication tokens panel. 3. Further configure any X.509 authentication tokens defined in the associated policy set; see Policy Sets and Policy Set Bindings editor: Authentication and Protection Tokens panel. 4. Configure a security profile; see “Message flow security and security profiles” on page 713. 5. Associate the policy set with a message flow or node; see “Associating policy sets and bindings with message flows and nodes” on page 711. Configuring authentication with X.509 tokens 1. If you are using the broker truststore, configure the keystore and truststore; see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708 or “Viewing and setting keystore and truststore runtime properties at execution group level” on page 710 depending on where you want to set keystore and truststore runtime properties. 2. In the workbench, switch to the Broker Administration perspective. 3. Create UserName and X.509 authentication tokens; see Policy Sets and Policy Set Bindings editor: Authentication tokens panel. 4. Configure the certificate mode for either broker truststore or an external security provider; see Policy Sets and Policy Set Bindings editor: Authentication and Protection Tokens panel.
| | | | | |
5. If you are using an external security provider, configure a security profile; see “Message flow security and security profiles” on page 713. 6. Associate the policy set with a message flow or node; see “Associating policy sets and bindings with message flows and nodes” on page 711
Confidentiality Confidentiality is provided by XML encryption, and requires X.509 tokens. To configure XML encryption:
702
Message Flows
| | | | |
1. Configure the keystore and truststore; see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708 or “Viewing and setting keystore and truststore runtime properties at execution group level” on page 710 depending on where you want to set keystore and truststore runtime properties. 2. In the workbench, switch to the Broker Administration perspective. 3. Enable XML encryption, create encryption tokens, and select the encryption algorithms that you will use; see Policy Sets and Policy Set Bindings editor: Message Level Protection panel. 4. Define which parts of a message are to be encrypted; see Policy Sets and Policy Set Bindings editor: Message Part Protection panel. 5. Further configure message part encryption; see Policy Sets and Policy Set Bindings editor: Message Part Policies panel. 6. Further configure the keystore and truststore; see Policy Sets and Policy Set Bindings editor: Key Information panel. 7. Associate the policy set with a message flow or node; see “Associating policy sets and bindings with message flows and nodes” on page 711.
Integrity Integrity is provided by XML signature, and requires X.509 tokens. To configure XML signature: | | | | |
Configure the keystore and truststore; see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708 or “Viewing and setting keystore and truststore runtime properties at execution group level” on page 710 depending on where you want to set keystore and truststore runtime properties. 2. In the workbench, switch to the Broker Administration perspective. 1.
3. Enable XML signature and create signature tokens; see Policy Sets and Policy Set Bindings editor: Message Level Protection panel. 4. Define which parts of a message are to be signed; see Policy Sets and Policy Set Bindings editor: Message Part Protection panel. 5. Further configure message part signature; see Policy Sets and Policy Set Bindings editor: Message Part Policies panel. 6. Further configure the keystore and truststore; see Policy Sets and Policy Set Bindings editor: Key Information panel. 7. Associate the policy set with a message flow or node; see “Associating policy sets and bindings with message flows and nodes” on page 711.
Expiration To configure message expiration, see Policy Sets and Policy Set Bindings editor: Message Expiration panel.
Policy sets Policy sets and bindings define and configure your WS-Security requirements, supported by WebSphere Message Broker, for the SOAPInput, SOAPReply, SOAPRequest, SOAPAsyncRequest, and SOAPAsyncResponse nodes. A policy set is a container for the WS-Security policy type. A policy set binding is associated with a policy set and contains information that is specific to the environment and platform, such as information about keys. Working with Web services
703
Use policy sets and bindings to define the following items for both request and response SOAP messages: v Authentication for both UserNameToken and X.509 certificates v Asymetric encryption (confidentiality) v Asymetric signature (integrity) Either the whole SOAP message body, or specific parts of the SOAP message header and body can be encrypted and signed. You administer policy sets and bindings from the toolkit, which can add, delete, display and edit policy sets and bindings. Any changes to policy sets or bindings in the toolkit are saved directly to the associated broker. You must stop and then restart the message flow for the new configuration information to take effect. You can also export and import policy sets and bindings from a broker. v “Exporting a policy set and policy binding” on page 712 v “Importing a policy set and policy set binding” on page 712 Policy sets and their associated bindings must be saved and restored together. Policy sets are associated with a message flow, a node or both in the Broker Archive editor. For convenience, you can specify settings for provider and consumer at the message flow level. The provider setting applies to all SOAPInput and SOAPReply nodes in the message flow. The consumer setting applies to all SOAPRequest, SOAPAsyncRequest, and SOAPAsyncResponse nodes. Individual policy set and binding assignments can be applied at the node level in the Broker Archive editor, and these take precedence over the flow-level provider and consumer settings. The default setting is none, meaning that no policy set and bindings are to be used. Several nodes in the same message flow can refer to the same policy set and bindings. It is the responsibility of the administrator to ensure that the required policy sets are available to the broker at runtime. An error is reported if the broker cannot find the associated policy set or bindings. The rest of this topic describes some of the terms that you will meet when configuring policy sets and bindings.
Default policy set and bindings When a broker is created, a default policy set and bindings are created called WSS10Default. This default contains a limited security policy which specifies that a User Name Token is present in request messages (inbound) to SOAPInput nodes in the associated message flow. The default policy set binding refers to the default policy set. Neither are editable.
Consumer and provider nodes Nodes are either consumers or providers. Consumer nodes SOAPRequest SOAPAsyncRequest SOAPAsyncResponse
704
Message Flows
Provider nodes SOAPInput SOAPReply
Request and response Request and response is a message exchange pattern (MEP). It describes a client that sends a SOAP Request message to a Web services server, which in turn sends a Response SOAP message back to the client. The Request message is always the SOAP message from the client to the server, and the Response message is always the SOAP message reply from server to the client. The following table describes this pattern in relation to the WebSphere Message Broker SOAP nodes: Node
Broker viewpoint
Request
Response
SOAPInput
SOAP message inbound
Inbound message
Not applicable
SOAPReply
SOAP message outbound
Not applicable
Outbound message
SOAPRequest
SOAP message outbound followed by a SOAP message inbound
Outbound message
Inbound message
SOAPAsyncRequest
SOAP message outbound
Outbound message
Not applicable
Not applicable
Inbound message
SOAPAsyncResponse SOAP message inbound
Initiator and recipient Initiator and recipient are roles defined in the exchange of SOAP messages. Initiator The role that sends the initial message in a message exchange. Recipient The targeted role to process the initial message in a message exchange. The following table describes these roles in relation to the Message Broker SOAP nodes: Node
Broker viewpoint
Initiator
Recipient
SOAPInput
SOAP message inbound
External client sending SOAP message to the broker.
SOAPInput node
SOAPReply
SOAP message outbound
External client that SOAPReply node sent the original SOAP message to the broker.
SOAPRequest (outbound)
SOAP message outbound followed by a SOAP message inbound
SOAPRequest node
External provider receiving the SOAP message
Working with Web services
705
Node
Broker viewpoint
Initiator
Recipient
SOAPRequest (inbound)
SOAP message outbound followed by a SOAP message inbound
SOAPRequest node
External provider receiving the SOAP message
SOAPAsyncRequest
SOAP message outbound
SOAPAsyncRequest node
External provider receiving the SOAP message
SOAPAsyncResponse SOAP message inbound
SOAPAsyncRequest node
External provider receiving the SOAP message
SOAPInput and SOAPReply nodes In this diagram, the broker acts as recipient. A SOAPInput node receives a message from a client (initiator). A SOAPReply node replies. Inbound and outbound messages are signed and encrypted.
SOAPInput SOAPReply
Recipient
Initiator
Recipient Encryption Token
Private Encryption
Private
Public Signature
Recipient Encryption Token
SOAPInput Initiator Signature Token
Message Broker
Initiator Signature Token
Public
Client Initiator Encryption Token Recipient Signature Token
Private
Public Encryption
Public
Private Signature
Initiator Encryption Token
SOAPReply Recipient Signature Token
In the request: v The initiator uses the broker’s public encryption token to encrypt the message, and its own private signature token to sign it. v The broker uses its own private encryption token to decrypt the message, and the initiator’s public signature token to verify the signature. In the response:
706
Message Flows
v The broker uses the initiator’s public encryption token to encrypt the message, and its own private signature token to sign the message. v The initiator uses its own private encryption token to decrypt the message, and the broker’s public signature token to verify the signature.
SOAPRequest node This diagram shows the broker acting as an initiator. It uses the SOAPRequest node to make a synchronous request to an external provider (the recipient). Inbound and outbound messages are signed and encrypted. Use of tokens is similar to the example of the asynchronous SOAP nodes, shown earlier.
SOAPRequest
Initiator
Recipient
Message Broker
Recipient Encryption Token Initiator Signature Token
Public
Private Encryption
Private
Public Signature
Recipient Encryption Token Initiator Signature Token
Server
SOAPRequest Initiator Encryption Token Recipient Signature Token
Private
Public Encryption
Public
Private Signature
Initiator Encryption Token Recipient Signature Token
In the request: v The broker uses the recipient’s public encryption token to encrypt the message, and its own private signature token to sign the message. v The recipient uses its own private encryption token to decrypt the message, and the broker’s public signature token to verify the signature. In the response: v The recipient uses the broker’s public encryption token to encrypt the message, and its own private signature token to sign the message. v The broker uses its own private encryption token to decrypt the message, and the initiator’s public signature token to verify the signature.
Working with Web services
707
Asynchronous SOAP nodes This diagram shows the broker acting as an initiator. It uses the asynchronous SOAP nodes to make a request to an external provider (the recipient). Inbound and outbound messages are signed and encrypted.
SOAPAsyncRequest SOAPAsyncResponse
Initiator
Recipient
Recipient Encryption Token
Message Broker
SOAPAsyncRequest Initiator Signature Token
Public
Private Encryption
Private
Public Signature
Recipient Encryption Token Initiator Signature Token
Server Initiator Encryption Token
SOAPAsyncResponse Recipient Signature Token
Private
Public Encryption
Public
Private Signature
Initiator Encryption Token Recipient Signature Token
In the request: v The broker uses the recipient’s public encryption token to encrypt the message, and its own private signature token to sign the message. v The recipient uses its own private encryption token to decrypt the message, and the broker’s public signature token to verify the signature. In the response: v The recipient uses the broker’s public encryption token to encrypt the message, and its own private signature token to sign the message. v The broker uses its own private encryption token to decrypt the message, and the initiator’s public signature token to verify the signature.
Viewing and setting keystore and truststore runtime properties at broker level Configure the message broker to refer to a keystore, a truststore, or both, before deploying any message flows that require policy set or bindings for signature, encryption, or X.509 Authentication. Keystores and truststores are both keystores. They differ only in the way they are used.
708
Message Flows
Put all private keys and public key certificates (PKC) in the keystore. Put all trusted root certificate authority (CA) certificates in the truststore. These certificates are used to establish the trust of any inbound public key certificates. The only supported type of store is Java keystore (JKS). Each instance of a broker can be configured to refer to one keystore and one truststore. The following properties of the broker registry component must be defined correctly for policy sets and bindings: brokerKeystoreFile The directory and file location of the keystore. brokerTruststoreFile The directory and file location of the truststore. |
Listing existing broker registry entries:
| |
To display all broker registry values, run the command:
| | | | | | | | | | |
This returns entries like these:
|
Updating the broker reference to a keystore:
| | | |
To update the broker reference to a keystore, use the following command:
|
Where c:\keystore\server.keystore is the keystore to be referenced.
|
Updating the broker reference to a truststore:
| | | |
mqsichangeproperties broker_name -o BrokerRegistry –n brokerTruststoreFile -v c:\truststore\server.truststore
|
Where c:\truststore\server.truststore is the truststore to be referenced.
|
Updating the broker with the keystore password:
| | |
Keystores and truststores normally require passwords for access. Use the mqsisetdbparms command to add these passwords to the broker runtime component.
mqsireportproperties broker_name -o BrokerRegistry -a
BrokerRegistry='' uuid='BrokerRegistry' brokerKeystoreType='JKS' brokerKeystoreFile='' brokerKeystorePass='brokerKeystore::password' brokerTruststoreType='JKS' brokerTruststoreFile='' brokerTruststorePass='brokerTruststore::password' httpConnectorPortRange='' httpsConnectorPortRange=''
mqsichangeproperties broker_name -o BrokerRegistry –n brokerKeystoreFile -v c:\keystore\server.keystore
To update the broker reference to a truststore, use the following command:
Working with Web services
709
| | |
mqsisetdbparms broker_name -n brokerKeystore::password -u temp -p pa55word
|
The user ID, which can be any value, is not required to access the keystore.
|
Updating the broker with the truststore password:
| | | |
To update the broker with the truststore password, use the following command:
|
The user ID, which can be any value, is not required to access the keystore.
|
Updating the broker with a private key password:
| | | | | | | |
Private keys in the keystore might have their own individual passwords. These can be configured based on the alias name that is specified for the key in the Policy sets and bindings editor. If a key password based on the alias is not found, the keystore password is used. The following command updates the broker with the private key password for the key whose alias is encKey.
|
The user ID, which can be any value, is not required to access the keystore.
| | | | |
Viewing and setting keystore and truststore runtime properties at execution group level
| | | | |
An execution group is a named grouping of message flows that have been assigned to a broker. The broker enforces a degree of isolation between message flows in distinct execution groups by ensuring that they run in separate address spaces, or as unique processes. For more information about execution groups, see Execution groups.
| |
Execution group keystore and truststore runtime property values override equivalent property values on the broker, if any are set.
| | | | | |
Keystores can contain two kinds of entries: keyEntrys and trustedCertificateEntries. If a keystore is used to contain trusted certificates then it is typically referred to as a truststore. WebSphere Message Broker can refer to a keystore and a truststore per execution group. When the broker is encrypting or decrypting it uses entries in its keystore; if it is verifying a signature or performing X.509 authentication it uses entries in its truststore.
| | |
The following sample demonstrates the use of viewing and setting keystore and truststore runtime properties at execution group level: v Address Book sample
| |
You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
mqsisetdbparms broker_name -n brokerTruststore::password -u temp -p pa55word
mqsisetdbparms broker_name -n brokerTruststore::keypass::encKey -u temp -p pa55word
Configure an execution group to refer to a keystore, a truststore, or both, before deploying any message flows that require policy set or bindings for signature, encryption, or X.509 Authentication.
710
Message Flows
|
Displaying execution group level properties:
| |
To display execution group level properties, run the command:
|
Updating the broker reference to a keystore:
| | | | |
To update the broker reference to a keystore at an execution group level, use the following command:
|
Where c:\keystore\server.keystore is the keystore to be referenced.
|
Updating the broker reference to a truststore:
| | | | |
To update the broker reference to a truststore at an execution group level, use the following command: mqsichangeproperties broker_name -e execution_group -o ComIbmJVMManager –n brokerTruststoreFile -v c:\truststore\server.truststore
|
Where c:\truststore\server.truststore is the truststore to be referenced.
|
Updating the keystore and truststore passwords:
| | |
| |
The commands used to update the keystore and truststore passwords at execution group level are the same as those used when setting keystore and truststore runtime properties at broker level. v To update the broker with the keystore password; see “Updating the broker with the keystore password” on page 709. v To update the broker with the truststore password; see “Updating the broker with the truststore password” on page 710.
| |
v To update the broker with a private key password; see “Updating the broker with a private key password” on page 710.
| |
mqsireportproperties broker_name -o ComIbmJVMManager -a -e execution_group
mqsichangeproperties broker_name -e execution_group -o ComIbmJVMManager –n brokerKeystoreFile -v c:\keystore\server.keystore
Associating policy sets and bindings with message flows and nodes Use the Broker Archive editor to associate policy sets and bindings with message flows and nodes, so that they are available to the broker at runtime. Before you start Use the Policy Sets and Policy Set Bindings editor to create and configure policy sets and bindings. Associations can be made between policy sets and message flow, or specific nodes. Associations made with a flow apply to all nodes described in the Policy Set and Bindings file. Associations at the flow level are defined as being either for consumer or provider nodes. An association at the node level overrides any association made at the flow level. You do not enter information about consumer or provider for an association at node level. Working with Web services
711
In the workbench, switch to the Broker Administration perspective. Open the BAR file in the Broker Archive editor. Click the Manage and Configure tab. Click the message flow or node that you want to associate with a policy set and binding. The properties that you can configure for the message flow or for the node are displayed in the Properties view. 5. If you are configuring a message flow, enter values in the following fields in the Properties view, as appropriate: Provider Policy Set Bindings Provider Policy Set Consumer Policy Set Bindings Consumer Policy Set 1. 2. 3. 4.
|
6. If you are configuring a node, enter values in the following fields in the Properties view: Policy Set Policy Set Bindings For new associations to take effect, the BAR file must be redeployed and the message flows stopped and restarted.
Exporting a policy set and policy binding Use the mqsireportproperties command to export a policy set and associated binding to a file. This topic shows how to export policy set myPolicySet from broker myBroker to a file called myPolicySet.xml. The associated binding is myPolicySetBinding, which you export to myPolicySetBinding.xml. 1. Export the policy set to a file: mqsireportproperties myBroker -c PolicySets -o myPolicySet -n ws-security -p myPolicySet.xml
2. Export the policy set binding to a file: mqsireportproperties myBroker -c PolicySetBindings -o myPolicySetBinding -n ws-security -p myPolicySetBinding.xml
Make a note of the policy set that is associated to the binding; you will need this information when you import the policy set and binding. This command displays the policy set associated with a binding: mqsireportproperties myBroker -c PolicySetBindings -o myPolicySetBinding -n associatedPolicySet
This displays: PolicySetBindings myPolicySetBinding BIP8071I: Successful command completion.
associatedPolicySet='myPolicySet'
Importing a policy set and policy set binding Use the mqsichangeproperties command to import a policy set and associated binding. This topic shows how to import policy set myPolicySet to broker myBroker from a file called myPolicySet.xml. The associated binding is myPolicySetBinding, which you import from myPolicySetBinding.xml. 1. Create a configurable service for the policy set, if one does not already exist. mqsicreateconfigurableservice myBroker -c PolicySets -o myPolicySet BIP8071I: Successful command completion.
712
Message Flows
2. Create a configurable service for the policy set binding, if one does not already exist. mqsicreateconfigurableservice myBroker -c PolicySetBindings -o myPolicySetBinding BIP8071I: Successful command completion.
3. Import the policy set. mqsichangeproperties myBroker -c PolicySets -o myPolicySet -n ws-security -p myPolicySet.xml
4. Import the policy set binding. mqsichangeproperties myBroker -c PolicySetBindings -o myPolicySetBinding -n ws-security -p myPolicySetBinding.xml
5. Change the value of the associatedPolicySet attribute. Set it to the name of the policy set with which this policy set binding was originally associated. mqsichangeproperties myBroker -c PolicySetBindings -o myPolicySetBinding -n associatedPolicySet -v myPolicySet
Message flow security and security profiles This topic describes message flow security and security profiles. WebSphere Message Broker provides a Security Manager for implementing message flow security so that end-to-end processing of a message through a message flow is secured based on an identity carried in that message instance. The Security Manager enables access to message flows to be controlled per message and includes the ability to: v Extract the identity from an inbound message. v Authenticate an inbound message using an external security provider. v Map the identity to an alternative identity using an external security provider. v Check that the alternative identity or the original identity is authorized to access the message flow using an external security provider. v Propagate the inbound or alternative identity. For details of the supported external providers and the operation of the Security Manager, see Message flow security. When the message flow is a Web service implemented using “SOAP nodes” on page 675 and the identity is to be taken from the “WS-Security” on page 699 SOAP headers, the SOAP nodes are the Policy Enforcement Point (PEP) and the external provider defined by the Security profiles is the Policy Decision Point (PDP). The following configuration is required to implement message flow security based on an identity carried in WS_Security tokens. v “Policy sets” on page 703 define the type of tokens used for the identity. – For working with a Username and Password identity, configure the policy and binding for Username token “Authentication” on page 702. – For working with a X.509 Certificate identity, configure the policy and binding for X.509 certificate token “Authentication” on page 702. In the Policy Set Binding, set the X.509 certificate Authentication Token certificates mode to Trust Any. You set it this way (and not to Trust Store) so that the certificate is passed to the security provider defined by the Security Profile. Setting it to Trust Store will cause the certificate to be validated in the local Broker Trust Store. For more details, see Policy Sets and Policy Set Bindings editor: Authentication and Protection Tokens panel. Working with Web services
713
v The message flow security operation and external provider are defined by the Security profiles For WS-Security Signing and Encryption the local broker, the truststore must be configured. For details, see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708. Additionally the broker truststore can be used as a local PDP for X.509 Certificate Authentication, as an alternative to message flow security and an external PDP. For details, see Policy Sets and Policy Set Bindings editor: Authentication and Protection Tokens panel.
WS-Security capabilities This topic explains Web service security capabilities supported by the broker. Web service security mechanisms are defined by OASIS standards. See OASIS Standard for WS-Security Specification For information about the Username Token Profile and X.509 Certificate Token Profile standards, see: v OASIS Web Services Security Username Token Profile v OASIS Web Services Security X.509 Certificate Token Profile For details of broker capabilities using the username token profile, see “Username token capabilities” For details of using the X.509 certificate token profile, see “X.509 certificate token capabilities” on page 716
Username token capabilities This topic describes WS-Security username token capabilities of the broker. For details of using WS-Security username token, see the following capabilities: v “Username token capabilities for encryption, decryption, signing, and verifying” v “Username token capabilities for authentication and authorization” v “Username token capabilities for identity mapping” on page 715 v “Username token capabilities for extraction and propagation” on page 716 Username token capabilities for encryption, decryption, signing, and verifying: This topic describes broker Web services capability for encryption, decryption, signing, and verifying using username tokens. The username token is not applicable, or supported, for the following in any configuration or direction: v Encryption v Decryption v Signing v Verifying Username token capabilities for authentication and authorization:
714
Message Flows
This topic describes broker Web services capability for authentication, authorization, or both using a username token. The username token “Authentication” on page 701 and Authorization is supported only in the following configuration: Capability v Authenticate v Authorize Policy Enforcement Point (PEP) and direction v In (provider) “SOAPInput node” on page 1112 Configured with a security policy and binding which defines that a username token is present for authentication; see “Authentication” on page 702. You can use the default policy and binding WSS10Default; see “Default policy set and bindings” on page 704. Configured with a security profile defining the Policy Decision Point (PDP); see the PDP section that follows. Trust Store or PDP v LDAP Configured using an LDAP security profile specifying authentication, authorization, or both; see Creating a security profile for LDAP. v TFIM Configured using an TFIM security profile specifying authentication, authorization or both; see Creating a security profile for TFIM. Username token capabilities for identity mapping: This topic describes broker Web services capability for identity mapping using a username token. Identity mapping from a username identity token to a mapped username identity token is supported only in the following configurations: Capability v Identity mapping Policy Enforcement Point (PEP) and direction v In (provider) “SOAPInput node” on page 1112 Configured with a security policy and binding which defines that a username taken is present. You can use the default policy and binding WSS10Default; see “Default policy set and bindings” on page 704. Configured with a security profile defining the external Policy Decision Point (PDP); see the PDP section that follows. Trust store or PDP v TFIM Configured using a TFIM security profile specifying identity mapping; see Creating a security profile for TFIM. Working with Web services
715
Username token capabilities for extraction and propagation: This topic describes broker capability for extraction, propagation, or both using a username token in Web services. The extraction of username into the Properties folder source Identity fields, is supported in the following configurations: Capability v Extraction Policy Enforcement Point (PEP) and direction v In (provider) “SOAPInput node” on page 1112 Configured with a security policy and binding which defines that a username taken is present. You can use the default policy and binding WSS10Default; see “Default policy set and bindings” on page 704. Configured with a security profile that defines propagation; see Creating a security profile The propagation of a username token into the SOAP WS-Security header, from the token present in either the mapped or the source identity fields in the properties folder, is supported in the following configuration. See Identity. Capability v Propagate Policy Enforcement Point (PEP) and direction v Out (consumer) “SOAPRequest node” on page 1124 “SOAPAsyncRequest node” on page 1089 Configured with a security profile that defines propagation; for example, Default Propagation. See Security profiles
X.509 certificate token capabilities This topic describes the broker capabilities for the WS-Services Security X.509 certificate token profile standards. For details of using the X.509 certificates, see the following capabilities: v “X.509 certificate token capabilities for encryption” v “X.509 certificate token capabilities for decryption” on page 717 v “X.509 certificate token capabilities for signing” on page 717 v “X.509 certificate token capabilities for verifying” on page 718 v “X.509 certificate token capabilities for authentication” on page 718 v “X.509 certificate token capabilities for authorization” on page 719 v “X.509 certificate token capabilities for identity mapping” on page 719 v “X.509 certificate token capabilities for extraction and propagation” on page 720 X.509 certificate token capabilities for encryption: This topic describes broker Web services capability for encryption using an X.509 certificate token.
716
Message Flows
X.509 certificate token encryption for providing message “Confidentiality” on page 701 on outgoing SOAP messages from the broker is supported in the following configurations: Capability v Encrypt (Using partner public key) Policy Enforcement Point (PEP) and direction v Out (consumer) “SOAPRequest node” on page 1124 “SOAPAsyncRequest node” on page 1089 v Out (provider) “SOAPReply node” on page 1122 Configured with a policy set and binding defining the message “Confidentiality” on page 702. Trust Store or Policy Decision Point (PDP) v Broker Truststore. For more details see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708 Encryption is not supported with external PDPs such as TFIM or LDAP. X.509 certificate token capabilities for decryption: This topic describes broker Web services capability for decryption using an X.509 certificate token. X.509 certificate token decryption for incoming SOAP message “Confidentiality” on page 701 is supported in the following configurations: Capability v Decrypt (Using broker private key) Policy Enforcement Point (PEP) and direction. v In (provider) “SOAPInput node” on page 1112 v In (consumer) “SOAPRequest node” on page 1124 “SOAPAsyncResponse node” on page 1099 Configured with a policy set and binding defining the message “Confidentiality” on page 702. Trust Store or Policy Decision Point (PDP). v Broker Truststore. For details see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708 Decryption is not supported with external PDPs such as TFIM or LDAP. X.509 certificate token capabilities for signing: This topic describes broker Web services capability for signing using an X.509 certificate token. Working with Web services
717
X.509 certificate token signing for outgoing SOAP message “Integrity” on page 701 is supported in the following configurations: Capability v Sign (using broker private key) Policy Enforcement Point (PEP) and direction v Out (consumer) “SOAPRequest node” on page 1124 “SOAPAsyncRequest node” on page 1089 v Out (provider) “SOAPReply node” on page 1122 Configured with a policy set and binding defining the message “Integrity” on page 703 Trust Store or Policy Decision Point (PDP) v Broker Truststore. For details see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708 Signing is not supported with an external PDP such as TFIM or LDAP. X.509 certificate token capabilities for verifying: This topic describes broker Web services capability for verifying a signing using an X.509 certificate token profile. X.509 certificate token verification of the “Integrity” on page 701 of a signed incoming SOAP message is supported in the following configurations: Capability v Verify signature (using partner public key) Policy Enforcement Point (PEP) and direction v In (provider) “SOAPInput node” on page 1112 v In (consumer) “SOAPRequest node” on page 1124 “SOAPAsyncResponse node” on page 1099 Configured with a policy set and binding defining the message “Integrity” on page 703 Trust Store or Policy Decision Point (PDP) v Broker Trust store. For details, see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708 Signature verification is not supported with an external PDP such as TFIM or LDAP. X.509 certificate token capabilities for authentication: This topic describes broker Web services capability for authentication using an X.509 certificate token.
718
Message Flows
The X.509 certificate token “Authentication” on page 701 of an incoming SOAP message is supported in the following configurations: Capability v Authenticate Policy Enforcement Point (PEP) and direction v In (provider) “SOAPInput node” on page 1112 Configured with a policy set and binding defining the certificate “Authentication” on page 702. Optionally configured with a security profile defining an external Policy Decision Point (PDP); see the PDP section that follows. Trust Store or PDP v Broker Trust store. For details, see “Viewing and setting keystore and truststore runtime properties at broker level” on page 708 v TFIM Configured using a TFIM security profile specifying authentication. For details, see Creating a security profile for TFIM. Certificate authentication with an external LDAP PDP is not supported. X.509 certificate token capabilities for authorization: This topic describes broker Web services capability for authorization using an X.509 certificate token. The X.509 certificate token profile Authorization for access to a SOAP message flow is supported in the following configurations: Capability v Authorize Policy Enforcement Point (PEP) and direction v In (provider) “SOAPInput node” on page 1112 Configured with a policy set and binding defining the certificate “Authentication” on page 702. Configured with a security profile defining an external Policy Decision Point (PDP); see the PDP section that follows. Trust Store or PDP v TFIM Configured using a TFIM security profile specifying authorization. For details, see Creating a security profile for TFIM Certificate authorization with an external LDAP PDP is not supported. X.509 certificate token capabilities for identity mapping: This topic describes broker Web services capability for identity mapping using an X.509 certificate token. Working with Web services
719
The broker supports Identity mapping from an X.509 certificate token in an incoming SOAP message header to username tokens in the following configurations: Capability v Identity mapping Policy Enforcement Point (PEP) and direction v In (provider) “SOAPInput node” on page 1112 Configured with a policy set and binding defining the certificate “Authentication” on page 702. Configured with a security profile defining an external Policy Decision Point (PDP); see the PDP section that follows. Trust Store or PDP v TFIM Configured using a TFIM security profile specifying identity mapping. For details, see Creating a security profile for TFIM. Identity mapping is not supported with LDAP, or at outbound nodes. Username tokens only can be propagated. X.509 certificate token capabilities for extraction and propagation: This topic describes broker Web services capability for extraction and propagation X.509 certificate token. The broker does not support propagation of an X.509 certificate. The X.509 certificate token extraction is supported in the following configurations: Capability v Extraction Policy Enforcement Point (PEP) and direction v In (provider) “SOAPInput node” on page 1112 Configured with a policy set and binding defining the X.509 certificate is present; see “Implementing WS-Security” on page 702. Configured with a security profile defining propagation; see the Security profiles.
WebSphere Service Registry and Repository The WebSphere Service Registry and Repository (WSRR) is a central repository of documents describing services, service interfaces (for example, SOAP over HTTP), and associated policies that control access mechanisms (for example, WS-Policy documents associated with either of the previous two). The WebSphere Service Registry and Repository allows a message flow to dynamically retrieve artefacts from the WebSphere Service Registry and Repository
720
Message Flows
at run time, and to use and expose those artefacts within the message flow. Therefore deferring the decision about which artefacts you want to use until run time, rather than making the decision at deployment time. Generic XML documents, WSDL, SCDL, and all other formats that are supported by the WebSphere Service Registry and Repository, can be stored in the WebSphere Service Registry and Repository. However, some queries that you might submit to the WebSphere Service Registry and Repository might only apply to certain document types, for example, a query for a port type can only be applied to WSDL documents. Use the WebSphere Service Registry and Repository nodes (the EndpointLookup and RegistryLookup nodes) to create message flows that use the WebSphere Service Registry and Repository, and to retrieve artefacts dynamically from the WebSphere Service Registry and Repository according to the search criteria provided either on the node, or dynamically within the LocalEnvironment. Thus allowing the succeeding nodes to use the information retrieved from the WebSphere Service Registry and Repository. Important: WebSphere Message Broker V6.1.0.2 only supports WebSphere Service Registry and Repository V6.1. Previous versions of the product are not supported. The topics in this section provide further information about working with the WebSphere Service Registry and Repository: v “Configuration parameters for the WebSphere Service Registry and Repository nodes” v “Displaying the configuration parameters for the WebSphere Service Registry and Repository nodes” on page 723 v “Changing the configuration parameters for the WebSphere Service Registry and Repository nodes” on page 724 v “Accessing a secure WebSphere Service Registry and Repository” on page 724 v “Caching artefacts from the WebSphere Service Registry and Repository” on page 727 – “Configuring the cache loading options” on page 728 – “Setting up Cache Notification” on page 730 v “The LocalEnvironment” on page 731 – “Dynamically defining the search criteria” on page 732 – “EndpointLookup node” on page 867 – “EndpointLookup node output” on page 733 – “RegistryLookup node” on page 1052 – “RegistryLookup node output” on page 735
Configuration parameters for the WebSphere Service Registry and Repository nodes These parameters affect the brokers configuration when interfacing with WebSphere Service Registry and Repository (WSRR). The following table describes the parameters for Base Configuration that are configured by using the mqsichangeproperties command.
Working with Web services
721
Configuration Setting Name
Default value
Description
endpointAddress
http://host.name:9080 /WSRRCoreSDO/services/ WSRRCoreSDOPort
Location or endpoint of the WSRR server. Where host.name is variable.
The following table describes the parameters for Cache that are configured by using the mqsichangeproperties command. Configuration Setting Name
Default value
Description
needCache
True
Enable WebSphere Message Broker WSRR cache.
timeout
10000000
The timeout value for the cache. The cache expiry time in milliseconds. (The default value of 10000000 milliseconds is approximately 166 minutes).
The following table describes the parameters for Cache Notification that are configured by using the mqsichangeproperties command. Configuration Setting Name
Default value
Description
enableCacheNotification
False
Enable WebSphere Message Broker WSRR Cache Notification.
predefinedCacheQueries
″ (two single quotation marks)
List of semicolon-separated queries with which to initialize the WebSphere Message Broker WSRR cache. This query is defined by the WSRR query language.
refreshQueriesAfterNotification
True
When a notification is received from WSRR, if refreshQueriesAfterNotification is set to True the cache is updated with the new version of the object immediately; if False, the cache will be updated on the next request.
connectionFactoryName
jms/SRConnectionFactory
The name of the WSRR WebSphere Application Server JMS provider JMS connection factory for Cache Notification.
initialContextFactory
com.ibm.websphere.naming. WsnInitialContextFactory
The name of the WSRR WebSphere Application Server JMS provider JMS context factory for Cache Notification.
locationJNDIBinding
iiop://host.name:2809/
The URL to the WebSphere Application Server JMS provider JNDI bindings. Where host.name is variable.
subscriptionTopic
jms/SuccessTopic
The topic name used to receive WebSphere Application Server JMS provider Cache Notification.
The following table describes the parameters for Security that are configured by using the mqsisetdbparms command.
722
Message Flows
Configuration Setting Name
Default value
Description
Userid
None
The user name used to access the secure WebSphere Application Server.
Password
None
The password to used access the secure WebSphere Application Server.
brokerKeystorePass
None
The SSL configuration for the key password.
brokerTruststorePass
None
The SSL configuration for the trust password.
The following table describes the parameters for Security that are configured by using the mqsichangeproperties command. Configuration Setting Name
Default value
Description
brokerKeystoreFile
None
The SSL configuration for the file path to the ClientKeyFile.
brokerTruststoreFile
None
The SSL configuration for the file path to the ClientTrustFile.
Displaying the configuration parameters for the WebSphere Service Registry and Repository nodes Use the mqsireportproperties command to display all of the configuration parameters of the default WebSphere Service Registry and Repository (WSRR) profile, DefaultWSRR. The DefaultWSRR is a Service Registries configurable service that is supplied for each broker, see Configurable services properties. To display the configuration parameters of the default WebSphere Service Registry and Repository profile DefaultWSRR, complete the following steps: 1. Ensure that the broker is running. If it is not, use the mqsistart command to start it. 2. Enter the following command (where WBRK_BROKER is the name of your broker): mqsireportproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -r
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -r specifies that all property values of the object are displayed, including the child values if appropriate. The command produces a response similar to this: ReportableEntityName='' ServiceRegistries DefaultWSRR='' connectionFactoryName = 'jms/SRConnectionFactory' enableCacheNotification = 'false' endpointAddress = 'http://localhost:9080/WSRRCoreSDO/services/WSRRCoreSDOPort' initialContextFactory = 'com.ibm.websphere.naming.WsnInitialContextFactory' locationJNDIBinding = 'iiop://localhost:2809/' needCache = 'true'
Working with Web services
723
predefinedCacheQueries = '' refreshQueriesAfterNotification = 'true' subscriptionTopic = 'jms/SuccessTopic' timeout = '10000000'
Changing the configuration parameters for the WebSphere Service Registry and Repository nodes Use the mqsichangeproperties command to change the configuration parameters of the default WebSphere Service Registry and Repository (WSRR) profile DefaultWSRR. For details about configuration parameters that affect WebSphere Service Registry and Repository use, see “Configuration parameters for the WebSphere Service Registry and Repository nodes” on page 721. To update the default WebSphere Service Registry and Repository profile DefaultWSRR with a new endpointAddress value, and, if required, a new cache timeout value, complete the following steps: 1. Ensure that the broker is running. If it is not, use the mqsistart command to start it. 2. Enter the following command to change the endpointAddress value and point to your WebSphere Service Registry and Repository server: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n endpointAddress -v http://localhost:9080/WSRRCoreSDO/services/WSRRCoreSDOPort
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, endpointAddress) -v specifies the values of properties defined by the -n parameter (in this case, http://localhost:9080/WSRRCoreSDO/services/WSRRCoreSDOPort) 3. (Optional) Enter the following command to change the timeout value: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n timeout -v 10000000
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, timeout) -v specifies the values of properties defined by the -n parameter (in this case, 10000000) 4. Restart the broker, by using the mqsistop command to stop the broker, followed by the mqsistart command to start it.
Accessing a secure WebSphere Service Registry and Repository To access a secure WebSphere Service Registry and Repository, you must set the configuration parameters by using the mqsichangeproperties command.
724
Message Flows
You must connect over HTTPS, not HTTP. For more information about the configuration parameters, see “Configuration parameters for the WebSphere Service Registry and Repository nodes” on page 721. To access a secure WebSphere Service Registry and Repository, enter the following sequence of commands: 1. Ensure that the broker is running. If it is not, use the mqsistart command to start it. 2. Display the configuration parameters of the BrokerRegistry by using the following command: mqsireportproperties WBRK_BROKER -o BrokerRegistry -r
where: -o specifies the name of the object (in this case, BrokerRegistry) -r specifies that all property values of the object are displayed, including the child values if appropriate. 3. Change the endpointAddress configuration parameters for the DefaultWSRR of the ServiceRegistries configurable service by using the following command: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n endpointAddress -v https://localhost:9443/WSRRCoreSDO/services/WSRRCoreSDOPort
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, endpointAddress) -v specifies the values of properties defined by the -n parameter (in this case, https://localhost:9443/WSRRCoreSDO/services/WSRRCoreSDOPort) 4. Change the brokerKeystoreFile configuration parameters for the BrokerRegistry by using the following command: mqsichangeproperties WBRK_BROKER -o BrokerRegistry -n brokerKeystoreFile -v C:\WSRR\SSL\DummyClientKeyFile.jks
where: -o specifies the name of the object (in this case, BrokerRegistry) -n specifies the names of the properties to be changed (in this case, brokerKeystoreFile) -v specifies the values of properties defined by the -n parameter (in this case, C:\WSRR\SSL\DummyClientKeyFile.jks) 5. Change the brokerTruststoreFile configuration parameters for the BrokerRegistry by using the following command: mqsichangeproperties WBRK_BROKER -o BrokerRegistry -n brokerTruststoreFile -v C:\WSRR\SSL\DummyClientTrustFile.jks
where: -o specifies the name of the object (in this case, BrokerRegistry) -n specifies the names of the properties to be changed Working with Web services
725
(in this case, brokerTruststoreFile) -v specifies the values of properties defined by the -n parameter (in this case, C:\WSRR\SSL\DummyClientTrustFile.jks) 6. Stop the broker by using the mqsistop command. 7. Set the WebSphere Application Server user name and password by using the following command: mqsisetdbparms WBRK_BROKER -n DefaultWSRR::WSRR -u wasuser -p waspass
where: -n specifies the name of the data source (in this case, DefaultWSRR::WSRR) -u specifies the user ID to be associated with this data source (in this case, wasuser) -p specifies the password to be associated with this data source (in this case, waspass) 8. Set the brokerKeystore user name and password by using the following command: mqsisetdbparms WBRK_BROKER -n brokerKeystore::password -u dummy -p WebAS
where: -n specifies the name of the data source (in this case, brokerKeystore::password) -u specifies the user ID to be associated with this data source (in this case, dummy) -p specifies the password to be associated with this data source (in this case, WebAS) 9. Set the brokerTrustStore user name and password by using the following command: mqsisetdbparms WBRK_BROKER -n brokerTruststore::password -u dummy -p WebAS
where: -n specifies the name of the data source (in this case, brokerTruststore::password) -u specifies the user ID to be associated with this data source (in this case, dummy) -p specifies the password to be associated with this data source (in this case, WebAS) 10. If you are connecting to a secure WebSphere Application Server you must use a user ID and password. To set the user ID and password follow these steps: a. Stop the broker by using the mqsistop command. b. Issue the mqsisetdbparms command to set up your user ID and password. For example:
| | | | | | |
mqsisetdbparms WBRK_BROKER -n jms::DefaultWSRR@jms/SRConnectionFactory -u <userid> -p <password>
|
where:
| | |
-n specifies the name of the data source (in this case, jms::DefaultWSRR@jms/SRConnectionFactory) -u specifies the user ID to be associated with this data source
726
Message Flows
| | |
(in this case, <userid>) -p specifies the password to be associated with this data source (in this case, <password>)
|
11. Restart the broker by using the mqsistop command to stop the broker, followed by the mqsistart command to start it.
Caching artefacts from the WebSphere Service Registry and Repository An internal cache is used to store query strings, and their associated documents, that are retrieved from the WebSphere Service Registry and Repository. A query does not have to be submitted to the WebSphere Service Registry and Repository for every message that passes through one of the WebSphere Service Registry and Repository nodes because the documents or artefacts can be cached and retrieved locally, therefore improving performance and message throughput. The WebSphere Service Registry and Repository cache is configured individually for each broker. You can configure the loading strategy for the WebSphere Service Registry and Repository cache by using the pre-defined Service Registries configurable service; see Configurable services properties. Use the mqsichangeproperties command to update these values. Configuring the cache is optional and does not have to be enabled for the WebSphere Service Registry and Repository nodes (the EndpointLookup and RegistryLookup nodes) to function.
Caching data You can cache the data that you retrieve from the WebSphere Service Registry and Repository in the following ways: v No Cache. Every time a message goes through a WebSphere Service Registry and Repository node the broker goes to the WebSphere Service Registry and Repository to retrieve the documents that are stored within the WebSphere Service Registry and Repository. The WebSphere Service Registry and Repository nodes can retrieve and store the documents within the LocalEnvironment for the message tree. v Cache Timeout. This option is enabled as the default. Configure this option using the needCache and timeout parameters. If needCache is set to true, the broker retrieves the documents from the WebSphere Service Registry and Repository the first time the message flows through a WebSphere Service Registry and Repository node and stores the documents in an internal cache. The next time the message goes through the flow, the documents are retrieved from the cache, not the WebSphere Service Registry and Repository. This option improves performance. If the Cache Timeout interval is exceeded, the broker marks its internal cache data as not valid and refreshes the documents from the WebSphere Service Registry and Repository the next time a message passes through the WebSphere Service Registry and Repository node. If the Cache Timeout interval is exceeded for a given artefact it forces the WebSphere Service Registry and Repository node to submit the query directly to the WebSphere Service Registry and Repository, allowing the current artefact to be retrieved, inserted into the cache, and then propagated within the message tree of the LocalEnvironment. v Cache Notification. Instead of using the timeout value to invalidate artefacts after a given period of time, the broker can be configured to use Cache Working with Web services
727
Notification. Cache Notification allows the cache to subscribe to events occurring within the WebSphere Service Registry and Repository, for example, when a document or artefact is updated or deleted. When these events are received by the cache, the cache can immediately invalidate, update, or both invalidate and update, the documents and artefacts within the cache, therefore allowing the cache to always contain an up-to-date copy of the artefact or document. Configure this option using the enableCacheNotification parameter if you want to be notified every time the WebSphere Service Registry and Repository is updated. Set enableCacheNotification to true to tell the broker to subscribe to the publish/subscribe topic.
Cache loading strategy The cache loading strategy determines how and when content from the WebSphere Service Registry and Repository is retrieved and subsequently stored in the cache. The cache loading strategy is set by using the predefinedCacheQueries broker property. Three options for loading can be specified: v No Load. The cache is not used. All queries are sent to the WebSphere Service Registry and Repository for processing and none of the results obtained are cached. This behavior is the default behavior when needCache is set to false. v Lazy Load. The cache stores documents from the WebSphere Service Registry and Repository when it is queried for the first time by a client. Thereafter the documents are stored in the cache and returned from the cache when subsequent queries for the same documents occur. The documents are retained in the cache until the documents are no longer valid. This behavior is the default behavior when needCache is set to true. v Preload. The cache stores documents from the WebSphere Service Registry and Repository before it is queried by a client. The predefinedCacheQueries broker property controls the documents that are preinstalled by specifying the classification, or the set of classifications, to which the documents belong. The documents are retained in the cache until the documents are no longer valid. To configure the cache loading options, see “Configuring the cache loading options.” Configuring the cache loading options: Set the cache loading options for the cache loading strategy for the WebSphere Service Registry and Repository. The cache loading strategy is set by using the predefinedCacheQueries broker property. The cache loading options are: v No Load v Lazy Load v Preload To configure the cache loading option that you require complete the steps for the option that you require: v To specify No Load: 1. Ensure that the broker is running. If it is not, use the mqsistart command to start it. 2. Set the needCache configuration parameters for the DefaultWSRR of the Service Registries configurable service by using the following command:
728
Message Flows
mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n needCache -v false
where:
3. v To 1. 2.
-c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, needCache) -v specifies the values of properties defined by the -n parameter (in this case, false) Restart the broker by using the mqsistop command to stop the broker, followed by the mqsistart command to start it. specify Lazy Load: Ensure that the broker is running. If it is not, use the mqsistart command to start it. Ensure that needCache is set to true (the default) in the broker properties. To display the configuration parameters, see “Displaying the configuration parameters for the WebSphere Service Registry and Repository nodes” on page 723. If needCache is not set to true, set the needCache configuration parameters for the DefaultWSRR of the Service Registries configurable service by using the following command: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n needCache -v true
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, needCache) -v specifies the values of properties defined by the -n parameter (in this case, true) 3. Set the predefinedCacheQueries configuration parameters for the DefaultWSRR of the Service Registries configurable service to be blank by using the following command: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n predefinedCacheQueries -v ""
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, predefinedCacheQueries) -v specifies the values of properties defined by the -n parameter (in this case, "" [two quotation marks]) 4. Restart the broker by using the mqsistop command to stop the broker, followed by the mqsistart command to start it. v To specify Preload: 1. Ensure that the broker is running. If it is not, use the mqsistart command to start it.
Working with Web services
729
2. Ensure that needCache is set to true (the default) in the broker properties. To display the configuration parameters, see “Displaying the configuration parameters for the WebSphere Service Registry and Repository nodes” on page 723. If needCache is not set to true, set the needCache configuration parameters for the DefaultWSRR of the Service Registries configurable service by using the following command: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n needCache -v true
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, needCache) -v specifies the values of properties defined by the -n parameter (in this case, true) 3. To specify the WebSphere Service Registry and Repository entities that are preinstalled, choose the predefinedCacheQueries value that is needed to load the required entities. mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n predefinedCacheQueries -v <WSRR details>
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, predefinedCacheQueries) -v specifies the values of properties defined by the -n parameter (in this case, <WSRR details>) For example: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n predefinedCacheQueries -v "/WSRR/WSDLService/ports[binding/portType [@name='DemoCustomer' and @namespace='http://demo.sr.eis.ibm.com']]"
4. Restart the broker by using the mqsistop command to stop the broker, followed by the mqsistart command to start it.
Setting up Cache Notification WebSphere Service Registry and Repository publishes notification events by using WebSphere Application Server. Cache Notification allows the cache to subscribe to events occurring within WebSphere Service Registry and Repository, for example, when a document or artefact is updated or deleted. When these events are received by the cache, the cache can immediately invalidate, update, or both invalidate and update, the documents and artefacts within the cache, therefore allowing the cache to always contain an up-to-date copy of the artefact or document. Configure this option using the enableCacheNotification parameter if you want to be notified every time the WebSphere Service Registry and Repository is updated. Set enableCacheNotification to true to tell the broker to subscribe to the publish/subscribe topic.
730
Message Flows
To enable Cache Notification complete the following steps to change the relevant broker properties, and to add a user ID and password if you are connecting to a secure WebSphere Application Server: 1. Ensure that the broker is running. If it is not, use the mqsistart command to start it. 2. Issue the mqsichangeproperties command to change the enableCacheNotification property to true. For example: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n enableCacheNotification -v true
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, enableCacheNotification) -v specifies the values of properties defined by the -n parameter (in this case, true) 3. Issue the mqsichangeproperties command to change the locationJNDIBinding property to the value that you require. For example: mqsichangeproperties WBRK_BROKER -c ServiceRegistries -o DefaultWSRR -n locationJNDIBinding -v iiop://localhost.hursley.ibm.com:2809/
where: -c specifies the configurable service (in this case, ServiceRegistries) -o specifies the name of the object (in this case, DefaultWSRR) -n specifies the names of the properties to be changed (in this case, locationJNDIBinding) -v specifies the values of properties defined by the -n parameter (in this case, iiop://localhost.hursley.ibm.com:2809/) 4. If you are connecting to a secure WebSphere Application Server you must use a user ID and password. To set the user ID and password follow these steps: a. Stop the broker by using the mqsistop command. b. Issue the mqsisetdbparms command to set up your user ID and password. For example: mqsisetdbparms WBRK_BROKER -n jms::DefaultWSRR@jms/SRConnectionFactory -u <userid> -p <password>
where: -n specifies the name of the data source (in this case, jms::DefaultWSRR@jms/SRConnectionFactory) -u specifies the user ID to be associated with this data source (in this case, <userid>) -p specifies the password to be associated with this data source (in this case, <password>) c. Restart the broker by using the mqsistop command to stop the broker, followed by the mqsistart command to start it.
The LocalEnvironment The LocalEnvironment is used for passing messages into the WebSphere Service Registry and Repository nodes and it is also updated by the WebSphere Service Working with Web services
731
Registry and Repository nodes. The WebSphere Service Registry and Repository nodes do not change the body of the message, but the LocalEnvironment is updated to reflect the search results. The LocalEnvironment is used within the WebSphere Service Registry and Repository nodes for overriding the properties and search criteria that is defined on the nodes themselves. You can, therefore, dynamically update or change the search criteria that is used by the WebSphere Service Registry and Repository nodes to query the WebSphere Service Registry and Repository. The LocalEnvironment is also updated when the message tree is propagated from of one of the output terminals of the WebSphere Service Registry and Repository nodes where the required artefacts or endpoint references (depending upon the node being used) are placed within the LocalEnvironment of the message tree. The following topics tell you more about using the LocalEnvironment with the WebSphere Service Registry and Repository: v “Dynamically defining the search criteria” v “EndpointLookup node” on page 867 v “EndpointLookup node output” on page 733 v “RegistryLookup node” on page 1052 v “RegistryLookup node output” on page 735
Dynamically defining the search criteria You can use the RegistryLookup and EndpointLookup nodes to accept queries specified in the local environment. The local environment overrides the search criteria properties that are set on the preceding WebSphere Service Registry and Repository node. Use the EndpointLookup node to define a query dynamically in the message. Both the EndpointLookup and the RegistryLookup nodes can accept a query specified in the local environment. All of the values in the local environment are treated as strings. Unlike the User Properties that are defined on the EndpointLookup and RegistryLookup nodes, XPath and ESQL expressions are not supported when overriding the properties from the local environment. If you use the local environment to override the properties that are set in the preceding node, you can define the properties at run time, or while a message is being processed, rather than defining them at development time. If you set the properties using the local environment, the properties and search criteria that are defined on the node are overridden. You must set at least one of the properties on the preceding node for the Name, Namespace, or Version property, otherwise the flow cannot be deployed. You can define the following properties in the local environment: LocalEnvironment.ServiceRegistryLookupProperties.Name LocalEnvironment.ServiceRegistryLookupProperties.Namespace LocalEnvironment.ServiceRegistryLookupProperties.Version LocalEnvironment.ServiceRegistryLookupProperties.Template LocalEnvironment.ServiceRegistryLookupProperties.MatchPolicy LocalEnvironment.ServiceRegistryLookupProperties.UserProperties. LocalEnvironment.ServiceRegistryLookupProperties.Classification
732
Message Flows
The following code is an alternative representation of the properties of the local environment: LocalEnvironment ServiceRegistryLookupProperties = ( Name = 'xyz' Namespace = 'xyz' Version = 'xyz' Template = 'xyz' [Only valid for the RegistryLookup node, this property will be ignored by the EndpointLookup node] MatchPolicy = "One" or "All" UserProperties = ( = 'xyz' [repeat as many time as required] Classification = 'xyz' [repeat as many time as required] ))
The following code is an example of how to define a single Classification in the local environment: SET OutputLocalEnvironment.ServiceRegistryLookupProperties.Classification
The following code is an example of how to define more than one Classification in the local environment: SET OutputLocalEnvironment.ServiceRegistryLookupProperties.Classification[1] SET OutputLocalEnvironment.ServiceRegistryLookupProperties.Classification[2]
The following code is an example of how to use the User Properties and Classification properties: LocalEnvironment ServiceRegistryLookupProperties = ( Name = 'DemoCustomer' Namespace = 'http://mb.sr.eis.ibm.com' Version = '1.0' UserProperties = ( WSRRencoding= 'DEFAULT' Classification = 'http://localhost:9081/DemoCustomerWeb/services/DemoCustomer2' ))
Repeating values of the User Properties property are appended to the current User Properties value that is defined in the RegistryLookup or EndpointLookup node unless the value is NULL, in which case the User Properties value is removed. For the Classification property, repeating values are always appended; you cannot remove a value that is set in the WebSphere Service Registry and Repository node properties. The local environment tree structure is independent of the node that you are using. However, LocalEnvironment.ServiceRegistryLookupProperties.Template is supported on the RegistryLookup node only.
EndpointLookup node output Use an EndpointLookup node to set the endpoint address when the destination is either a SOAPRequest, SOAPAsyncRequest, or HTTPRequest node. When you use the EndpointLookup node, the endpoint reference and the associated metadata matching the required search criteria is stored within the LocalEnvironment. The actual message is not changed by the EndpointLookup node, although the LocalEnvironment is updated to reflect the search results.
Working with Web services
733
EndpointLookup node output if the Match Policy property is set to One If the Match Policy property of the node is set to One then the node also inserts the endpoint reference into LocalEnvironment.Destination.SOAP.Request.Transport.HTTP.WebServiceURL and LocalEnvironment.Destination.HTTP.RequestURL. These settings override the Web service URL property of the SOAPRequest, SOAPAsyncRequest, and HTTPRequest nodes allowing a dynamic call to a Web service provider. The LocalEnvironment tree is populated with output that is compatible with the SOAPRequest, SOAPAsyncRequest, or HTTPRequest nodes at the same time. Therefore, no configuration is required on the EndpointLookup node to propagate to a SOAPRequest, SOAPAsyncRequest, or HTTPRequest node. The LocalEnvironment.Destination.SOAP and LocalEnvironment.Destination.HTTP properties are used to override the properties of the SOAPRequest, SOAPAsyncRequest, and HTTPRequest nodes, which allows the EndpointLookup node, when Match Policy is set to One, to be followed immediately by a SOAPRequest, SOAPAsyncRequest, or HTTPRequest node. The properties of this request node are set at runtime. See “Populating Destination in the LocalEnvironment tree” on page 337. The following example shows typical output from the EndpointLookup node when the Match Policy is set to One. <SOAP> <WebServiceURL>http://localhost:9081/DemoCustomerWeb/ services/DemoCustomer http://localhost:9081/DemoCustomerWeb/ services/DemoCustomer <ServiceRegistry> <Endpoint> http://localhost:9081/DemoCustomerWeb/ services/DemoCustomer DemoCustomer http://demo.sr.eis.ibm.com 1.0 policy RM country China http://eis.ibm.com/ServiceRegistry/
734
Message Flows
GenericObjecttypes#Routing
EndpointLookup node output if the Match Policy property is set to All The following example shows typical output from the EndpointLookup node when the Match Policy is set to All. (Other entries might exist in the LocalEnvironment depending on previous processing within the flow.) <ServiceRegistry> <Endpoint> http://localhost:9081/DemoCustomerWeb/ services/DemoCustomer DemoCustomer http://demo.sr.eis.ibm.com 1.0 policy RM country China http://eis.ibm.com/ServiceRegistry/ GenericObjecttypes#Routing <Endpoint> http://localhost:9081/DemoCustomerWeb/ services/DemoCustomer2 DemoCustomer2
RegistryLookup node output Use the RegistryLookup node to retrieve any type of entity stored within the WebSphere Service Registry and Repository. When you use this node, the entire entity matching the required search criteria is stored within the LocalEnvironment. The actual message is not changed by the RegistryLookup node, although, the LocalEnvironment is updated to reflect the search results. When the Match Policy property value is set to One you get one arbitrary result, which might not be the most up-to-date result. You must, therefore, set the Match Policy property value to All. The following example shows typical output from the RegistryLookup node when the Match Policy property value is set to All. <ServiceRegistry> <Entity> <sdo:PolicyDocument> db281cdb-e3d3-431b.bc68.1880de18688d RMAssertionPolicy http://mb.sr.eis.ibm.com Working with Web services
735
1.0.0 UNAUTHENTICATED 1186669896155 1182369015417 UNAUTHENTICATED <wsp:Policy wsr:Id="RMAssertion" TargetNamespace="http://mb.sr.eis.ibm.com"> RMAssertion.xml http://www.ibm.com/xmlsn/prod/serviceregistry/6/0/ governance/DefaultLifecycle#InitialState1 <userDefinedProperties> grade Gold <userDefinedProperties> WSRRencoding DEFAULT <Entity> <sdo:PolicyDocument2> db281cdb-e3d3-431b.bc68.1880de18688e RMAssertionPolicy2 ServiceRegistry>
External standards WebSphere Message Broker support for Web services conforms to a number of industry standards and specifications. This section contains the topics that describe the WebSphere Message Broker support for web services. v “SOAP 1.1 and 1.2” v “SOAP with Attachments” on page 737 v “SOAP MTOM” on page 737 v v v v v v v v
“WSDL Version 1.1” on page 738 “WS-I Simple SOAP Binding Profile Version 1.0” on page 738 “WS-I Basic Profile Version 1.1” on page 739 “WSDL 1.1 Binding Extension for SOAP 1.2” on page 739 “XML-Binary Optimised Packaging (XOP)” on page 739 “SOAP Binding for MTOM 1.0” on page 740 “Web Services Security: SOAP Message Security” on page 740 “XML Encryption Syntax and Processing” on page 741
v “XML-Signature Syntax and Processing” on page 741 v “WebSphere Message Broker compliance with Web services standards” on page 741
SOAP 1.1 and 1.2 SOAP is a lightweight, XML-based, protocol for exchange of information in a decentralized, distributed environment. The protocol consists of three parts: v An envelope that defines a framework for describing what is in a message and how to process it. v A set of encoding rules for expressing instances of application-defined data types.
736
Message Flows
v A convention for representing remote procedure calls and responses. SOAP can be used with other protocols, such as HTTP. The specifications for SOAP are published by the World Wide Web Consortium (W3C). v World Wide Web Consortium (W3C) The specification for SOAP 1.1 is described in: v Simple Object Access Protocol 1.1 This specification has not been endorsed by the W3C, but forms the basis for the SOAP 1.2 specification. The specification for SOAP 1.1 expands the SOAP acronym to Simple Object Access Protocol. SOAP 1.2 is a W3C recommendation and is published in two parts: v Part 1: Messaging Framework. v Part 2: Adjuncts. The specification also includes a primer that is intended to provide a tutorial on the features of the SOAP Version 1.2 specification, including usage scenarios. The specification for SOAP 1.2 does not expand the acronym. The primer is published at: v SOAP 1.2 Primer
SOAP with Attachments SOAP with Attachments (SwA) allows you to use SOAP 1.1 or SOAP 1.2 messages wrapped by MIME. The SOAP with Attachments (SwA) specification is published as a formal submission by the World Wide Web Consortium (W3C): v World Wide Web Consortium (W3C) SwA uses the following specifications, described at: v http://www.w3.org/TR/2000/NOTE-SOAP-attachments-20001211 v http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html
SOAP MTOM SOAP Message Transmission Optimization Mechanism (MTOM) is one of a related pair of specifications that define conceptually how to optimize the transmission and format of a SOAP message. MTOM defines: v How to optimize the transmission of base64binary data in SOAP messages in abstract terms v How to implement optimized MIME multipart serialization of SOAP messages in a binding independent way using XOP The implementation of MTOM relies on the related XML-binary Optimized Packaging (XOP) specification. Because these two specifications are so closely linked, they are normally referred to as MTOM/XOP.
Working with Web services
737
The specification is published by the World Wide Web Consortium (W3C) as a W3C Recommendation at SOAP Message Transmission Optimization Mechanism. For further information refer to the following links: v World Wide web Consortium (W3C) v SOAP Message Transmission Optimization Mechanism
WSDL Version 1.1 Web Services Description Language (WSDL) is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete end points are combined into abstract endpoints (services). WSDL is extensible to allow the description of endpoints and their messages regardless of what message formats or network protocols are used to communicate. The WSDL 1.1 specification only defines bindings that describe how to use WSDL in conjunction with: v v v v
SOAP 1.1 HTTP GET HTTP POST MIME
The specification for WSDL 1.1 is published by the World Wide Web Consortium (W3C) as a W3C Note at WSDL Version 1.1. v World Wide Web Consortium (W3C) v WSDL Version 1.1
WS-I Simple SOAP Binding Profile Version 1.0 WS-I Simple SOAP Binding Profile Version 1.0 (SSBP 1.0) is a set of non-proprietary Web services specifications, along with clarifications and amendments to those specifications which promote interoperability. The SSBP 1.0 is derived from the WS-I Basic Profile 1.0 requirements that relate to the serialization of the envelope and its representation in the message. WS-I Basic Profile 1.0 is split into two separately published profiles. These profiles are: v WS-I Basic Profile Version 1.1 v WS-I Simple SOAP Binding Profile Version 1.0 Together these two profiles supersede the WS-I Basic Profile Version 1.0. The specification for SSBP 1.0 is published by the Web Services Interoperability Organization (WS-I): v Web Services Interoperability Organization (WS-I) The specification for SSBP 1.0 can be found at: v WS-I Simple SOAP Binding Profile Version 1.0
738
Message Flows
WS-I Basic Profile Version 1.1 WS-I Basic Profile Version 1.1 (WS-I BP 1.1) is a set of non-proprietary Web services specifications, along with clarifications and amendments to those specifications, which together promote interoperability between different implementations of Web services. The WS-I BP 1.1 is derived from Basic Profile Version 1.0 by incorporating its published errata and separating out the requirements that relate to the serialization of envelopes and their representation in messages. These requirements are now part of the Simple SOAP Binding Profile Version 1.0. To summarize, the WS-I Basic Profile Version 1.0 is split into two separately published profiles. These profiles are: v WS-I Basic Profile Version 1.1 v WS-I Simple SOAP Binding Profile Version 1.0 Together these two profiles supersede the WS-I Basic Profile Version 1.0. The reason for this separation is to enable the Basic Profile 1.1 to be composed with any profile that specifies envelope serialization, including the Simple SOAP Binding Profile 1.0. The specification for WS-I BP 1.1 is published by the Web Services Interoperability Organization (WS-I): v Web Services Interoperability Organization (WS-I) The specification for WS-I BP 1.1 can be found at: v WS-I Basic Profile Version 1.1
WSDL 1.1 Binding Extension for SOAP 1.2 WSDL 1.1 Binding Extension for SOAP 1.2 is a specification that defines the binding extensions that are required to indicate that Web service messages are bound to the SOAP 1.2 protocol. The aim of this specification is to provide functionality that is comparable with the binding for SOAP 1.1. This specification is published as a formal submission request by the World Wide Web Consortium (W3C): v World Wide Web Consortium (W3C) The WSDL 1.1 Binding Extension for SOAP 1.2 specification is described at: v http://www.w3.org/Submission/wsdl11soap12/
XML-Binary Optimised Packaging (XOP) XML-binary Optimized Packaging (XOP) is one of a related pair of specifications that define how to efficiently serialize XML Infosets that have certain types of content. XOP defines how to efficiently serialize XML Infosets that have certain types of content by: v Packaging the XML in some format. This is called the XOP package. The specification mentions MIME Multipart/Related but does not limit it to this format. Working with Web services
739
v Re-encoding all or part of base64binary content to reduce its size. v Placing the base64binary content elsewhere in the package and replacing the encoded content with XML that references it. XOP is used as an implementation of the MTOM specification, which defines the optimization of SOAP messages. Because these two specifications are so closely linked, they are normally referred to as MTOM/XOP. The specification is published by the World Wide Web Consortium (W3C) as a W3C Recommendation XML-binary Optimized Packaging (XOP): v World Wide Web Consortium (W3C) v XML-binary Optimized Packaging (XOP)
SOAP Binding for MTOM 1.0 SOAP 1.1 Binding for MTOM 1.0 is a specification that describes how to use the SOAP Message Transmission Optimization Mechanism (MTOM) and XML-binary Optimized Packaging (XOP) specifications with SOAP 1.1. This specification defines the minimum changes required to enable MTOM and XOP to be used interoperably with SOAP 1.1 and to reuse the SOAP 1.2 MTOM/XOP implementation. The SOAP 1.1 Binding for MTOM 1.0 specification is published as a formal submission by the World Wide Web Consortium (W3C): v World Wide Web Consortium (W3C) The SOAP 1.1 Binding for MTOM 1.0 specification is described at: v http://www.w3.org/Submission/soap11mtom10/
Web Services Security: SOAP Message Security Web Services Security (WSS): SOAP Message Security is a set of enhancements to SOAP messaging that provides message integrity and confidentiality. WSS: SOAP Message Security is extensible, and can accommodate a variety of security models and encryption technologies. WSS: SOAP Message Security provides three main mechanisms that can be used independently or together: v The ability to send security tokens as part of a message, and for associating the security tokens with message content v The ability to protect the contents of a message from unauthorized and undetected modification (message integrity) v The ability to protect the contents of a message from unauthorized disclosure (message confidentiality). WSS: SOAP Message Security can be used in conjunction with other Web service extensions and application-specific protocols to satisfy a variety of security requirements. The specification is published by the Organization for the Advancement of Structures Standards (OASIS). The specification is called Web Services Security: SOAP Message Security 1.0 (WS-Security 2004). v Organization for the Advancement of Structured Information Standards (OASIS) v Web Services Security: SOAP Message Security 1.0 (WS-Security 2004)
740
Message Flows
XML Encryption Syntax and Processing XML Encryption Syntax and Processing specifies a process for encrypting data and representing the result in XML. The data can be arbitrary data (including an XML document), an XML element, or XML element content. The result of encrypting data is an XML Encryption element that contains or references the cipher data. XML Encryption Syntax and Processing is a recommendation of the World Wide Web Consortium (W3C): v World Wide Web Consortium (W3C) The XML Encryption Syntax and Processing recommendation is published at: v XML Encryption Syntax and Processing
XML-Signature Syntax and Processing XML-Signature Syntax and Processing specifies the processing rules and syntax for XML digital signatures. XML digital signatures provide integrity, message authentication, and signer authentication services for data of any type, whether located within the XML that includes the signature or elsewhere. The recommendation for XML-Signature Syntax and Processing is published by the World Wide Web Consortium (W3C): v World Wide Web Consortium (W3C) The XML-Signature Syntax and Processing recommendation is published at: v XML-Signature Syntax and Processing
WebSphere Message Broker compliance with Web services standards WebSphere Message Broker complies with the supported Web services standards and specifications, in that you can generate and deploy Web services that are compliant. However, WebSphere Message Broker does not enforce this compliancy. For example, in the case of support for the WS-I Basic Profile 1.1 specification, you can apply additional qualities of service to your Web service that might break the interoperability outlined in this Profile. The topics in this section describe how WebSphere Message Broker complies with Web services standards. v “How WebSphere Message Broker complies with Web Service Security specifications”
How WebSphere Message Broker complies with Web Service Security specifications WebSphere Message Broker conditionally complies with Web Services Security: SOAP Message Security and related specifications by supporting the following aspects.
Compliance with Web Services Security: SOAP Message Security Security header The <wsse:Security> header provides a mechanism, in the form of a SOAP Working with Web services
741
actor or role, for attaching security-related information that is targeted at a specific recipient. The recipient can be the ultimate recipient of the message or an intermediary. The following attributes are supported in WebSphere Message Broker: v S11:actor (for an intermediary) v S11:mustUnderstand v S12:role (for an intermediary) v S12:mustUnderstand Security tokens The following security tokens are supported in the security header: v User name and password v Binary security token (X.509 certificate) Token references A security token conveys a set of claims. Sometimes these claims reside elsewhere and need to be accessed by the receiving application. The <wsse:SecurityTokenReference> element provides an extensible mechanism for referencing security tokens. The following mechanisms are supported: v Direct reference v Key identifier v Key name v Embedded reference Signature algorithms This specification builds on XML Signature and therefore has the same algorithm requirements as those specified in the XML Signature specification. WebSphere Message Broker supports the signature algorithms as shown in the following table: Algorithm type Algorithm
URI
Digest
SHA1
http://www.w3.org/2000/09/ xmldsig#sha1
Signature
DSA with SHA1 (validation only)
http://www.w3.org/2000/09/ xmldsig#dsa-sha1
Signature
RSA with SHA1
http://www.w3.org/2000/09/ xmldsig#rsa-sha1
Canonicalization Exclusive XML canonicalization (without comments)
http://www.w3.org/2001/10/xmlexc-c14n#
Signature signed parts WebSphere Message Broker allows the following SOAP elements to be signed: v The SOAP message body v The identity token (a type of security token) that is used as an asserted identity Encryption algorithms The data encryption algorithms that are supported are shown in the following table:
742
Message Flows
Algorithm
URI
Triple Data Encryption Standard algorithm (Triple DES)
http://www.w3.org/2001/04/ xmlenc#tripledes-cbc
Advanced Encryption Standard (AES) algorithm with a key length of 128 bits
http://www.w3.org/2001/04/xmlenc#aes128cbc
Advanced Encryption Standard (AES) algorithm with a key length of 192 bits
http://www.w3.org/2001/04/xmlenc#aes192cbc
Advanced Encryption Standard (AES) algorithm with a key length of 256 bits
http://www.w3.org/2001/04/xmlenc#aes256cbc
The key encryption algorithm that is supported is shown in the following table: Algorithm
URI
Key transport (public key cryptography) RSA Version 1.5
http://www.w3.org/2001/04/xmlenc#rsa-1_5
Encryption message parts WebSphere Message Broker allow the following SOAP elements to be encrypted: v The SOAP body Timestamp The <wsu:Timestamp> element provides a mechanism for expressing the creation and expiration times of the security semantics in a message. WebSphere Message Broker tolerates the use of timestamps within the Web services security header on inbound SOAP messages. Error handling WebSphere Message Broker generates SOAP fault messages using the standard list of response codes listed in the specification.
Compliance with Web Services Security: UsernameToken Profile 1.0 The following aspects of this specification are supported: Password types Text Token references Direct reference
Compliance with Web Services Security: X.509 Certificate Token Profile 1.0 The following aspects of this specification are supported: Token types v X.509 Version 3: Single certificate. v X.509 Version 3: X509PKIPathv1 without certificate revocation lists (CRL). v X.509 Version 3: PKCS7 with or without CRLs. The IBM software development kit (SDK) supports both. The Sun Java Development Kit (JDK) supports PKCS7 without CRL only.
Working with Web services
743
For more information refer to:http://docs.oasis-open.org/wss/2004/01/ oasis-200401-wss-x509-token-profile-1.0.pdf Token references v Key identifier - subject key identifier v Direct reference v Custom reference - issuer name and serial number
Aspects that are not supported The following items are not supported in WebSphere Message Broker: v Validation of Timestamps for freshness. v Nonces. v Web services security for SOAP attachments. v Security Assertion Markup Language (SAML) token profile, WS-SecurityKerberos token profile, and XrML token profile. v Web Services Interoperability (WS-I) Basic Security Profile. v XML enveloping digital signature. v XML enveloping digital encryption. v The following transport algorithms for digital signatures: – XSLT: http://www.w3.org/TR/1999/REC-xslt-19991116. – SOAP Message Normalization. For more information, refer to http://www.w3.org/TR/2003/NOTE-soap12-n11n-20031008. v The Diffie-Hellman key agreement algorithm for encryption. For more information, refer to http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/ Overview.html#sec-DHKeyValue. v The following canonicalization algorithm for encryption, which is optional in the XML encryption specification: – Canonical XML with or without comments – Exclusive XML canonicalization with or without comments v The digest password type in the Username Token Version 1.0 Profile specification.
Message flows for Web services Message flows that need to work with Web services can use either the SOAP domain or one of the XML domains. The following topics describe both types of flow. v “SOAP domain message flows” v “XML domain message flows” on page 751 The following topic describes fundamental scenarios. Any use of WS-Addressing or WS-Security requires use of the SOAP domain, but otherwise these scenarios apply to both types of message flow. v “Web services scenarios” on page 755
SOAP domain message flows SOAP domain message flows use SOAP nodes, WSDL, and a common logical tree format which is independent of the exact format of the Web service message.
744
Message Flows
The following nodes are provided for use in the SOAP domain: v “SOAPInput node” on page 1112 v “SOAPReply node” on page 1122 v “SOAPRequest node” on page 1124 v “SOAPAsyncRequest node” on page 1089 v “SOAPAsyncResponse node” on page 1099 The following nodes can also be used to simplify SOAP payload processing within a message flow; these nodes are not specific to the SOAP domain. v “SOAPEnvelope node” on page 1104 v “SOAPExtract node” on page 1107 The SOAP nodes are used together in the following basic patterns: v As a Web service provider, for example:
v As a Web service consumer, for example:
Or:
v As a Web service facade, for example, by combining the provider and consumer scenarios:
You can use the SOAPExtract and SOAPEnvelope nodes in conjunction with these patterns to respectively extract the SOAP payload and rebuild a SOAP envelope. The main SOAP domain nodes are configured by WSDL, and a prerequisite for a SOAP domain message flow is a message set containing deployable WSDL. To create a message set containing deployable WSDL, either import existing WSDL or generate WSDL from an existing message set. For more information about creating a new message definition from WSDL, see Importing from WSDL. For more information about generating WSDL from an existing message set, see WSDL generation. Working with Web services
745
Alternatively you can create a new message set and skeleton message flow in one step using the procedure described in “Creating an application based on WSDL or XSD files” on page 154. The WSDL then appears in the workbench under Deployable WSDL below the message set, although if you have selected Hide Categories on the message set, the category heading itself is not shown. Deployable WSDL can then be used to configure SOAP nodes. You can do this by dragging the WSDL resource onto the node or by selecting the required WSDL resource from the node properties. Alternatively a new skeleton message flow can be created by dragging and dropping the WSDL on to a blank message flow editor canvas. The WSDL is deployed with your completed message flow, enabling the broker to raise exceptions if a Web service message does not correspond to the specified WSDL description. The SOAP domain uses a common logical tree format which is independent of the exact format of the Web service message. For details of the SOAP tree format, see “SOAP tree overview” on page 88. Useful WSDL information is included in the logical tree under SOAP.Context.
Example usage of WS-Addressing The steps you need to set up a sample message flow using WS-Addressing, with WebSphere Message Broker, and test the flow. The following set of topics takes you through the process of setting up: 1. A main message flow that includes various SOAP nodes, a Filter node, and a Mapping node. See “Building the main message flow” 2. A logging message flow, so that you can send a reply to an address different from the originating client. See “Building the logger message flow” on page 748. 3. How you deploy the message flows. See “Deploying the message flows” on page 749. 4. How you test the message flows, using a tool that uses HTTP; this illustrates that the contents of the SOAP message determine where the replies are routed. See “Testing the message flows” on page 750. Building the main message flow: You can construct a sample main message flow to use with WS-Addressing. These steps are the first in a set of instructions on setting up your system to use WS-Addressing with WebSphere Message Broker; they explain how to set up a message flow to use this feature. This topic describes how to construct a sample main message flow when using WS-Addressing. 1. Switch to the Broker Application Development perspective. 2. Create message flow and message set projects using the Start from WSDL and/or XSD files wizard. See “Creating an application based on WSDL or XSD files” on page 154 for instructions. 3. Select the WSDL file that you need under Deployable WSDL from the Active Working Set:
746
Message Flows
a. Drag the mouse pointer to the message flow editor. b. Release the left mouse button. The Configure New Web Service Usage wizard starts. c. See “Creating an application using the Configure New Web Service Usage wizard” on page 157 for further information. Ensure that you select: v Expose message flow as web service on page one of the wizard. v SOAP nodes on page two of the wizard. When you select Finish a skeleton message flow is generated, consisting of the following nodes: v SOAPInput node that is pre-configured for the web service v SOAPExtract node to remove the SOAP envelope from the incoming message v SOAPReply node 4. Select the Construction folder on the message flow palette to display the contents. 5. Select a Trace node and move the mouse to the right of the SOAPExtract node. a. Click the left mouse button to add the node to the message flow. The name is selected automatically. b. Press Enter to accept the default name. c. Wire the submitPORequest terminal of the SOAPExtract node to the In terminal of the Trace node. 6. Select the Trace node to display the properties. a. Use the menu to set Destination to File b. Set the File path that you require. c. Enter the Pattern that you require. 7. Expand the Routing folder on the palette and select Filter. 8. Add the Filter node to the right of the Trace node. a. Type the name for the node that you require and press Enter. b. Wire the Out terminal of the Trace node to the In terminal of the Filter node. 9. Select the Filter node to display the properties. a. Enter the Data source name that you require. b. Change the name of Filter expression to the name that you selected for the Filter node. c. Clear the Throw exception on database error check box. 10. Double-click the Filter node to open the ESQL editor. Create or change the ESQL for the node; for more information, see “Creating ESQL for a node” on page 296 and “Modifying ESQL for a node” on page 299. 11. Expand the Transformation folder on the palette and select a Mapping node. 12. Add the Mapping node to the right of the Filter node. a. Type the name for the node that you require and press Enter. b. Wire the True terminal of the Filter node to the In terminal of the Mapping node. c. Wire the Out terminal of the Mapping node to the In terminal of the Reply node. 13. Select the Mapping node to display the properties, and change the name of Mapping routine to the name that you selected for the Mapping node. Working with Web services
747
14. Double-click the Mapping node to open the mapping editor. a. Select submitPORequest as the map source. b. Select SOAP_Domain_msg as the map target. c. Click OK d. Click OK on the tip that displays to open the mapping editor. See “Creating a message map file from a Mapping node” on page 526 for further information. 15. Select Properties in both the source and target pane, right-click, and click Map by Name. a. Map the source properties to the target properties using drag-and-drop mapping. The Map by Name dialog box appears. b. Click OK to perform the mapping. 16. Expand SOAP_Domain_Msg, then Body and message items in the target pane. 17. Right-click Wildcard Message in the target pane, and click Create new Submap. a. Expand Wildcard. b. Scroll down and click submitPOResponse. c. Click OK to create the submap. 18. Use drag-and-drop mapping to select the items that you need in the Source pane. 19. Select the first item that you need in the Target pane, right-click, and Enter Expression. Enter the value that you require in the expression editor and press Enter to complete the mapping. Repeat the above steps for all the items that you require in the Target pane, and save the submap and map by pressing Ctrl+S. 20. Expand the Construction folder on the message flow editor and select a Throw node. 21. Add the Throw node above the Mapping node a. Type the name for the node that you require and press Enter. b. Wire the False and Unknown terminals of the Filter node to the In terminal of the Throw node. 22. Select the Throw node and, in the Node Properties pane, enter the text that you require in Message text. 23. Select the SOAPInput node to display the Node Properties. a. Select the WS Extensions tab. b. Select Use WS-Addressing . 24. Save the message flow. Building the logger message flow: This is the second of a set of instructions on setting up your system to use WS-Addressing with WebSphere Message Broker, and illustrates the use of a reply being sent to an address other than the originating client. This topic describes the construction of a sample logger message flow when using WS-Addressing. This flow echoes back the input while creating a trace entry in a file to indicate that the flow has been invoked. 1. Switch to the Broker Application Development perspective.
748
Message Flows
2. Select the message flow name that you used in “Building the main message flow” on page 746 3. Press the right mouse button and select New->MessageFlow. a. Enter the name that you require for this message flow; for example, Logger. b. Press Finish to create the flow. 4. Select the HTTP folder on the message flow palette to display the contents. 5. Select an HTTPInput node and move the mouse to the left side of the canvas. a. Click the left mouse button to add the node to the message flow and enter the name Logger. b. Press Enter to finish. 6. Select the HTTPReply node from the palette and move the mouse to the right of the HTTPInput node, leaving room for a node in between. a. Click the left mouse button to add the node to the message flow and enter the name that you require; for example, Logger. b. Press Enter to finish. 7. Select the Construction folder on the message flow palette to display the contents. 8. Select a Trace node and move the mouse to the right of the HTTPInput node. a. Click the left mouse button to add the node to the message flow and enter the name that you require; for example Trace. b. Press Enter. c. Wire the out terminal of the HTTPInput node to the In terminal of the Trace node. d. Wire the out terminal of the Trace node to the In terminal of the HTTPReply node. 9. Select the HTTPInput node to display the properties. In the Basic tab: a. Enter the Data source name that you require. b. Change the name of the input node Logger as the Path suffix for URL. 10. Select the Input Message Parsing tab and select XMLNSC as the Message domain. 11. Select the Trace node to display the properties. a. Set Destination to File b. Set the File path that you require. c. Enter the Pattern that you require. 12. Save the message flow. Deploying the message flows: This is the third of a set of instructions on setting up your system to use WS-Addressing with WebSphere Message Broker, and illustrates the deployment of the message flows. This topic describes the deployment of the message flows you have already constructed. 1. Switch to the Broker Administration perspective. 2. Select the LocalProject project under Broker Archives in the navigator pane. a. Press the right mouse button. b. Select New->message Broker Archive. Working with Web services
749
c. Use the drop down menu to change the Project to LocalProject. d. Enter the name you selected for the main message flow described in “Building the main message flow” on page 746 in Name. e. Press Finish to open the Broker Archive Editor. 3. In the Broker Archive Editor: a. In the Filter working set list box select the working set name that you used for the main message flow. b. In Message Flows select the message flow names that you used for the main message flow and logger message flow. c. In Message Sets select the message set name that you used for the main message set. d. Press Build broker archive and confirm that the build operation was successful. e. Save the updated broker archive. 4. To deploy the message flows to the default execution groups: a. Select the name of the broker archive file with the name of the message flow that you used for the main message flow. b. Press the right mouse button. c. Select Deploy File from the menu. 5. Select the default execution group and press OK to start the deployment. Ensure that you receive a successful response message, and press OK to dismiss the information dialog. 6. Use the event log to confirm that the deploy operation was successful: a. Double click the Event Log entry on the Domains tab to open the Event log editor. b. Confirm that the deployment was successful. Testing the message flows: This is the fourth of a set of instructions on setting up your system to use WS-Addressing with WebSphere Message Broker, and illustrates the testing of the message flows. This topic describes the testing of the message flows that you have already constructed. In this scenario, you use a tool that uses HTTP protocol rather than WebSphere MQ protocol. You can use any tool that has the facilities that are described in the following procedure. 1. Start the tool and select http://localhost:nnnn/ where nnnn is the address of the port that you are using. 2. Set the URL to the host, port and selection for the deployed flow. The SOAPInput nodes listen on a different port from the HTTP nodes, and the listener is built into the execution group itself rather than using a different process. 3. Because the SOAPInput node expects a SOAPAction entry in the HTTP headers, you must add one. a. Click Add New Header. b. Enter the Value part of the header. The value must match the SOAPAction attribute of the SOAP:operation element in your code. c. Select New Header in the Name pane. d. Change the name from New Header to SOAPAction and click Enter.
750
Message Flows
4. Select Load File and go to the directory that contains the XML file you want to use. 5. Select the file and click Open. Note the following conditions: v If the message does not include any WS-Addressing entries, the ReplyTo and FaultTo locations default to anonymous. This means that the results are returned on the original client connection. v If the message includes a WS-Addressing header (ReplyTo) with a value of anonymous, the reply is returned to the original client using the original TCP/IP connection. v If the message includes a WS-Addressing header with a value of FaultTo explicitly included, the reply is returned to that address rather than the default of using the location that was specified in the ReplyTo header. 6. Click Send to test the flow. The result appears in the right pane.
XML domain message flows If you are not using the SOAP domain then your message flow needs to take account of the actual bitstream format of the Web service messages you are working with. A different logical tree format is used by each domain. If the messages are SOAP then you can use either the XMLNSC domain or the MRM XML domain. Both domains offer validation. The XMLNSC domain is more efficient, whilst the MRM XML domain can be useful if you have specific message transformation requirements, for example, if your message flow also uses binary data formats. If the messages use MIME (for example, SOAP with Attachments or MTOM) you can use the MIME domain. In this case your message flow will probably also need to identify at least the MIME part corresponding to the SOAP payload and then explicitly parse this using the XMLNSC or MRM domain as above. In the SOAP domain, WSDL is used to automatically configure your nodes with the appropriate endpoint information. If you are not using the SOAP domain, then you must select and configure the transport nodes manually. Typical WSDL bindings would be: v SOAP/HTTP, in which case implement a flow using HTTP nodes. Use the HTTPInput and HTTPReply nodes if a flow implements a Web service, or use the HTTPRequest node if a flow invokes a Web service. v SOAP/JMS, where you implement a flow using JMS or MQ nodes. You can configure message flows that receive input messages from clients using one transport, and interact with a Web service or legacy application using another. You can propagate a message to more than one location. For example, the Web service response to be returned to a client by an HTTPReply node might first be sent to an auditing application using an MQOutput node, after making any required adjustments to the message headers. Nodes are used together in the following basic patterns, using HTTP nodes as example transports: v As a Web service provider, for example
Working with Web services
751
v As a Web service consumer, for example:
v As a Web service facade, for example:
If required, the SOAPExtract and SOAPEnvelope nodes can be used in conjunction with these patterns to respectively extract the SOAP payload and rebuild a SOAP Envelope. If you want your message flow to validate messages, then an appropriate message set must be deployed with the flow. An appropriate message set is created either by importing existing WSDL or by generating WSDL from an existing message set. For details about importing existing WSDL, see Importing from WSDL. For details about generating WSDL from an existing message set, see WSDL generation. You can also create a new message set and flow based on existing WSDL or XSD files. For details, see “Creating an application based on WSDL or XSD files” on page 154 The generated message set will contain message definitions for the relevant SOAP Envelope version and for the XML payload data defined by the WSDL. In the XMLNSC or MRM XML domains, messages can be validated against the message set. For details, see “Validating messages” on page 187.
Working with HTTP flows Read this information if you are using HTTP message flows to interact with Web services. You might find it useful to read this in conjunction with the subsequent “Web services scenarios” on page 755 section. HTTPS For help with using HTTPS see Implementing SSL authentication. Setting the HTTP Status Code for a reply The default HTTP Status Code is 200, which indicates success. If you want a different status code to be returned, take one of the following actions: v Set your status code in the field Destination.HTTP.ReplyStatusCode in the LocalEnvironment tree (correlation name OutputLocalEnvironment). This field overrides any status code that is set in an
752
Message Flows
HTTPResponseHeader header. This action is the preferred option, because it provides the greatest flexibility. v Set your status code in the field X-Original-HTTP-Status-Code in the HTTPReplyHeader header. v Set your status code in the field X-Original-HTTP-Status-Code in the HTTPResponseHeader header. This option is typically useful if you include an HTTPRequest node before the HTTPReply node in your flow, because the HTTPResponseHeader header is created for you. In this scenario, an HTTPResponseHeader header has been created in the logical tree, representing the HTTP headers in the response from another Web service. If you have selected the Generate default HTTP headers from reply or response property in the HTTPReply node, values for the response header are set as default values when the reply message is created. Using LocalEnvironment.Destination.HTTP.RequestIdentifier When the HTTPInput node receives an input request message, it sets the LocalEnvironment field Destination.HTTP.RequestIdentifier to a unique value that identifies the Web service client that sent the request. You can refer to this value, and you can save it to another location if appropriate. For example, if you design a pair of message flows that interact with an existing WebSphere MQ application (as described in “Broker calls existing Web service” on page 756), you can save the identifier value in the request flow, and restore it in the reply flow, to ensure that the correct client receives the reply. If you use this technique, you must not change the data and you must retain the data as a BLOB. The HTTPReply node extracts the identifier value from the LocalEnvironment tree and sets up the reply so that it is sent to the specific client. However, if you are using an HTTPReply node in a flow that does not have an HTTPInput node, and this field has been deleted or set incorrectly, message BIP3143S is issued. If you design a message flow that includes both an HTTPInput and an HTTPReply node, the identifier value is set into the LocalEnvironment by the HTTPInput node, but the HTTPReply node does not use it. Therefore, if your message flow includes both nodes and a Compute node in the same flow, you do not have to include the LocalEnvironment tree when you specify which components of the message tree are copied from input message to output message by the Compute node (the Compute mode property). Setting the HTTPRequest node URL dynamically You can set the property Default Web service URL on the HTTPRequest node to determine the destination URL for a Web service request. You can configure a Compute node before the HTTPRequest node within the message flow to override the value set in the property. Code ESQL that stores a URL string in LocalEnvironment.Destination.HTTP.RequestURL; the HTTPRequest node retrieves and uses the URL string in place of the node property value. Although you can also set the request URL in the special header X-Original-HTTP-URL in the HTTPRequestHeader header section of the request message (which overrides all other settings) in a Compute node, use the LocalEnvironment tree content for this purpose for greater flexibility.
Working with Web services
753
Setting Generate default HTTP headers from reply or response for the HTTPReply node If you select Generate default HTTP headers from reply or response in the HTTPReply node properties, the node includes a minimum set of headers in the response that is sent to the Web service client. To set any headers explicitly, create them in an HTTPReplyHeader header. For example, a Compute node propagates a message in the XMLNS domain and modifies the Content-Type as follows: CALL CopyMessageHeaders(); SET OutputRoot.HTTPReplyHeader."Content-Type" = 'text/xml'; SET OutputRoot.XMLNS = InputRoot.XMLNS;
Do not use the ContentType property to set the Content-Type unless you are working in the MIME domain. The ContentType property is specifically intended to set the value of Content-Type used in MIME. The full set of HTTP headers used in the request is built by selecting the headers using the algorithm defined in the following steps: 1. Select any headers in an HTTPReplyHeader header. 2. If no Content-Type header is yet defined, create one using any non-empty value in the ContentType property. 3. Select any headers in an HTTPResponseHeader header (an HTTPResponseHeader header is propagated on return from an HTTPRequest node). 4. If no Content-Type header is yet defined, create one with the default value text/xml; charset=utf-8. 5. Create or overwrite the Content-Length header. Attention: The HTTPReply node always rewrites the Content-Length header, even if you have cleared Generate default HTTP headers from reply or response. This action ensures that the content is correct. If an HTTPReplyHeader header section existed in the message received by the HTTPReply node, and the Output terminal of the HTTPReply node is connected, the HTTPReplyHeader header section is updated with any changed or added values. Setting Generate default HTTP headers from input for the HTTPRequest node If you select Generate default HTTP headers from input in the HTTPRequest node properties, the node includes a minimum set of headers in the request that is sent to the server. To explicitly set headers , create them in an HTTPRequestHeader header. For example, a Compute node propagating a message in the XMLNS domain can modify the Content-Type as follows: CALL CopyMessageHeaders(); SET OutputRoot.HTTPRequestHeader."Content-Type" = 'text/xml'; SET OutputRoot.XMLNS = InputRoot.XMLNS;
Do not use the ContentType property to set the Content-Type unless you are working in the MIME domain. The ContentType property is specifically intended to set the value of Content-Type used in MIME. The full set of HTTP headers used in the request is built by selecting the headers using the algorithm defined in the following steps:
754
Message Flows
1. Set the Host header, based on either the request URL or the incoming HTTPRequestHeader header section of the message. 2. Select any headers in an HTTPRequestHeader header. 3. If no Content-Type header is yet defined, create one using any non-empty value in the ContentType property. 4. Select any headers in an HTTPInputHeader header (an HTTPInputHeader header is created automatically by an HTTPInput node). 5. If no Content-Type header is yet defined, create one with the default value text/xml; charset=utf-8 6. If no SOAPAction header is yet defined, create one with the default value ''. 7. Create or overwrite the Content-Length header. Attention: The HTTPRequest node always rewrites the Content-Length header, even if you have cleared Generate default HTTP headers from input or request. This action ensures that the content is correct. If an HTTPRequestHeader header exists in the received message, the HTTPRequestHeader header is updated with any changed or added values. Collecting HTTPListener trace if you have problems with HTTP If you have problems with HTTP, you can trace the HTTPListener: 1. Use the mqsichangetrace command to start trace with the following options: mqsichangetrace component -t -b
where component is the broker name. 2. Retrieve the HTTPListener trace log using the mqsireadlog command with the HTTPListener qualifier for the -b parameter. 3. Format the trace log using the mqsiformatlog command so that you can view its contents.
Web services scenarios This topic describes some common Web services scenarios. It is organized according to the role played by the broker. A key consideration is whether a WSDL description for the Web service already exists. In the first two scenarios below, the WSDL description exists and is imported and used by the message flow. In the remaining two scenarios, the WSDL description is generated in an existing message set. Again, the WSDL is used by the message flow and may also be exported for use by an external client. These are generic scenarios and can be implemented using the SOAP domain, or by using an appropriate non-SOAP domain (XMLNSC, MRM, MIME) and basic transport nodes. If you need to use WS-Addressing or WS-Security for a particular implementation, you must use the SOAP domain.
Working with Web services
755
You want the broker to invoke an existing Web service: See “Broker calls existing Web service” You want the broker to expose an application as a previously defined Web service: See “Broker implements existing Web service interface” on page 764 You want the broker to expose an application as a new Web service: See “Broker implements new Web service interface” on page 760 You want the broker to expose a Web service to a non-Web service client: See “Broker implements non-Web-service interface to new Web service” on page 768
Broker calls existing Web service In this scenario, the broker invokes an existing Web service implementation. The WSDL for the Web service already exists, and is imported to create a message set. A message flow based on this message set sends a Web service request and receives the response, for example using a SOAPRequest node.
Web Service
WSDL
import
Message Set
deploy
Message Broker
Key to symbols:
Executable
File
Message set
Message flow
association
design time action. For example, import or deploy
design time action involving an external toolkit. For example, generating a Web service client.
run time interaction. For example, message exchange
Possible uses v You want to call a Web service to do some processing as part of your message flow.
756
Message Flows
v You have an existing Web service and you want to provide a different interface to it. This could be an alternative Web services interface or a WebSphere MQ interface. v You have an existing Web service and you want to change its implementation in some way without changing its interface; that is, the broker acts as an intermediary to the Web service. For instance a message flow could be used to enable auditing, or to transparently propagate the Web service response to another application.
Design steps 1. Import WSDL to create a message set containing definitions for the SOAP messages described by the WSDL. 2. Create a message flow to invoke the Web service. If the SOAP domain is used, the message flow uses a SOAPRequest node, SOAPAsyncRequest node or a SOAPAsyncResponse node. The nodes are configured using the WSDL imported in Step 1. If required, a skeleton flow can be created from scratch by dropping the WSDL onto a blank message flow editor canvas. If the SOAP domain is not used, the message flow must be constructed using transport nodes, and an XML or MIME domain. For example, if the WSDL binding specifies HTTP transport, and the request message is SOAP, then an HTTPRequest node can be used with the XMLNSC domain. You can then configure the node manually with the endpoint information for the Web service. 3. Build a broker archive file for deployment. The broker archive file contains your message flow and the message set containing the imported WSDL. The SOAP domain always requires the WSDL to be deployed, because messages are verified against it at runtime; also WSDL information is included in the logical tree. The message set includes XML Schema definitions that can be used for message validation in the SOAP, XMLNSC or MRM domains.
Runtime Your message flow creates an appropriately formatted Web service request, invokes the Web service, and parses the Web service response. If the SOAP domain is used, your message flow uses the SOAP logical tree model. If the SOAP domain is not used, your message flow uses the logical tree for your selected domain, for example you use the MIME domain if your Web service messages use SOAP with Attachments.
Example 1 Web service intermediary In this example a client application uses a Web service called Account, which is made available by another organization. The client is widely distributed in your company. The client uses an operation called getBalance, but the Account service is being modified to change the definition of the getBalance operation. You can construct message flows to provide an interface to the Account service, instead of modifying the client. The message flows can call the Account service to do the work, and the new Web service delegates to the original Web service. The client can now continue to use the Account service, using the new message flows. Examples of typical message flow patterns are shown below. In each case, the intermediate request node calls the Account service: 1. Using SOAPInput, SOAPRequest and SOAPReply nodes: Working with Web services
757
2. Using SOAPInput, SOAPAsyncRequest, SOAPAsyncResponse and SOAPReply nodes:
3. Using HTTPInput, HTTPRequest, and HTTPReply nodes:
In the message flows in the example, Compute1 modifies the original getBalance message as required by the modified Account service, whilst Compute2 restores the response message to the original format. If you have imported or generated WSDL then you have a message model for the getBalance operation. If you have a message model defined for the getBalance operation, you can use Mapping nodes instead of Compute nodes. HTTP details If you use HTTP transport nodes, as shown in the example, you can configure the HTTPRequest node to generate HTTP headers from the headers that are received by the HTTPInput node. This enables cookies and other application-specific headers to be passed through the message flow. The HTTPReply node can be used task to extract headers from the Web service response, to return to the originating client. To do this, select Generate default HTTP headers from on both the HTTPRequest and HTTPReply nodes. In general you do not need the original request message to generate the reply to the client, and can select Replace input message with Web service response on the HTTPRequest node. If you do want to preserve any data from the input request, you can store this in the LocalEnvironment in Compute1, and retrieve it in Compute2 for inclusion in the reply.
758
Message Flows
Example 2 Using a Web service In this example, a WebSphere MQ message flow implements a process for the Human Resource department of your company. As part of this processing, the message flow calls a Web service to retrieve employee ID numbers. Employee ID numbers are maintained in the company’s employee directory, which is accessed through a Web service. Examples of typical message flow patterns are shown below. In each case the intermediate request node retrieves the employee ID: 1. Using MQInput, SOAPRequest and MQOutput nodes:
2. Using MQInput, SOAPAsyncRequest, SOAPAsyncResponse and MQOutput nodes:
3. Using MQInput, HTTPRequest and MQOutput nodes:
In the message flows in the example, Compute1 prepares the Web service request message and Compute2 processes the response. For example, by incorporating the employee ID in another message. If you have a message model defined, you can use Mapping nodes instead of Compute nodes in these examples. HTTP details If you use HTTP transport nodes, as shown in the example, you typically clear the Replace input message with Web service response in the Working with Web services
759
HTTPRequest node properties. The response from the corporate directory server is placed in a temporary location in the message tree. The temporary location is specified in the Response message location in tree property in the same node. In Compute2, you can code ESQL to retrieve the result, and update the final message.
MQInput
Compute1
HTTPRequest
Compute2
MQOutput
HTTP Connection
Corporate Directory Server
Using the SOAP domain for these scenarios is preferred. For more information about choosing a domain for Web services, see “WebSphere Message Broker and Web services” on page 669.
Broker implements new Web service interface In this scenario, the broker implements a new Web service interface. The WSDL for the Web service is generated from a message set and made available to clients. A message flow based on this WSDL and message set receives a request and then builds a response message using data obtained from an existing non-Web-service application.
Existing non-Web-service application
Existing non-Web-service interface import
WSDL
Message set generate
deploy
Web service client
Key to symbols:
760
Message Flows
Broker
Executable
File
Message set
Message flow
association
design time action. For example, import or deploy
design time action involving an external toolkit. For example, generating a Web service client.
run time interaction. For example, message exchange
This scenario is sometimes referred to as a Web service facade. The design of the Web service interface typically involves some regrouping, restriction, or enhancement of the existing interface, and is not constrained by an existing WSDL definition.
Possible uses v The broker provides a Web services interface to an existing application, optionally providing other mix-in capabilities such as auditing the requests made. v Over time the implementation can be changed without affecting the interface presented to the Web services client.
Design steps 1. Create a message set for the business messages, possibly by importing an existing interface definition such as a C header file or COBOL copybook. 2. Generate a WSDL definition from the message set. 3. Use a SOAP toolkit such as Rational® Application Developer to create a suitable Web services client based on the WSDL. 4. Develop a message flow to implement the Web service.
Runtime Your message flow receives a Web service request, converts it into a form expected by the existing application and invokes the existing application. The response from the existing application is converted into a valid Web service response.
Example 1 In this example, an existing message flow is modified to provide a Web service. If the existing message flow models its data in a message set, then a WSDL definition can be generated from that message set and made available to clients. Most message flows that currently use WebSphere MQ for input or output can be adapted to support Web services as a replacement or additional protocol. The following are typical message flow patterns. In each case the input and reply nodes replace or complement the original MQInput and MQOutput nodes. The main part of the flow is understood to do some useful processing. 1. Using SOAPInput and SOAPReply nodes:
Working with Web services
761
2. Using HTTPInput and HTTPReply nodes:
If you use the SOAP domain, then the logical tree shape will be different from the original domain and you will need to take account of this in the message flow. If you use the HTTP nodes with the original domain, then the logical tree shape does not change. For information about choosing the domain, see “WebSphere Message Broker and Web services” on page 669. HTTP details If you use the HTTP nodes, you can configure the HTTPReply node to generate a set of default HTTP headers for the reply message sent to the client. Generating a set of default HTTP headers reduces the modifications that you must make to convert the message flow from one that processes WebSphere MQ messages to a flow that processes HTTP messages.
Example 2 In this example, a message flow is created to provide asynchronous access to a WebSphere MQ application. The following are typical message flow patterns. In each case the flow receives the Web service request and build the response using data returned from the application over MQ. 1. Using two message flows with SOAPInput, SOAPReply nodes:
762
Message Flows
2. Using two message flows with HTTPInput and HTTPReply nodes:
In each case, the first message flow receives inbound requests from a Web service client. The Compute1 node transforms the request and an MQOutput node sends the modified request to the existing application. In the second message flow, an MQInput node receives the response from the application. The Compute2 node then transforms the message and propagates it to a reply node that responds to the original Web service client. The Compute1 node must also save some correlation information to be retrieved by the Compute2 node, ensuring that the replies from the WebSphere MQ application are returned to the client that sent the original request. HTTP details Using HTTPInput and MQOutput nodes as the outbound message and MQInput and HTTPReply nodes as the response message:
Working with Web services
763
HTTPInput
Compute1
MQOutput
HTTPReply
Compute2
MQInput
Existing WebSphere MQ Application
One way to preserve the correlation information is for the Compute1 node to encode the HTTP request identifier in the outbound message. (Alternatively, the request identifier can be stored in a database). The HTTPInput node provides the request identifier as a field in the LocalEnvironment tree called Destination.HTTP.RequestIdentifier and the Compute1 node can read and store this value. The Compute2 node reads the HTTP request identifier from the message, and sets LocalEnvironment.Destination.HTTP.RequestIdentifier using this value. The HTTPReply node uses the request identifier to ensure that the message reaches the correct HTTP client. The implementation of this scenario requires correct handling of the MQMD. Any messages coming in across WebSphere MQ must have the MQMD removed before being sent into an HTTPReply or HTTPRequest node (unless including an MQMD in the HTTP stream is desired). In the ESQL module for the Compute1 node, include a code statement like the following statement: SET OutputRoot.XMLNS.A.MessageID = CAST(InputLocalEnvironment.Destination.HTTP.RequestIdentifier AS CHARACTER);
In the ESQL module for the Compute2 node, include a code statement like the following statement: SET OutputLocalEnvironment.Destination.HTTP.RequestIdentifier = CAST(InputRoot.XMLNS.A.MessageID AS BLOB);
Broker implements existing Web service interface In this scenario, the broker implements an existing Web service interface. The WSDL for the Web service already exists, and is imported to create a message set. A message flow based on this message set receives a request and then builds a response message using data obtained from an existing non-Web-service application.
764
Message Flows
Existing non-web-service Application
Existing non-web-service Interface
WSDL
import
import
Message Set
deploy
(Existing) Web Service Client
Message Broker
Key to symbols:
Executable
File
Message set
Message flow
association
design time action. For example, import or deploy
design time action involving an external toolkit. For example, generating a Web service client.
run time interaction. For example, message exchange
Possible uses v The broker provides a Web service implementation with a different quality of service from existing implementations. v The broker provides a migration strategy for the existing implementation.
Design steps 1. Import WSDL to create a message set containing definitions for the SOAP messages described by the WSDL. 2. Adapt the message set for the required existing interface, possibly by importing an existing interface definition such as a C header file or COBOL copybook. 3. Develop a message flow to implement the Web service.
Runtime Your message flow receives a Web service request, converts it into a form expected by the existing application and invokes the existing application. The response from the existing application is converted into a valid Web service response.
Working with Web services
765
Example 1 In this example, an existing HTTP Web service client provides information on a given subject (stock prices or exchange rates, for example). You want to replace this service with an inhouse database lookup solution, but want to make no changes to the clients because these are widely deployed. Typical message flow patterns are shown below. In each case the intermediate request node retrieves the information from the database: 1. Using SOAPInput and SOAPReply nodes:
2. Using HTTPInput and HTTPReply nodes:
In the flows above, the input node receives the Web service request. Compute1 then retrieves the required information from the database and generates the required Web service response using this data. The response is returned to the client by the reply node. In the examples you can use Mapping nodes instead of Compute nodes.
Example 2 In this example, an existing application is exposed as a Web service, but there is a constraint on the interface with the Web service, because a widely distributed client already uses a similar service that is defined by an existing WSDL definition. The broker offers the same interface to the client, this might be because the original service offers a different quality of service or is to be discontinued. Typical message flow patterns are shown below. In each case the message flows receive the Web service request and build the response using data returned from the application over WebSphere MQ. 1. Using SOAPInput, SOAPReply and MQGet nodes:
766
Message Flows
2. Using HTTPInput, HTTPReply and MQGet nodes:
3. Using two message flows with SOAPInput, SOAPReply nodes:
4. Using two message flows with HTTPInput and HTTPReply nodes:
The steps to develop the message flow are: 1. Create a message model for the existing application interface, for example, by importing a C header file for the application. 2. Import an existing WSDL definition for the client. 3. Create a flow using the message set to implement the Web service interface and mediate with the existing application. Message flows 1 and 2 show a synchronous call to the application using MQOutput and MQGet nodes. You can set a timeout in the MQGet node, to allow for failure of the remote application. The request-reply translation is handled in a single transaction enabling simple rollback and recovery. However, each incoming request has to be fully processed and responded to before moving onto the next request. This might impact performance, if the application cannot respond quickly. Working with Web services
767
The message flows shown in examples 3 and 4, show an asynchronous equivalent. In each case the first flow stops after sending the message to the application, and becomes available to handle further requests. However, this scenario requires a correlation context to be saved in the request flow, and restored in the reply flow. You can store the correlation context on a queue, and then use an MQGet node in the reply flow to retrieve it. This flow design enables the requests to be dispatched to the application promptly, and replies to be returned in the order that they are received. In the examples you can use Mapping nodes instead of Compute nodes. Using the SOAP domain for these scenarios is preferred. For more information about choosing a domain for Web services, see “WebSphere Message Broker and Web services” on page 669. For more information about the asynchronous request-reply scenario, see “A request-response scenario using an MQGet node” on page 213. The asynchronous request-reply scenario is also detailed in the following sample which can be adapted for Web service usage: v Coordinated Request Reply sample Another Web services scenario is described in the sample: v HTTP Nodes sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Broker implements non-Web-service interface to new Web service In this Web service scenario, the broker provides compatibility with earlier versions for existing non-Web-service clients to invoke a new Web services implementation provided by a SOAP toolkit.
Existing non-Web-service client
Existing non-Web-service interface import
Message set
deploy
Broker
Key to symbols:
768
Message Flows
generate
WSDL
generate
Web service
Executable
File
Message set
Message flow
association
design time action. For example, import or deploy
design time action involving an external toolkit. For example, generating a Web service client.
run time interaction. For example, message exchange
Possible uses You want to migrate an application to a Web service implementation, for example an EJB implementation hosted by an application server to offer better scalability. However, a significant number of your users have existing clients that cannot be immediately replaced. Existing clients can use the broker to use the new Web service implementation.
Design steps 1. Create a message set for the business messages, for example, by importing an existing interface definition such as a C header file or COBOL copybook. 2. Generate a WSDL definition from the message set. 3. Use a SOAP toolkit or application server to create a suitable Web services implementation based on the WSDL. 4. Develop a message flow to mediate between the original existing client and the new Web service.
Runtime Your message flow receives a request from the existing client, converts it into a Web services request and invokes the Web service. The response from the Web service is converted into a form understood by the existing client.
Working with Web services
769
770
Message Flows
Part 3. Working with files Working with files . . . . . . . . . . . How the broker processes files . . . . . . . Recognizing file records as messages to be parsed. . . . . . . . . . . . . . . How the file nodes and additional instances share access to files . . . . . . . . . . . . . Using LocalEnvironment variables with file nodes File name patterns. . . . . . . . . . . . mqsiarchive subdirectory . . . . . . . . . Reading a file . . . . . . . . . . . . . Reading a file on your local file system. . . . Reading a file on a remote FTP directory . . . Reading a file, effects of different values in the FileInput node’s Record detection property . . Writing a file . . . . . . . . . . . . . Writing a file to your local file system . . . . Writing a file to a remote FTP server . . . . Writing a file, effects of different values in the FileOutput node’s Record definition property .
© Copyright IBM Corp. 2000, 2008
773 773 775 776 777 780 782 783 783 785 787 791 791 793 796
771
772
Message Flows
Working with files You can use the FileInput node in your message flows to process data from files. You can use the FileOutput node to output data from a message flow into a file. One of the most common methods of data storage is files. Processes using file transfer form the backbone of many business IT systems. You can create message flows to process data in files, accepting data in files as input message data, and producing output message data for file-based destinations. The following file nodes are provided: v FileInput node. Use this node to receive messages from files in the broker server’s file system. The node generates output message data that can be used by any of the output nodes meaning that messages can be generated for clients using any of the supported transport protocols to connect to the broker. For more information, see “FileInput node” on page 872. v FileOutput node. Use this node to write messages to a file in the broker’s file system. It can create new files and replace existing files. For more information, see “FileOutput node” on page 886. Using this function, you can also process large files without using excessive storage and simplify the processing of files which have large numbers of repeating entries. If v v v
you want to work with files, read these topics: “How the broker processes files” “How the file nodes and additional instances share access to files” on page 776 “Using LocalEnvironment variables with file nodes” on page 777
v v v v
“File name patterns” on page 780 “mqsiarchive subdirectory” on page 782 “Reading a file” on page 783 “Writing a file” on page 791
How the broker processes files This topic describes how the broker processes files with the file nodes, FileInput and FileOutput. WebSphere Message Broker can read messages from files and write messages to files in the local file system, or on a network file system that appears local to the broker. Two nodes provide this capability: v FileInput node v FileOutput node A file, or record within a file is analogous to a message in a queue. The directory which contains the file is analogous to a message queue.
How the broker reads a file The FileInput node processes messages which are read from files. It scans a specified directory for files that match a certain specification. This directory is in the file system that is attached to the broker. Optionally, files from a remote FTP server can be moved to the local directory whenever the directory is to be scanned. © Copyright IBM Corp. 2000, 2008
773
You specify the file to be searched for with an explicit file name or a file name pattern which includes wildcard characters. When the broker finds a file which matches this specification, it reads the file and propagates a message, or messages, using the contents of the file. If the file is locked, it is ignored at this directory scan. When the broker has finished reading the file, the file is removed from the input directory. The broker may start file processing as soon as the file appears in its input directory. If the file is still being written by another program, the broker might read corrupted data. This can be avoided either by arranging that the file is locked until it is finished, or by creating the file elsewhere and moving it into the input directory when ready. You can specify, using the FileInput node, how the records are derived from the file. The contents of a file can be interpreted as: v A single record (’whole file’) v Separate records, each of a fixed length (’fixed length records’) v Separate records each delimited by a specified delimiter (’delimited records’) v Separate records that are recognized by a parser that you specify (’parser record sequence’) After the file has been successfully processed, it is either: v Deleted from the file system, or v Moved to an archive subdirectory of the specified (local) directory The message, or messages, propagated from the file can be used as input to any flow and output node. You can create a message flow that receives messages from files and generates messages for clients that use any of the supported transports to connect to the broker. Whenever a message is propagated from a file, the FileInput node stores certain information about the file in the LocalEnvironment.File message tree. This includes the offset of the record of the message in the file being processed and the record number in that file. In addition, when wildcards are used in a file name pattern, the characters matched in the file name are placed in the WildcardMatch element of the LocalEnvironment tree.
How the broker writes a file The FileOutput node writes messages to files in the broker’s file system. When a message is received on the node’s In terminal, it creates and writes a file as a series of one or more records. One record is written to a file for every message received. The name of the file is specified either by a file name pattern in the node or an explicit file name which is either specified in the node or derived from the message. You can specify how the records are accumulated into files. These can comprise: v A single record (’whole file’). The file that is created consists of one record. v Concatenated records (’unmodified records’). The records are neither padded to any required length, nor separated by any delimiter. v Uniform length (’fixed-length records’). Records that are shorter than the specified length are padded to the required length.
774
Message Flows
v Separate records (’delimited records’). Records are either terminated or separated by a specified delimiter. The flow informs the FileOutput node that there are no more records to write by sending a message to its Finish File terminal. At this point, the file is moved to the specified output directory. Optionally, this file may be moved to a directory on a remote FTP server identified by properties of the node. If the node is producing a single record from the file (’whole file’), the file is moved immediately to the output directory without requiring a message to be propagated to the Finish File terminal. In this case, any message sent to the node’s Finish File terminal has no effect on any file, though the message will still be propagated to a flow attached to the node’s End of Data terminal.
Recognizing file records as messages to be parsed This topic describes how you can use the FileInput node to segment your input file into messages that are to be parsed. It also describes the special considerations that you must be aware of when using the MRM and XMLNSC parsers. Use the FileInput node to segment your input file into messages that are to be parsed by one of the following parsers: v MRM Custom Wire Format v MRM Tagged Delimited String Format v XMLNSC Use the FileInput node’s Message domain property to specify which parser you need to use; MRM or XMLNSC. Specify Parsed Record Sequence in the Record detection property so that the node splits the file into messages to be parsed by either the MRM or XMLNSC parser. If you select the MRM parser, ensure that the message model has a defined message boundary and does not rely on the end of the bitstream to stop the parse. If the final element has a maxOccurs value of -1, the parser continues to read bytes until the end of the bitstream or until it encounters bytes that cause a parsing exception. In either case, the parser is unable to identify the end of one message and the start of the next. If you use Data Element Separation = Use Data Pattern, ensure that the pattern recognizes a specified number of bytes. Be aware, therefore, that a pattern of * identifies all available characters and so would read an entire input file. If you use delimited separations with message group indicators and terminators, ensure that the combination of group indicator and terminator does not match a record delimiter. For example, a message might start with a left brace ({) and end with a right brace (}). If there is a delimiter of }{ within the message, this matches the boundary between multiple messages; as a result, a message boundary might be identified as a delimiter within the current message. This might cause bytes in a subsequent message to be included in the current message causing parser exceptions or unexpected content in the parse tree. If you select the XMLNSC parser, be aware that the end of the root tag marks the end of the message. Any XML comments, XML processing instructions and white space which appear after the end of the XML message are discarded. The start of the next XML message is marked either by the next XML root tag or the next XML prolog.
Working with files
775
How the file nodes and additional instances share access to files This topic describes how multiple instances read from and write to files. When a message flow uses the FileInput or FileOutput node, there might be additional instances associated with the flow. You need to understand how multiple instances read from and write to the files processed by these nodes. The same considerations apply to other message flows in the same execution group if they use file nodes that refer to files in the same directory. The broker locks the files being read by the FileInput node or being written by the FileOutput node. This prevents other execution groups from reading or changing the files while they are being processed. The broker relinquishes the lock when a FileInput node finishes processing its input file. The broker relinquishes the lock when a FileOutput node finishes the file and moves it from the transit directory to the output directory.
Reading a file When the FileInput node reads a file, only one instance (of one message flow) is allocated to reading it. Each record in the file is serially processed by this instance. Other instances of the message flow, or other message flows, can simultaneously process other files the names of which match the pattern specified in the node’s File name or pattern property. Message flows in the same execution group cooperate to avoid files being processed or accessed multiple times. There is no such cooperation between message flows in different execution groups. While a file is processed, the facilities of the file system are used to lock the file. This helps to prevent other programs, including other execution groups, from reading, writing, or deleting the file while it being processed by the file nodes. While a FileInput node is reading a file, the file remains in the local directory until it has been fully processed (or until an unrecoverable error occurs). A subdirectory is then used to accommodate the file once it has been processed if it is retained.
Writing a file Files created and written by a FileOutput node are placed in the output directory when they are finished. While records are being added to a file, it is kept in the transit (mqsitransit) subdirectory. Each record is written by a single message flow instance and there is no constraint on which instance this can be. All message flow instances that are configured to write records to a specific file can append records to that file. Because instances can run in any order, records that they write might be interleaved. If you need to ensure the sequence of records in the output file, arrange that only one FileOutput node instance uses the file. Achieve this by configuring the flow containing the node to use the node’s additional instances pool with zero instances and by ensuring that other flows do not write to the same file. While a file is processed, the facilities of the file system are used to lock the file. This helps to prevent other programs, including other execution groups, from reading, writing, or deleting the file while it being processed by the file nodes. This lock is retained for a short period after a FileOutput node writes to the file without finishing it, leaving it in the transit directory. If flows that are in the same execution group use the same output file and run sufficiently quickly, the broker does not need to relinquish the lock before the file is finished. However, if the
776
Message Flows
flows have longer intervals between execution, the broker relinquishes the lock and another process or execution group can acquire a lock on the file. If you need to prevent this behavior, do not share output directories across execution groups. Instances within a single execution group cooperate to ensure that no file system errors occur. When an instance cannot write a record because another instance is currently writing to the file, it waits for a short period and then tries again to write to the file. This might result in message flow exceptions especially when the record being written is large and the file system is slow. Flow retry processing normally allows the record to be regenerated but this can result in an unpredictable order of output records in the file. Because instances in different execution groups cannot cooperate, the only mechanism available to prevent errors is the file system lock obtained by the FileOutput node. It is good practice to prevent other programs from accessing files in transit subdirectories while flows that might be writing to those files are active. If you need to allow other programs to access a file in the transit directory, for example to correct problems with file processing in a flow, ensure that you stop all of the relevant flows beforehand.
Using the same directory as an input directory and an output directory You can use a single directory as the input directory of one flow and the output directory of another. In this situation, the archive subdirectories are shared between the flows but the transit and backout subdirectories are not shared. if the message flows are in the same execution group, the message flows cooperate. If the message flows are in separate execution groups, contention might occur which might cause processing exceptions. However, it is not possible for a file to be read by a FileInput node until a FileOutput node has finished with the file, and has then moved it out of the transit directory.
Using LocalEnvironment variables with file nodes This topic describes the LocalEnvironment variables available to you when you use file nodes to process files. You can use various fields in the LocalEnvironment to dynamically interrogate and alter file node properties. These fields are available in the following message tree structures: v LocalEnvironment.File v LocalEnvironment.WrittenDestination.File v LocalEnvironment.Wildcard.WildcardMatch
LocalEnvironment.File fields When you use the FileInput node, it stores information that you can access in the LocalEnvironment.File message tree. The fields in this structure are described in the following table:
Working with files
777
Table 13. Element Name
Element Data Type
Description
Directory
CHARACTER
Absolute directory path of the input directory in the form used by the file system of the broker. For example, on Windows systems, this starts with the drive letter prefix (such as C:).
Name
CHARACTER
File name and extension.
LastModified
TIMESTAMP
Date and time the file was last modified.
TimeStamp
CHARACTER
Date and time the input node started processing the file in the coordinated universal time (UTC) zone, as a character string. This data is the string used to create archive and backout file names if a timestamp is included.
The following elements contain data about the current record: Offset
INTEGER
Start of the record within the file. The first record starts at offset 0. When part of the End of Data message tree, this is the length of the input file.
Record
INTEGER
Number of the record within the file. The first record is record number 1. When part of the End of Data message tree, this is the number of records.
Delimiter
CHARACTER
The characters used to separate this record from the preceding record, if Delimited is specified in Record detection. The first record has a null delimiter. When part of the End of Data message tree, this is the delimiter that follows the last record, if any.
IsEmpty
BOOLEAN
Whether the record propagated by the message flow is empty. It is set to TRUE if the current record is empty. When part of the End of Data message tree, this is always set to TRUE.
This structure is propagated with each message written to the Out terminal of the FileInput node and with the empty message written to the End of data terminal.
778
Message Flows
LocalEnvironment.WrittenDestination.File fields When you use the FileOutput node, it stores information that you can access in the LocalEnvironment.WrittenDestination.File message tree. The fields in this structure are described in the following table: Table 14. Element Name
Element Data Type
Description
Directory
CHARACTER
Absolute directory path of the output directory in the form used by the file system of the broker. For example, on Windows systems, this starts with the drive letter prefix (such as C:).
Name
CHARACTER
File name of the output file.
Action
CHARACTER
Possible values are: v Replace if an output file of the same name is replaced. v Create if a new output file is created. v Append if this is associated with a record that is appended to an output file. v Finish if a Finish File message is received and no file is found to finish (for example, if Record is Whole File is specified and a message is sent to the Finish File terminal). v Transmit if the file was transferred by FTP and the file was not retained.
Timestamp
CHARACTER
The date and time, in character string form, when the node started to process this file. This is the value which prefixes the names of files that are archived if you specify Time Stamp, Archive and Replace Existing File in the Output file action property on the Basic tab.
LocalEnvironment.Wildcard.WildcardMatch field On the FileInput node, you can specify a file name pattern that contains wildcard characters. The FileInput node copies the characters in the file name matched by wildcards, together with any intermediate characters, to LocalEnvironment.Wildcard.WildcardMatch.
Working with files
779
Table 15. Element Name
Element Data Type
Description
WildcardMatch
CHARACTER
The character string in the file name matched by wildcards in the file name pattern.
For example, if the file name pattern on the FileInput node is specified as file*.txt and the file that is read has a name of file02.txt, then the value of WildcardMatch becomes 02. If the file name pattern on the FileInput node is specified as file??type.*, and the file that is read has a name of file02type.xml, then the value of WildCardMatch becomes 02type.xml. On the FileOutput node, you can use a wildcard character in the file name pattern. If you include the single wildcard character, ’*’, in the file name pattern, the node uses the value that is stored in LocalEnvironment.Wildcard.WildcardMatch. This is useful if you have a message flow where the FileInput and FileOutput nodes are working with the same file; you can preserve the name of the input file on the FileOutput node. You can also use standard methods for manipulating the value of the WildcardMatch element to whatever you want; you do not have to use a FileInput node.
File name patterns You can specify a file name pattern, using wildcard characters, to identify a file to be read by the FileInput node. You can also specify a file name pattern, using a single wildcard character, to name the file to be created by the FileOutput node.
Using file name patterns with the FileInput node The FileInput node reads files from a specified directory and propagates messages based on the contents of these files. Only files with names that match a pattern (the input pattern), as specified in the FileInput node’s File name or pattern property, are read. This is either a file name or a character sequence (a pattern) that matches a file name. A pattern is a sequence containing at least one of the following wildcard characters: Wildcard character
Description
Example
*
Any sequence of zero or more characters
*.xml matches all file names with an xml extension
?
Any single character
f??????.csv matches all file names consisting of the letter f followed by six characters and then the sequence .csv.
The default pattern is * which matches all file names. You cannot specify file names that contain the following characters: the asterisk (’*’), the question mark (’?’), file name separator characters (’/’ and’ \’). You might want to process files that all have a certain extension, for example xml. If so, set a value of *.xml in the FileInput node’s File name or pattern property and the node will process all files in the directory that have this extension. If you deploy the flow to a Windows server, file names match the pattern irrespective of case. However, if you deploy the flow to a Linux, UNIX, or z/OS
780
Message Flows
server, file names must match the pattern character string and case.
Pattern matching The FileInput node sets the LocalEnvironment.Wildcard.WildcardMatch element to the string matched by wildcards in the file name. Here are some examples of pattern matching with the value in this element where the value in the File name or pattern property is File????.from*.xml: v If the FileInput node finds a file with the file name File1234.fromHQ.xml, there is a match. The value in the LocalEnvironment.Wildcard.WildcardMatch element is set to 1234.fromHQ and the node processes the file. v If the file name is File123.fromHQ.xml, there is no match because there are insufficient characters between the File and .from elements of the file name. The FileInput node ignores this file. v If the file name is File2345.from.xml, there is a match. The value in the LocalEnvironment.Wildcard.WildcardMatch element is set to 2345.from and the node processes the file. In this example, the * in the character string in the File name or pattern property matches a string of zero characters. If you required the character string between the from and .xml elements of the file name to always have at least one character, you would specify the File name or pattern property with a value of File????.from?*.xml.
Using file name patterns with the FileOutput node The FileOutput node writes messages to files that it creates or replaces in the broker’s file system. Only files with names that match a pattern, as specified in the FileInput node’s File name or pattern property, are written. This is either a file name or a character sequence (a pattern) that matches a file name. Only patterns containing a single wildcard character (the asterisk, ’*’) are allowed in this property. The file name to be used is determined as follows: v If the File name or pattern property contains no wildcard, then the value of this property is the name of the file created. This must be a valid file name on the file system which hosts the broker to which the message flow is deployed. v If the File name or pattern property contains a single wildcard, then the value of the element LocalEnvironment.Wildcard.WildcardMatch in the current message replaces the wildcard character, and the resulting value is the name of the file created. This must be a valid file name on the file system which hosts the broker to which the message flow is deployed. If the WildcardMatch value is not found, the wildcard character is replaced by the empty string. You cannot specify file names that contain the following characters: the asterisk (’*’), the question mark (’?’), file name separator characters (’/’ and’ \’).The name of the file can be overridden by values in the current message. If the File name or pattern property is empty, the name must be overridden by the current message. Wildcard substitution occurs only if this property is not overridden in this way. File names are passed to the file system to which the broker has access and have to respect the conventions of these file systems. For example, file names on Windows systems are not case-sensitive, while, on UNIX systems, file names which differ by case are considered distinct.
Working with files
781
FTP considerations You can use the FileInput node to transfer files from a remote FTP server and process them. Only files with names that match the file name pattern specified in the node are read. If your broker is on a platform that respects case sensitivity, such as UNIX, you might specify a pattern that includes a combination of upper and lower case characters. If you then use this pattern to process files that are in a directory on a remote FTP server, and this is running on a platform which does not respect case sensitivity, such as Windows, file name matching might fail and no files are processed; this is because the file names on the remote server are not in mixed case. If your broker is on a platform which does not respect case sensitivity, any pattern that you specify might be matched by more than one file on a remote FTP server which is running on a platform on which case sensitivity is significant. Each of these files is then processed sequentially. You can use the FileOutput node to write files to a remote FTP server. Only files with names that match the pattern specified in the node are written If your broker is on a platform that respects case sensitivity, such as UNIX, you might specify a pattern that includes a combination of upper and lower case characters . If you then use this pattern to write files to a directory on a remote FTP server, and this is running on a platform which does not respect case sensitivity, such as Windows, the file name written will not be as specified in your pattern; it will be in upper case. If a name of a file on a remote FTP server contains a character, or characters, which are invalid on the platform on which the broker where you specified the file name pattern is running, the file is not transferred from the FTP server for processing by the FileInput node.
mqsiarchive subdirectory This topic describes the mqsiarchive subdirectory and the circumstances in which files are placed there. The input directory of the FileInput node has a subdirectory called mqsiarchive. The output directory of the FileOutput node also has a subdirectory called mqsiarchive.
FileInput node’s mqsiarchive subdirectory Files that are processed successfully by the FileInput node are moved to the mqsiarchive subdirectory if the FileInput node’s Action on successful processing property is set to Move to Archive Subdirectory or Add Timestamp and Move to Archive Subdirectory. Select the Replace duplicate archive files check box to ensure that should a file of the same name exist already in the mqsiarchive subdirectory as one that is about to be moved to the mqsiarchive subdirectory, the file that exists already is replaced. If you do not set this option, and a file with the same name already exists in the archive subdirectory, the node stops processing files. Every time that the node returns from its polling wait period, it issues a pair of messages, BIP3331 and a more specific one describing the problem. To avoid flooding the broker event log, duplicate messages are suppressed for an increasing period of time, until eventually they are issued about once every hour. In this circumstance, the system administrator must stop the flow, correct the problem, and then restart the flow.
782
Message Flows
Clear the Replace duplicate archive files check box only if you are sure either that the input files have unique names, or that some other process will remove a file from the archive directory before the FileInput node processes another of the same name. If you cannot ensure this, either specify Add Timestamp and Move to Archive Subdirectory in the Action on successful processing property so that archived files have unique names, or select the Replace duplicate archive files check box
FileOutput node’s mqsiarchive subdirectory Files that are processed successfully by the FileOutput node are moved to the mqsiarchive subdirectory if the FileOutput node’s Output file action property is set to Archive and Replace Existing File or Time Stamp, Archive and Replace Existing File. If you select the Replace duplicate archive files check box, that means that should a file of the same name exist already in the mqsiarchive subdirectory as one that is about to be moved to the mqsiarchive subdirectory, the file that exists already is replaced. If you do not set this option, and a file with the same name already exists in the archive subdirectory, the node experiences an exception when it tries to move the successfully processed file; the file that the node is trying to move to the mqsiarchive subdirectory remains in the transit subdirectory.
Reading a file This section introduces examples of using a FileInput node to read files. The first example shows you how to read a file on your local file system. The second example shows you how to read a file in a directory on a remote FTP server. The third topic in this section shows a number of examples of how combinations of different values in the Record detection, Delimiter, and Delimiter type properties propagate messages with different structures. This third topic is a series of variations of the examples in the first two topics. This section contains the following topics: v “Reading a file on your local file system” v “Reading a file on a remote FTP directory” on page 785 v “Reading a file, effects of different values in the FileInput node’s Record detection property” on page 787
Reading a file on your local file system This topic gives you an example of how to use a FileInput node to read a file on your local file system and then propagate messages that are based on the contents of that file. It shows how one combination of values in the Record detection, Delimiter, and Delimiter type properties can be used to extract messages from a file. This example describes the FileInput node of a message flow and assumes that the rest of the flow has already been developed. It is also assumed that a Windows system is being used. To complete this example task, you must first have added a FileInput node to a message flow. You also need to ensure that you have the following resources available: v An input file. To follow this example scenario, create an input file called test_input1.xml with the following content:
Working with files
783
<Message>test1 <Message>testtwo <Message>testthree
Each line ends with a line terminator; on a Windows system, this comprises carriage return and line feed characters (X’0D0A’). Put this file into directory C:\FileInput\TestDir. v A message set. This example uses a message set called xml1 which uses the XMLNSC parser. Message set xml1 models messages of the following form: <Message>...
Once you have these resources available, perform the following steps: 1. Set the required node properties on the FileInput node. The following table summarizes the FileInput node properties that you should set, which tab they appear on and the value that you should set in order to follow this example: Table 16. Tab
Property
Value
Basic
Input directory
C:\FileInput\TestDir
File name or pattern
test_input1.xml
Action on successful processing
Move to Archive Subdirectory
Replace duplicate archive files
Selected
Message domain
XMLNSC
Message set
xml1
Polling
Polling interval
3
Retry
Action on failing file
Add Time Stamp and Move to Backout Subdirectory
Records and Elements
Record detection
Delimited
Delimiter
DOS or UNIX Line End
Delimiter type
Postfix
FTP
Not selected
Input Message Parsing
FTP
2. Deploy the message flow to the broker. The following actions occur when you perform these steps: 1. The file is processed. In accordance with the values set in the properties on the Records and Elements tab, the FileInput node detects records that end with a DOS or UNIX line end and creates a message for each one that it finds. It propagates three messages to the flow attached to the Out terminal: v Message 1: <Message>test1
v Message 2: <Message>testtwo
v Message 3: <Message>testthree
2. If there is a flow attached to the End of Data terminal, the End of Data message is propagated after the last record in the file has been processed.
784
Message Flows
3. On completion of processing, the file test_input1.xml is moved to the mqsiarchive subdirectory, C:\FileInput\TestDir\mqsiarchive\test_input1.xml. If a file called test_input1.xml already exists in the mqsiarchive subdirectory, it is overwritten. 4. If the message flow fails, retry processing is attempted according to the values set in the properties of the FileInput node. In this example task, a time stamp is added to the file name and the file is moved to the mqsibackout directory. Here is an example of the path to such a file: C:\FileInput\TestDir\mqsibackout\ 20070928_150234_171021_test_input1.xml. To see the effects of specifying other combinations of values in the Record detection, Delimiter, and Delimiter type properties of the FileInput node, see “Reading a file, effects of different values in the FileInput node’s Record detection property” on page 787. The following samples also provide examples of how to use this node: v Batch Processing sample v WildcardMatch sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Reading a file on a remote FTP directory Use a FileInput node to read a file in a directory on a remote FTP server and then propagate messages that are based on the contents of that file. Before you start: This example is an extension of the example described in “Reading a file on your local file system” on page 783 and it describes the FileInput node of an example message flow. The example assumes that the rest of the message flow has already been developed and that a Windows system is being used. To complete this example task, you must first have added a FileInput node to a message flow. You also need to ensure that you have the following resources available: v An FTP server. Ensure that an FTP server exists that has the following settings: Server ftpserver.hursley.abc.com Port
21
Working directory /ftpfileinput Userid myuserid Password mypassword These values are for the purposes of this example only. If you use other values, record them so that you can set the appropriate values late in this example. v A security identity. Use the mqsisetdbparms command to define a security identity called, in this example, myidentity for the user and password details above. For example, use the following command for a broker called MyBroker: mqsisetdbparms MyBroker -n ftp::myidentity -u myuserid -p mypassword
Working with files
785
Notice the ftp:: prefix, which is required so that file nodes can find the security identity definition. v An input file. To follow this example scenario, create an input file called test_input1.xml with the following content: <Message>test1 <Message>testtwo <Message>testthree
Each line ends with a line terminator that is suitable for the system on which the FTP server is found. Do not put this file in the input directory but, instead, put it on the FTP server directory /ftpfileinput. v A message set. This example uses a message set called xml1, which uses the XMLNSC parser. Message set xml1 models messages of the following form: <Message>...
When you have these resources, perform the following steps: 1. Set the required node properties on the FileInput node. The following table summarizes the FileInput node properties that you should set, which tab they appear on, whether they are mandatory, and the value that you should set in order to follow this example. Tab
Property
Value
Basic
Input directory
C:\FileInput\TestDir
File name or pattern
test_input1.xml
Action on successful processing
Move to Archive Subdirectory
Replace duplicate archive files
Selected
Input Message Parsing
Message domain
XMLNSC
Message set
xml1
Polling
Polling interval
3
Retry
Action on failing file
Add Time Stamp and Move to Backout Subdirectory
Records and Elements
Record detection
Delimited
Delimiter
DOS or UNIX Line End
Delimiter type
Postfix
FTP
Selected
FTP server and port
ftpserver.hursley.abc.com
Security identity
myidentity
Server directory
/ftpfileinput
Transfer mode
ASCII
Scan delay
45
FTP
If you used other values for your FTP server resource, use those values. These settings are identical to those used in the example in “Reading a file on your local file system” on page 783, except that the FTP property has been selected and there are now properties on the FTP tab. If you clear the FTP check box, the node behaves as it does in the example in “Reading a file on your local file system” on page 783; the FTP properties remain set but have no effect. 2. Deploy the message flow to the broker. The following actions occur when you perform these steps:
786
Message Flows
1. The file test_input1.xml is transferred from the FTP server directory (/ftpfileinput) to the local directory (C:\FileInput\TestDir). The file is deleted from the FTP server directory. 2. In accordance with the values set in the properties on the Records and elements tab, the FileInput node detects records that end with a DOS or UNIX line end and creates a message for each one that it finds. It propagates three messages to the message flow that is attached to the Out terminal: v Message 1: <Message>test1
v Message 2: <Message>testtwo
v Message 3: <Message>testthree
3. Because the FTP check box is selected, the FTP scan delay of 45 seconds overrides the polling interval of 3 seconds. 4. If there is a node attached to the End of Data terminal, the End of Data message is propagated after the last record in the file has been processed. 5. On completion of processing, the file test_input1.xml is moved to the mqsiarchive subdirectory C:\FileInput\TestDir\mqsiarchive\test_input1.xml. If a file called test_input1.xml already exists in the mqsiarchive subdirectory, it is overwritten. 6. If the message flow fails, retry processing is attempted according to the values set in the properties of the FileInput node. In this example task, a time stamp is added to the file name and the file is moved to the mqsibackout directory. Here is an example of the path to such a file: C:\FileInput\TestDir\mqsibackout\ 20070928_150234_171021_test_input1.xml. | | |
If an error occurs on the FTP side, stating that access is denied, a 0–byte file is created and moved to the mqsibackout directory. A 0–byte file is created in the mqsibackout directory for every FTP attempt that fails. To see the effects of specifying other combinations of values in the Record detection, Delimiter, and Delimiter type properties of the FileInput node, see “Reading a file, effects of different values in the FileInput node’s Record detection property.” The following samples also provide examples of how to use this node: v Batch Processing sample v WildcardMatch sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Reading a file, effects of different values in the FileInput node’s Record detection property This topic demonstrates the effect of different settings of the properties on the FileInput node’s Records and Elements tab. The examples described in this topic are based on the examples described in “Reading a file on your local file system” on page 783 and “Reading a file on a remote FTP directory” on page 785. In each case, the input file to use, the property settings, and the expected results are described.
Working with files
787
Example 1. Records read are separated by a DOS or UNIX line end This example is identical to the one described in “Reading a file on your local file system” on page 783 or “Reading a file on a remote FTP directory” on page 785. Create an input file called test_input1.xml with the following content: <Message>test1 <Message>testtwo <Message>testthree
Each line ends with a line terminator; on a Windows system, this comprises carriage return and line feed characters (X’0D0A’). The properties to set are: Table 17. Tab
Property
Value
Records and Elements
Record detection
Delimited
Delimiter
DOS or UNIX Line End
Delimiter type
Postfix
The FileInput node detects records that end with a DOS or UNIX line end and creates a message for each one that it finds. The result is the propagation of three messages, as follows: v Message 1: <Message>test1
v Message 2: <Message>testtwo
v Message 3: <Message>testthree
The DOS or UNIX line end is not part of any propagated message.
Example 2. Records read are separated by a custom delimiter Create an input file called test_input2.xml with the following content: <Message>test01,<Message>test001,<Message>test0001
There should be no line terminator at the end of this file data; the XMLNSC parser ignores the line terminator if it is present. In addition to the property settings described in “Reading a file on your local file system” on page 783 or “Reading a file on a remote FTP directory” on page 785, set these properties: Table 18.
788
Message Flows
Tab
Property
Value
Basic
File name or pattern
test_input2.xml
Table 18. (continued) Tab
Property
Value
Records and Elements
Record detection
Delimited
Delimiter
Custom Delimiter
Custom delimiter
2C
Delimiter type
Infix
The hexadecimal X’2C’ represents a comma in ASCII. On other systems, a different hexadecimal code might need to be used. The FileInput node detects the comma character and separates records with it. Because the value of the Delimiter type property is Infix, there need not be a comma at the end of the file. The result is the propagation of three messages, as follows: v Message 1: <Message>test01
v Message 2: <Message>test001
v Message 3: <Message>test0001
The comma character is not part of any propagated message. There are no commas in the bodies of the message in this example; if there were commas in the message bodies, the records would be split at those points resulting in incorrectly formed messages being propagated to the rest of the flow.
Example 3. Records read are separated by a fixed number of bytes Create an input file called test_input3.xml with the following content: <Message>123456789<Message>abcdefghi<Message>rstuvwxyz
There should be no line terminator at the end of this file. In addition to the property settings described in “Reading a file on your local file system” on page 783 or “Reading a file on a remote FTP directory” on page 785, set these properties: Table 19. Tab
Property
Value
Basic
File name or pattern
test_input3.xml
Records and Elements
Record detection
Fixed Length
Length
28
The FileInput node segments the input file into records each 28 bytes in length. The result is the propagation of three messages, as follows: v Message 1: <Message>123456789 Working with files
789
v Message 2: <Message>abcdefghi
v Message 3: <Message>rstuvwxyz
Each message is 28 bytes long. If the file were to contain trailing bytes, for example a carriage return-line feed pair, these would result in the propagation of a further message containing these bytes; this may or may not be recognized by the message domain, message set and message type assigned to parse the message.
Example 4. Records read are whole files Create an input file called test_input4.xml with the following content: <Message>Text string of a length decided by you, even including line terminators, as long as it only contains this tag at the end.
There should be no line terminator at the end of this file; if there is one, it has no effect. In addition to the property settings described in “Reading a file on your local file system” on page 783 or “Reading a file on a remote FTP directory” on page 785, set these properties: Table 20. Tab
Property
Value
Basic
File name or pattern
test_input4.xml
Records and Elements
Record detection
Whole File
The FileInput node does not split the file; it supplies all of the file’s content to be parsed by the message domain, message set and message type as specified on the node. In this example, you are using the XMLNSC parser and message set xml1 and the message should be recognized. The result is the propagation of one message, as follows: v Message 1: <Message>Text string of a length decided by you, even including line terminators, as long as it only contains this tag at the end.
Trailing bytes (for example, line terminators) are included in this.
Example 5. Records read are recognized as separate messages by the parser specified in the Message domain property Create an input file called test_input5.xml with the following content: <Message>Text string of a length decided by you<Message>and another <Message>and another on a new line
Line terminators at the end of this file, or at the end of lines, are acceptable. In addition to the property settings described in “Reading a file on your local file system” on page 783 or “Reading a file on a remote FTP directory” on page 785, set these properties:
790
Message Flows
Table 21. Tab
Property
Value
Basic
File name or pattern
test_input5.xml
Records and Elements
Record detection
Parsed Record Sequence
The FileInput node defers to the parser to determine the record boundaries. In this example, message set xml1 in domain XMLNSC should recognize the complete <Message> XML format. XMLNSC absorbs trailing white space (for example, line terminators). The result is the propagation of three messages, as follows: v Message 1: <Message>Text string of a length decided by you
v Message 2: <Message>and another
v Message 3: <Message>and another on a new line
Trailing white space (for example, line terminators) are included in these.
Writing a file This section introduces examples of using a FileOutput node to write files. The first example shows you how to write a file to a directory in your local file system. The second example shows you how to write a file to a directory on a remote FTP server. The third topic in this section shows a number of examples of how combinations of different values in the Record definition, Delimiter, and Delimiter type properties, acting on the same input messages, result in the creation of files with different structures. This third topic is a series of variations of the examples in the first two topics. This section contains the following topics: v “Writing a file to your local file system” v “Writing a file to a remote FTP server” on page 793 v “Writing a file, effects of different values in the FileOutput node’s Record definition property” on page 796
Writing a file to your local file system This topic gives you an example of how to use a FileOutput node to write a file to a specified directory on your local file system. It shows you how one combination of values in the Record definition, Delimiter, and Delimiter type properties result in the creation of a file from multiple messages. This example describes the FileOutput node of a message flow and assumes that the rest of the flow has been developed. It is also assumed that a Windows system is being used. To complete this example task, you must first have added a FileOutput node to a message flow. You also need to ensure that the following messages are produced by the flow preceding the FileOutput node: v Three input messages. These are to be sent, in this order, to the In terminal of the FileOutput node: – Message 1: Working with files
791
<Message>test1
– Message 2: <Message>testtwo
– Message 3: <Message>testthree
These can be produced, for example, by the XMLNSC domain with a message set which recognizes XML with the following form: <Message>...
v A final message. This is to be sent to the Finish File terminal of the FileOutput node after the first three messages have been sent: anything
Once you have these resources available, perform the following steps: 1. Set the required node properties on the FileOutput node. The following table summarizes the FileOutput node properties that you should set, which tab they appear on, and the value that you should set in order to follow this example: Table 22. Tab
Property
Value
Basic
Directory
C:\FileOutput\TestDir
File name or pattern
test_output1.xml
Output file action
Time Stamp, Archive and Replace Existing File (or Create if File does not Exist)
Replace duplicate archive files
Selected
Record definition
Record is Delimited Data
Delimiter
Broker System Line End
Delimiter type
Postfix
FTP
Cleared
Records and Elements
FTP
2. Deploy the message flow to the broker. 3. Send the first three messages to the In terminal of the FileOutput node. 4. Send the final message to the Finish File terminal of the FileOutput node. The following actions occur when you perform these steps: 1. The file is processed. In accordance with the values set in the properties of the FileOutput node, the node generates one record per message with a local file system line terminator after each one. The file contains the following data, each line terminated by a carriage return (X’0D’) and line feed (X’0A’) pair of characters (on a Windows system): <Message>test1 <Message>testtwo <Message>testthree
2. Records are accumulated in a file in the C:\FileOutput\TestDir\mqsitransit directory. This file is named test_output1.xml. When the final message is sent to the Finish File terminal, the file is moved to the output directory, C:\FileOutput\TestDir directory.
792
Message Flows
3. If a file of the same name already exists in the output directory, the existing file is renamed and moved to the mqsiarchive directory. For example, this might result in the file: C:\FileOutput\TestDir\mqsiarchive\20070924_155346_312030_test_output1.xml being created. If a file of this name already exists in this archive directory, it is overwritten in accordance with the Replace duplicate archive files property selected on the FileOutput node. Now see “Writing a file, effects of different values in the FileOutput node’s Record definition property” on page 796 to see the results of running this task with different values set in the Record definition, Delimiter, and Delimiter type properties of the FileOutput node. The following samples also provide examples of how to use this node: v File Output sample v Batch Processing sample v WildcardMatch sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Writing a file to a remote FTP server This topic gives you an example of how to use a FileOutput node to write a file to a directory on a remote FTP server. It shows you how one combination of values in the Record definition, Delimiter, and Delimiter type properties result in the creation of a file from multiple messages. This example is an extension of the example described in “Writing a file to your local file system” on page 791 and it describes the FileOutput node of a message flow. It assumes that the rest of the flow has already been developed and that a Windows system is being used. To complete this example task, you must first have added a FileOutput node to a message flow. You also need to ensure that you have the following resources available: v An FTP server. Ensure that an FTP server exists and which, in order that you may follow this example scenario, has the following settings: Server ftpserver.hursley.abc.com Port
21
Working directory /ftpfileoutput Userid myuserid Password mypassword These values are for the purposes only of this example. If you use other values, record them so that you can set the appropriate values below. This example uses the values above. v A security identity. Use the mqsisetdbparms command to define a security identity called, in this example, myidentity for the user and password details above. For example, use the following command for a broker called MyBroker: Working with files
793
mqsisetdbparms MyBroker -n ftp::myidentity -u myuserid -p mypassword
Notice the ftp:: prefix which is required so that file nodes can find the security identity definition. v Arrange for the following messages which to be produced by the flow preceding the FileOutput node: – Three input messages. These are to be sent, in this order, to the In terminal of the FileOutput node: - Message 1: <Message>test1
- Message 2: <Message>testtwo
- Message 3: <Message>testthree
These can be produced, for example, by the XMLNSC domain with a message set which recognizes XML with the following form: <Message>...
– A final message. This is to be sent to the Finish File terminal of the FileOutput node after the first three messages have been sent: anything
Once you have these resources available, perform the following steps: 1. Set the required node properties on the FileOutput node. The following table summarizes the FileOutput node properties that you should set, which tab they appear on, and the value that you should set in order to follow this example: Table 23. Tab
Property
Basic
Directory
C:\FileOutput\TestDir
File name or pattern
test_output1.xml
Output file action
Time Stamp, Archive and Replace Existing File (or Create if File does not Exist)
Replace duplicate archive files
Selected
Record definition
Record is Delimited Data
Delimiter
Broker System Line End
Delimiter type
Postfix
FTP
Selected
FTP server and port
ftpserver.hursley.abc.com
Security identity
myidentity
Server directory
/ftpfileoutput
Transfer mode
ASCII
Records and Elements
FTP
Value
Retain local file after transfer Selected
If you used other values for your FTP server resource, use those values. These settings are identical to those used in the example in “Writing a file to your local file system” on page 791 except that the FTP property has been selected and there are now properties on the FTP tab. If you clear the FTP check box,
794
Message Flows
the node behaves as it does in the example in “Writing a file to your local file system” on page 791; the FTP properties remain set but have no effect. 2. Deploy the message flow to the broker. 3. Send the first three messages to the In terminal of the FileOutput node. 4. Send the final message to the Finish File terminal of the FileOutput node. The following actions occur when you perform these steps: 1. The file is processed. In accordance with the values set in the properties of the FileOutput node, the node generates one record per message with a local file system line terminator after each one. The file contains the following data, each line terminated by a carriage return (X’0D’) and line feed (X’0A’) pair of characters (on a Windows system): <Message>test1 <Message>testtwo <Message>testthree
. 2. Records are accumulated in a file in the C:\FileOutput\TestDir\mqsitransit directory. This file is named test_output1.xml. When the final message is sent to the Finish File terminal, and because the FTP check box is selected, the file is moved to the remote FTP server directory, resulting in the file/ftpfileoutput/ test_output1.xml. 3. If a file of the same name already exists in the remote FTP server directory, the existing file is overwritten. If the remote FTP server is not running on a Windows system and the Transfer mode property is set to ASCII, the character encoding and line terminator characters can be modified after transfer. For example, on a z/OS FTP server, the ASCII text is normally converted to EBCDIC and the line terminator character pairs replaced by EBCDIC new line character (X’15’). Other FTP servers might treat ASCII transfers differently. 4. Because the Retain local file after transfer check box is selected, the local file is not deleted but is moved from the mqsitransit subdirectory to the output directory, C:\FileOutput\TestDir. If a file of the same name already exists in the output directory, the existing file is renamed and moved to the mqsiarchive directory. For example, this might result in the file: C:\FileOutput\TestDir\mqsiarchive\20070924_155346_312030_test_output1.xml being created. However, if a file of this name already exists in this archive directory, it is overwritten in accordance with the value of the Replace duplicate archive files property set on the FileOutput node. Now see “Writing a file, effects of different values in the FileOutput node’s Record definition property” on page 796 to see the results of running this task with different values set in the Record definition, Delimiter, and Delimiter type properties of the FileOutput node. The following samples also provide examples of how to use this node: v File Output sample v Batch Processing sample v WildcardMatch sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Working with files
795
Writing a file, effects of different values in the FileOutput node’s Record definition property This topic demonstrates the effect of different settings of the properties on the FileOutput node’s Records and Elements tab. The examples described in this topic are based on the examples described in “Writing a file to your local file system” on page 791 and “Writing a file to a remote FTP server” on page 793. In all examples, it is assumed that the same messages are sent to the FileOutput node; three to the In terminal and one to the Finish File terminal: v Three input messages. These are to be sent, in this order, to the In terminal of the FileOutput node: – Message 1: <Message>test1
– Message 2: <Message>testtwo
– Message 3: <Message>testthree
These can be produced, for example, by the XMLNSC domain with a message set which recognizes XML with the following form: <Message>...
v A final message. This is to be sent to the Finish File terminal of the FileOutput node after the first three messages have been sent. It does not matter what this message contains The following examples describe the contents of the file or files produced; the disposition of the files created is as in the “Writing a file to your local file system” on page 791 and “Writing a file to a remote FTP server” on page 793 topics.
Example 1. Records written are separated by a DOS or UNIX line end This example is identical to the one described in “Writing a file to your local file system” on page 791 or “Writing a file to a remote FTP server” on page 793. Specify the node’s properties as described in “Writing a file to your local file system” on page 791 or “Writing a file to a remote FTP server” on page 793. This results in one file being written. The file contains three records each terminated by a local system line terminator; on a Windows system, this is a carriage return line feed pair (X’0D0A’). <Message>test1 <Message>testtwo <Message>testthree
Example 2. Records written are separated by a custom delimiter In addition to the property settings described in “Writing a file to your local file system” on page 791 or “Writing a file to a remote FTP server” on page 793, set these properties on the Records and Elements tab as follows:
796
Message Flows
Table 24. Property
Value
Record definition
Record is Delimited Data
Delimiter
Custom Delimiter
Custom delimiter
0D0A
Delimiter type
Postfix
The hexadecimal X’0D0A’ represents a carriage return character followed by a line feed character. On a Windows system, this results in a file identical to the one created in Example 1. On other systems, the result may differ to the result in Example 1; Example 1 uses local system line end characters, whereas Example 2 always puts the X’0D0A’ sequence at the end of each line.
Example 3. Records written are padded to a fixed length In addition to the property settings described in “Writing a file to your local file system” on page 791 or “Writing a file to a remote FTP server” on page 793, set these properties on the Records and Elements tab as follows: Table 25. Property
Value
Record definition
Record is Fixed Length Data
Length (bytes)
30
Padding bytes (hexadecimal)
2A
The hexadecimal character X’2A’ represents an asterisk character in ASCII. The length of each incoming message is 24 bytes, 26 bytes, and 28 bytes respectively. The required fixed length of each record is 30 bytes. Each record is, therefore, padded by an extra 6 bytes, 4 bytes, or 2 bytes, with the hexadecimal character X’2A’ which represents an asterisk character in ASCII. One file is written. It contains a single line: <Message>test1******<Message>testtwo****<Message>testthree**
Example 4. Records written are not separated by delimiters or padding In addition to the property settings described in “Writing a file to your local file system” on page 791 or “Writing a file to a remote FTP server” on page 793, set this property on the Records and Elements tab as follows: Table 26. Property
Value
Record definition
Record is Unmodified Data
The records are concatenated with no padding or delimiters. One file is written with the following content: <Message>test1<Message>testtwo<Message>testthree
Working with files
797
There are no trailing bytes or line terminators.
Example 5. Records are written as whole files In addition to the property settings described in “Writing a file to your local file system” on page 791 or “Writing a file to a remote FTP server” on page 793, set this property on the Records and Elements tab as follows: Table 27. Property
Value
Record definition
Record is Whole File
This results in three files being created, each containing one record: v File 1: <Message>test1
v File 2: <Message>testtwo
v File 3: <Message>testthree
Each of these files is created with the same name, one by one, in the mqsitransit directory. If you are following the example in “Writing a file to a remote FTP server” on page 793, each file is transferred to the remote FTP server. However, because each file overwrites the previous one, only the third file remains when the task is complete. After optional transfer, if a copy is retained, each file is moved to the output directory, C:\FileOutput\TestDir. In accordance with the properties on the FileOutput node as described in “Writing a file to your local file system” on page 791 or “Writing a file to a remote FTP server” on page 793, the second file moved displaces the first file form the output directory and moved to the mqsiarchive subdirectory; this displaced file is also renamed. When the third file is moved to the output directory, it displaces the second file, causing it to be moved to the mqsiarchive subdirectory and renamed. The final result is files similar to these: C:\FileOutput\TestDir\mqsiarchive\20071101_165346_312030_test_output1.xml C:\FileOutput\TestDir\mqsiarchive\20071101_165347_312030_test_output1.xml C:\FileOutput\TestDir\test_output1.xml
being File 1, File 2, and File 3 respectively. If FTP processing were enabled, File 3 would also be in the remote FTP server directory and called test_output1.xml.
798
Message Flows
Part 4. Reference
|
|
Message flows . . . . . . . . . Message flow preferences . . . . . . Description properties for a message flow . Guidance for defining keywords . . . Built-in nodes . . . . . . . . . . AggregateControl node . . . . . . AggregateReply node. . . . . . . AggregateRequest node . . . . . . Check node . . . . . . . . . . Collector node . . . . . . . . . Compute node . . . . . . . . . Database node . . . . . . . . . DatabaseRetrieve node . . . . . . DatabaseRoute node . . . . . . . DataDelete node . . . . . . . . DataInsert node . . . . . . . . DataUpdate node . . . . . . . . EmailOutput node. . . . . . . . EndpointLookup node . . . . . . Extract node. . . . . . . . . . FileInput node . . . . . . . . . FileOutput node . . . . . . . . Filter node . . . . . . . . . . FlowOrder node . . . . . . . . HTTPHeader node . . . . . . . HTTPInput node . . . . . . . . HTTPReply node . . . . . . . . HTTPRequest node . . . . . . . IMSRequest node . . . . . . . . Input node . . . . . . . . . . JavaCompute node . . . . . . . JMSHeader node . . . . . . . . JMSInput node . . . . . . . . . JMSMQTransform node . . . . . . JMSOutput node . . . . . . . . JMSReply node . . . . . . . . . Label node . . . . . . . . . . Mapping node . . . . . . . . . MQeInput node . . . . . . . . MQeOutput node . . . . . . . . MQGet node . . . . . . . . . MQHeader node . . . . . . . . MQInput node . . . . . . . . MQJMSTransform node . . . . . MQOptimizedFlow node . . . . . MQOutput node . . . . . . . . MQReply node . . . . . . . . Output node . . . . . . . . . Passthrough node . . . . . . . PeopleSoftInput node . . . . . . PeopleSoftRequest node . . . . . PHPCompute node . . . . . . . Publication node . . . . . . . . Real-timeInput node. . . . . . . Real-timeOptimizedFlow node . . . RegistryLookup node . . . . . . © Copyright IBM Corp. 2000, 2008
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 803 . 803 . 803 . 804 . 806 . 808 . 810 . 813 . 815 . 817 . 823 . 831 . 835 . 844 . 852 . 855 . 858 . 861 . 867 . 870 . 872 . 886 . 896 . 900 . 902 . 906 . 913 . 915 . 929 . 935 . 937 . 940 . 943 . 955 . 956 . 967 . 971 . 973 . 978 . 986 . 989 . 1000 . 1005 . 1017 . 1019 . 1021 . 1028 . 1032 . 1034 . 1035 . 1039 . 1042 . 1045 . 1047 . 1050 . 1052
|
ResetContentDescriptor node . . . . . . . Route node. . . . . . . . . . . . . RouteToLabel node . . . . . . . . . . SAPInput node . . . . . . . . . . . SAPRequest node . . . . . . . . . . SCADAInput node . . . . . . . . . . SCADAOutput node . . . . . . . . . SiebelInput node . . . . . . . . . . . SiebelRequest node . . . . . . . . . . SOAPAsyncRequest node . . . . . . . . SOAPAsyncResponse node . . . . . . . SOAPEnvelope node . . . . . . . . . SOAPExtract node . . . . . . . . . . SOAPInput node . . . . . . . . . . . SOAPReply node . . . . . . . . . . . SOAPRequest node . . . . . . . . . . TCPIPClientInput node. . . . . . . . . TCPIPClientOutput node . . . . . . . . TCPIPClientReceive node . . . . . . . . TCPIPServerInput node . . . . . . . . TCPIPServerOutput node . . . . . . . . TCPIPServerReceive node . . . . . . . . Throw node . . . . . . . . . . . . TimeoutControl node . . . . . . . . . TimeoutNotification node . . . . . . . . Trace node . . . . . . . . . . . . . TryCatch node . . . . . . . . . . . TwineballInput node . . . . . . . . . TwineballRequest node . . . . . . . . . Validate node . . . . . . . . . . . . Warehouse node . . . . . . . . . . . XSLTransform node . . . . . . . . . . User-defined nodes . . . . . . . . . . . WebSphere Adapters properties . . . . . . . WebSphere Adapter for SAP properties . . . WebSphere Adapter for Siebel properties . . . WebSphere Adapter for PeopleSoft properties Supported code pages . . . . . . . . . . Chinese code page GB18030 . . . . . . . WebSphere MQ connections . . . . . . . . Listing database connections that the broker holds Quiescing a database . . . . . . . . . . Support for Unicode and DBCS data in databases Unicode string functions in DB2. . . . . . Data integrity within message flows . . . . . Validation properties . . . . . . . . . . Validation tab properties . . . . . . . . Parser Options tab properties. . . . . . . Parsing on demand . . . . . . . . . . . Exception list structure . . . . . . . . . . Database exception trace output . . . . . . Conversion exception trace output . . . . . Parser exception trace output. . . . . . . User exception trace output . . . . . . . Configurable message flow properties . . . . . Message flow porting considerations . . . . .
1055 1061 1064 1066 1070 1073 1080 1083 1086 1089 1099 1104 1107 1112 1122 1124 1134 1146 1155 1166 1177 1186 1197 1199 1202 1206 1210 1212 1216 1218 1222 1225 1235 1235 1235 1311 1333 1353 1381 1381 1382 1382 1382 1384 1385 1385 1386 1388 1389 1390 1392 1394 1396 1396 1398 1400
799
| Monitoring profile . . . . . . . . . . . 1401 The monitoring event . . . . . . . . . . Message flow accounting and statistics data . . . Message flow accounting and statistics details Message flow accounting and statistics output formats . . . . . . . . . . . . . . Example message flow accounting and statistics data . . . . . . . . . . . . Coordinated message flows . . . . . . . . Database connections for coordinated message flows . . . . . . . . . . . . . . . Database support for coordinated message flows . . . . . . . . . . . . . . . Element definitions for message parsers . . . . Data types of fields and elements . . . . . The MQCFH parser . . . . . . . . . . The MQCIH parser . . . . . . . . . . The MQDLH parser . . . . . . . . . . The MQIIH parser . . . . . . . . . . The MQMD parser . . . . . . . . . . The MQMDE parser. . . . . . . . . . The MQRFH parser . . . . . . . . . . The MQRFH2 and MQRFH2C parsers. . . . The MQRMH parser . . . . . . . . . The MQSAPH parser . . . . . . . . . The MQWIH parser . . . . . . . . . . The SMQ_BMH parser . . . . . . . . . Message mappings . . . . . . . . . . . Message Mapping editor . . . . . . . . Mapping node . . . . . . . . . . . Migrating message mappings from Version 5.0 Restrictions on migrating message mappings XML constructs . . . . . . . . . . . . Example XML message . . . . . . . . . The XML declaration . . . . . . . . . The XML message body . . . . . . . . XML document type declaration. . . . . . Data sources on z/OS . . . . . . . . . .
1406 1408 1408 1409 1420 1424 1424 1424 1425 1425 1429 1429 1430 1430 1431 1432 1433 1433 1433 1434 1434 1435 1435 1436 1446 1457 1458 1462 1462 1463 1464 1469 1477
ESQL reference. . . . . . . . . . . . 1479 Syntax diagrams: available types . . . . . . 1480 ESQL data types in message flows . . . . . . 1480 ESQL BOOLEAN data type . . . . . . . 1480 ESQL datetime data types . . . . . . . . 1480 ESQL NULL data type . . . . . . . . . 1485 ESQL numeric data types . . . . . . . . 1486 ESQL REFERENCE data type . . . . . . 1488 ESQL ROW data type . . . . . . . . . 1488 ESQL string data types . . . . . . . . . 1489 ESQL-to-Java data-type mapping table . . . 1490 ESQL-to-XPath mapping table . . . . . . 1491 XPath property editors . . . . . . . . . 1492 ESQL variables . . . . . . . . . . . . 1493 ESQL field reference overview . . . . . . . 1493 Namespace . . . . . . . . . . . . . 1495 Index. . . . . . . . . . . . . . . 1496 Type . . . . . . . . . . . . . . . 1497 Field references summary . . . . . . . . 1498 Target field references . . . . . . . . . 1499 The effect of setting a field to NULL . . . . 1500 ESQL operators . . . . . . . . . . . . 1500
800
Message Flows
ESQL simple comparison operators. . . . . ESQL complex comparison operators . . . . ESQL logical operators . . . . . . . . . ESQL numeric operators . . . . . . . . ESQL string operator . . . . . . . . . Rules for ESQL operator precedence . . . . ESQL statements . . . . . . . . . . . . ATTACH statement . . . . . . . . . . BEGIN ... END statement . . . . . . . . BROKER SCHEMA statement . . . . . . CALL statement . . . . . . . . . . . CASE statement . . . . . . . . . . . CREATE statement . . . . . . . . . . CREATE FUNCTION statement . . . . . . CREATE MODULE statement . . . . . . CREATE PROCEDURE statement . . . . . DECLARE statement . . . . . . . . . DECLARE HANDLER statement . . . . . DELETE FROM statement . . . . . . . . DELETE statement . . . . . . . . . . DETACH statement . . . . . . . . . . EVAL statement . . . . . . . . . . . FOR statement . . . . . . . . . . . IF statement . . . . . . . . . . . . INSERT statement . . . . . . . . . . ITERATE statement . . . . . . . . . . LEAVE statement. . . . . . . . . . . LOG statement . . . . . . . . . . . LOOP statement . . . . . . . . . . . MOVE statement . . . . . . . . . . . PASSTHRU statement . . . . . . . . . PROPAGATE statement . . . . . . . . REPEAT statement . . . . . . . . . . RESIGNAL statement . . . . . . . . . RETURN statement . . . . . . . . . . SET statement . . . . . . . . . . . . THROW statement . . . . . . . . . . UPDATE statement . . . . . . . . . . WHILE statement . . . . . . . . . . ESQL functions: reference material, organized by function type . . . . . . . . . . . . . Calling ESQL functions. . . . . . . . . ESQL database state functions . . . . . . ESQL datetime functions . . . . . . . . ESQL numeric functions . . . . . . . . ESQL string manipulation functions . . . . ESQL field functions . . . . . . . . . ESQL list functions . . . . . . . . . . Complex ESQL functions . . . . . . . . Miscellaneous ESQL functions . . . . . . ESQL constants . . . . . . . . . . . . Broker properties that are accessible from ESQL and Java . . . . . . . . . . . . . . Special characters, case sensitivity, and comments in ESQL . . . . . . . . . . . . . . . ESQL reserved keywords . . . . . . . . . ESQL non-reserved keywords . . . . . . . Example message . . . . . . . . . . .
1500 1502 1504 1505 1506 1506 1507 1508 1510 1512 1515 1518 1520 1528 1537 1539 1553 1558 1560 1562 1562 1563 1564 1565 1566 1570 1571 1572 1573 1574 1576 1578 1581 1582 1583 1585 1587 1589 1592 1592 1595 1596 1600 1605 1620 1633 1644 1646 1688 1692 1693 1696 1698 1698 1701
Message mappings . . . . . . . . . . 1703 Message Mapping editor . . . . . . . . . 1703
Message Mapping editor Source pane . . . Message Mapping editor Target pane . . . Message Mapping editor Edit pane. . . . Message Mapping editor Spreadsheet pane Mapping node . . . . . . . . . . . Mapping node syntax . . . . . . . . Mapping node functions . . . . . . . Mapping node casts . . . . . . . . . Headers and Mapping node . . . . . . Migrating message mappings from Version 5.0 Restrictions on migrating message mappings .
. 1704 . 1707 . 1710 1711 . 1714 . 1714 . 1716 . 1724 . 1725 1725 . 1726
Part 4. Reference
801
802
Message Flows
Message flows Reference information provided in this section can help you develop your message flows and related resources. Message flow reference information is available for: v “Message flow preferences” v “Description properties for a message flow” v “Built-in nodes” on page 806 v “User-defined nodes” on page 1235 v “Supported code pages” on page 1353 v “WebSphere MQ connections” on page 1381 v User database connections v “Support for Unicode and DBCS data in databases” on page 1382 v “Data integrity within message flows” on page 1385 v “Validation properties” on page 1385 v “Exception list structure” on page 1390 v “Configurable message flow properties” on page 1398 v “Message flow porting considerations” on page 1400 v FtpServer configurable service properties v “Monitoring profile” on page 1401 v “Message flow accounting and statistics data” on page 1408 v “Coordinated message flows” on page 1424 v “Element definitions for message parsers” on page 1425 v “Developing message mappings” on page 520 v “XML constructs” on page 1462 v “Data sources on z/OS” on page 1477
Message flow preferences You can set Message flow preferences from Window → Preferences then click Message Flow in the left pane. Property
Type
Meaning
Default version tag
String
Provide the default version information you would like to be set in the message flow Version property when you create a new message flow.
Description properties for a message flow Property
Type
Meaning
Version
String
You can enter a version for the message flow in this field. This allows the version of the message flow to be displayed using the Eclipse properties view. A default for this field can be set in the messages flow preferences.
Short Description
String
© Copyright IBM Corp. 2000, 2008
You can enter a short description of the message flow in this field.
803
Property
Type
Meaning
Long Description
String
You can add information to enhance the understanding of the message flow’s function in this field. It is a string field and any standard alphanumeric characters can be used. You can also use this field to define a keyword and its value that will display for the deployed message flow in the properties view of Eclipse. An example is: $MQSI Author=Fred MQSI$ When the properties of the deployed message flow are displayed, this will add a row to the display showing “Author” as the property name and “Fred” as its value. For information on keywords see “Guidance for defining keywords.”
To view and edit the properties of a message flow click Flow → Properties.
Guidance for defining keywords This topic contains the rules to follow when defining keywords. Keywords and their values are displayed in the properties view of a deployed object. A number of objects in WebSphere Message Broker can have additional information added to the object. This information can display information about an object after the object has been deployed. The default information that is displayed is the time the object was deployed and the last time the object was modified. You can define custom keywords, and their values that the Configuration Manager will interpret as additional information to be displayed, in the properties view. For example, you can define keywords for “Author” and “Subflow 1 Version”: $MQSI Author=John Smith MQSI$ $MQSI Subflow 1 Version=v1.3.2 MQSI$
The information the Configuration Manager shows is: Object name Deployment Time
28-Aug-2004 15:04
Modification Time
28-Aug-2004 14:27
Version
v1.0
Author
John Smith
Subflow 1 Version
v1.3.2
In this display the version information has also been defined using the Version property of the object. If the version information had not been defined using the property, it would be omitted from this display. The syntax for defining a keyword and its associated value is: $MQSI KeywordName = KeywordValue MQSI$
Where:
804
Message Flows
$MQSI $MQSI opens the definition. It can be followed by an optional underscore or white space character that is ignored. KeywordName The name of the keyword for which you are setting the value. It can be made up of any sequence of alphanumeric characters apart from the equals (=) sign. It can contain white space characters, but any leading or trailing white space characters are omitted. =
The equals (=) sign is the delimiter between the keyword and the value that you are setting it to.
KeywordValue The value to which the keyword is set. It can be made up of any sequence of alphanumeric characters. It can contain white space characters, but any leading or trailing white space characters are omitted. MQSI$ MQSI$ closes the keyword definition.
Examples Example definitions
Interpreted keyword and value
Comments
$MQSIAuthor=JohnMQSI$ or $MQSI Author=John MQSI$ or $MQSI Author = John MQSI$
Keyword = ″Author″ Value = ″John″
Each of these is a basic example of what can be set and shows that the leading and trailing white space characters for the name and value parameters are ignored.
$MQSI_Author = John MQSI$
Keyword = ″Author″ Value = ″John″
The first character after $MQSI can be an underscore character. The underscore character is omitted in the interpreted keyword. If a second underscore character appears, this forms part of the keyword name.
$MQSI Flow designer = John Smith MQSI$
Keyword = ″Flow designer″ Value = ″John Smith″
White space characters are accepted for each parameter value.
$MQSI bar = MQSI$
Keyword = ″bar″ Value = ″″
The keyword value can be set to an empty (″″) string.
$MQSI_mqsitag=$MQSI$MQSI$
Keyword = ″mqsitag″ Value = ″$″
This is a poorly formatted definition. After defining the keyword name, the parser is looking to find the delimiters that form the boundary of the value to be set. In this case, the only character prior to the MQSI$ that closes the definition is a ’$’, and that is set as the keyword value.
$MQSI=barMQSI$
This pattern is ignored because the keyword name cannot be an empty string.
$MQSItagbarMQSI$
This pattern is ignored because there is not a separator (=) between the keyword name and the keyword value.
Do not use the following keywords as described below:
Message flows
805
VERSION When you use the Message Broker Toolkit to edit message flows and dictionaries, it is possible to set the Version property in the Properties pane, which you can then view in the Broker Archive file editor. If you set this property, a keyword called VERSION is added to the resulting cmf or dictionary file. For this reason, do not add $MQSI_VERSION=...MQSI$ to these files. BAR
The BAR keyword is associated with each object automatically when it is deployed and it contains the full path name of the broker archive file that deployed the object.
The values of both keywords are defined programmatically in the class com.ibm.broker.config.proxy.DeployedObject.
Restrictions within keywords Do not use the following characters within keywords because they cause unpredictable behavior: ^$.|\<>?+*=&[]
You can use these characters in the values that are associated with keywords; for example: v $MQSI RCSVER=$id$ MQSI$ is acceptable v $MQSI $name=Fred MQSI$ is not acceptable
Built-in nodes WebSphere Message Broker supplies built-in nodes that you can use to define your message flows. The mode that your broker is working in can affect the types of node that you can use; see Restrictions that apply in each operation mode. For information about each of these built-in nodes, use the following links. The nodes are listed in the categories under which they are grouped in the node palette, see “Message flow node palette” on page 56. WebSphere MQ v “MQInput node” on page 1005 v “MQOutput node” on page 1021 v “MQReply node” on page 1028 v “MQGet node” on page 989 v “MQOptimizedFlow node” on page 1019 v “MQeInput node” on page 978 v “MQeOutput node” on page 986 JMS v “JMSInput node” on page 943 v “JMSOutput node” on page 956 v “JMSReply node” on page 967 v “JMSMQTransform node” on page 955 v “MQJMSTransform node” on page 1017 HTTP v “HTTPInput node” on page 906
806
Message Flows
v “HTTPReply node” on page 913 v “HTTPRequest node” on page 915 Web Services v “SOAPInput node” on page 1112 v “SOAPReply node” on page 1122 v “SOAPRequest node” on page 1124 v “SOAPAsyncRequest node” on page 1089 v “SOAPAsyncResponse node” on page 1099 v “SOAPEnvelope node” on page 1104 v “SOAPExtract node” on page 1107 v “RegistryLookup node” on page 1052 v “EndpointLookup node” on page 867 WebSphere Adapters v “PeopleSoftInput node” on page 1035 v “PeopleSoftRequest node” on page 1039 v “SAPInput node” on page 1066 v “SAPRequest node” on page 1070 v “SiebelInput node” on page 1083 v “SiebelRequest node” on page 1086 v “TwineballInput node” on page 1212 v “TwineballRequest node” on page 1216 Routing v “Filter node” on page 896 v “Label node” on page 971 v “Publication node” on page 1045 v “RouteToLabel node” on page 1064 v “Route node” on page 1061 v “AggregateControl node” on page 808 v “AggregateReply node” on page 810 v “AggregateRequest node” on page 813 v “Collector node” on page 817
|
Transformation v “Mapping node” on page 973 v “XSLTransform node” on page 1225 v “Compute node” on page 823 v “JavaCompute node” on page 937 v “PHPCompute node” on page 1042 Construction v “Input node” on page 935 v “Output node” on page 1032 v “Throw node” on page 1197 v “Trace node” on page 1206 v “TryCatch node” on page 1210 v “FlowOrder node” on page 900 v “Passthrough node” on page 1034 v “ResetContentDescriptor node” on page 1055 Database v “Database node” on page 831 v “DataDelete node” on page 852 v “DataInsert node” on page 855 Message flows
807
v v v v v
“DataUpdate node” on page 858 “Warehouse node” on page 1222 “DatabaseRetrieve node” on page 835 “DatabaseRoute node” on page 844 “Extract node” on page 870
File v “FileInput node” on page 872 v “FileOutput node” on page 886 Email v “EmailOutput node” on page 861 TCP/IP v “TCPIPClientInput node” on page 1134 v “TCPIPClientOutput node” on page 1146 v “TCPIPClientReceive node” on page 1155 v “TCPIPServerInput node” on page 1166 v “TCPIPServerOutput node” on page 1177 v “TCPIPServerReceive node” on page 1186 IMS v “IMSRequest node” on page 929
| |
Validation v “Validate node” on page 1218 v “Check node” on page 815 Timer v “TimeoutControl node” on page 1199 v “TimeoutNotification node” on page 1202 Additional protocols v “SCADAInput node” on page 1073 v “SCADAOutput node” on page 1080 v “Real-timeInput node” on page 1047 v “Real-timeOptimizedFlow node” on page 1050
AggregateControl node Use the AggregateControl node to mark the beginning of a fan-out of requests that are part of an aggregation. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 809 v “Terminals and properties” on page 809
Purpose Aggregation is an extension of the request/reply application model. It combines the generation and fan-out of a number of related requests with the fan-in of the corresponding replies, and compiles those replies into a single aggregated reply message. The aggregation function is provided by the following three nodes:
808
Message Flows
v The AggregateControl node marks the beginning of a fan-out of requests that are part of an aggregation. It sends a control message that is used by the AggregateReply node to match the different requests that have been made. The information that is propagated from the Control terminal includes the broker identifier, the aggregate name property, and the timeout property. You must not change the aggregation information that is added to the message Environment by the AggregateControl node. v The AggregateRequest node records the fact that the request messages have been sent. It also collects information that helps the AggregateReply node to construct the aggregated reply message. You must preserve the information that is added to the message Environment by the AggregateControl node, otherwise the aggregation fails. v The AggregateReply node marks the end of an aggregation fan-in. It collects replies and combines them into a single aggregated reply message. This node creates the LocalEnvironment.ComIbmAggregateControlNode folder. This folder and the fields within it are for internal use by WebSphere Message Broker and you should not rely on their existence or values when developing your message flows. The AggregateControl node is contained in the Routing drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following samples to see how to use this node: v Aggregation sample v Airline Reservations sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the AggregateControl node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 AggregateControl node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts a message for processing by the node.
Out
The output terminal to which the original message is routed when processing completes successfully.
Control
The output terminal to which a control message is routed. The control message is sent to a corresponding AggregateReply node. The Control terminal is deprecated in Version 6.0; to use connections from the Control terminal, see “Using control messages in aggregation flows” on page 641.
Message flows
809
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 AggregateControl node Description properties are described in the following table: Property
M
C
Default
Description
Node name
No
No
The node type (AggregateControl)
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 AggregateControl node Basic properties are described in the following table: Property
M
C
Aggregate Name
Yes
Yes
Timeout (sec)
Yes
No
Default
Description A name that used to associate the fan-out message flow with the fan-in message flow. This value must be contextually unique within a broker.
0
The amount of time, in seconds, that it waits for replies to arrive at the fan-in. The default value is zero; if you accept this default value, the timeout is disabled for fan-outs from this node (that is, it waits for replies indefinitely). If not all responses are received, the message flow continues to wait, and does not complete. Set a value greater than zero to ensure that the message flow can complete, even if not all responses are received. For further information about timeouts, see “AggregateReply node.” z/OS On z/OS, if the Timeout property is not set to zero, set the queue manager parameter EXPRYINT to 5.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
AggregateReply node
|
Use the AggregateReply node to mark the end of an aggregation fan-in. This node collects replies and combines them into a single compound message. This topic contains the following sections: v “Purpose” on page 811
810
Message Flows
v “Using this node in a message flow” v “Terminals and properties” on page 812
Purpose Aggregation is an extension of the request/reply application model. It combines the generation and fan-out of a number of related requests with the fan-in of the corresponding replies, and compiles those replies into a single aggregated reply message. The aggregation function is provided by the following three nodes: v The AggregateControl node marks the beginning of a fan-out of requests that are part of an aggregation. It sends a control message that is used by the AggregateReply node to match the different requests that have been made. The information that is propagated from the Control terminal includes the broker identifier, the aggregate name property, and the timeout property. The aggregation information that is added to the message Environment by the AggregateControl node must not be changed. v The AggregateRequest node records the fact that the request messages have been sent. It also collects information that helps the AggregateReply node to construct the aggregated reply message. The information that is added to the message Environment by the AggregateRequest must be preserved, otherwise the aggregation fails. v The AggregateReply node marks the end of an aggregation fan-in. It collects replies and combines them into a single aggregated reply message. The AggregateReply node is contained in the Routing drawer of the palette, and is represented in the workbench by the following icon:
When incoming messages are stored by the AggregateReply node before all responses for the aggregation are received, the persistence of the message determines whether the message survives a restart. If, during an aggregation, one or more of the response messages are not received by the AggregateReply node, the normal timeout or unknown message processing deals with the responses that have been received already. The MQMD.Expiry value of each AggregateReply message is set to -1 in the compound output message. This value is set because the MQMD.Expiry value has no meaning once the reply message is no longer on the WebSphere MQ Transport and has been stored by the broker during the aggregation process.
Using this node in a message flow Look at the following samples to see how to use this node: v Aggregation sample v Airline Reservations sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Message flows
811
Terminals and properties When you have put an instance of the AggregateReply node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 AggregateReply node terminals are described in the following table. Terminal
Description
Control
The input terminal that accepts control messages that are sent by a corresponding AggregateControl node. The Control terminal is deprecated in Version 6.0; to use connections to the Control terminal, see “Using control messages in aggregation flows” on page 641.
In
The input terminal that accepts a message for processing by the node.
Failure
The output terminal to which the message is routed if a failure is detected during processing.
Unknown
The output terminal to which messages are routed when they cannot be identified as valid reply messages.
Out
The output terminal to which the compound message is routed when processing completes successfully.
Timeout
The output terminal to which the incomplete compound message is routed when the timeout interval that is specified in the corresponding AggregateControl node has expired.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and then caught by this 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 Description properties of the AggregateReply node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type The name of the node. (AggregateReply)
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 AggregateReply node Basic properties are described in the following table. Property
M
C
Aggregate Name
Yes
Yes
812
Message Flows
Default
Description A name that is used to associate the fan-in message flow with the fan-out message flow. This value must be contextually unique within a broker.
Property
M
C
Default
Description
Unknown Message Timeout
No
No
0
The amount of time, in seconds, for which messages that cannot be identified as replies are held before they are propagated to the Unknown terminal. The default value is zero; if you accept this default value, the timeout is disabled and unknown messages are propagated to the Unknown terminal upon receipt. z/OS
On z/OS, if the Unknown Message Timeout property is not set to zero, set the queue manager parameter EXPRYINT to 5. Transaction Mode
Yes
No
Selected
This property defines the transactional characteristics of this message: v If you select the check box (the default), the subsequent message flow is under transaction control. This setting remains true for messages that derive from the output message and are output by an MQOutput node, unless the MQOutput node explicitly overrides the transaction status. No other node can change the transactional characteristics of the output message. v If you clear the check box, the subsequent message flow is not under transaction control. This setting remains true for messages that derive from the output message and are output by an MQOutput node, unless the MQOutput node has specified that the message should be put under syncpoint.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
AggregateRequest node Use the AggregateRequest node to record the fact that request messages have been sent. This node also collects information that helps the AggregateReply node to construct the compound response message. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 814 v “Terminals and properties” on page 814
Purpose Aggregation is an extension of the request/reply application model. It combines the generation and fan-out of a number of related requests with the fan-in of the corresponding replies, and compiles those replies into a single aggregated reply message. The aggregation function is provided by the following three nodes: Message flows
813
v The AggregateControl node marks the beginning of a fan-out of requests that are part of an aggregation. It sends a control message that is used by the AggregateReply node to match the different requests that have been made. The information that is propagated from the Control terminal includes the broker identifier, the aggregate name property, and the timeout property. The aggregation information that is added to the message Environment by the AggregateControl node must not be changed. v The AggregateRequest node records the fact that the request messages have been sent. It also collects information that helps the AggregateReply node to construct the aggregated reply message. The information that is added to the message Environment by the AggregateRequest node must be preserved, otherwise the aggregation fails. v The AggregateReply node marks the end of an aggregation fan-in. It collects replies and combines them into a single aggregated reply message. The AggregateRequest node is contained in the Routing drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following samples to see how to use this node: v Aggregation sample v Airline Reservations sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the AggregateRequest node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 AggregateRequest node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts messages sent as part of an aggregate request.
Out
The output terminal to which the input message is routed when processing completes successfully.
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 AggregateRequest node Description properties are described in the following table.
814
Message Flows
Property
M
C
Default
Description
Node name
No
No
The node type (AggregateRequest)
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 AggregateRequest node Basic property is described in the following table. Property
M
C
Folder Name Yes
Default
No
The name that is used as a folder in the AggregateReply node’s compound message to store the reply to this request. You must enter a value for this property, but the value does not need to be unique.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Check node Use the Check node to compare the template of a message that is arriving on its input terminal with a message template that you supply when you configure the Check node. Attention: The Check node is deprecated in WebSphere Message Broker Version 6.0 and subsequent versions. Although message flows that contain a Check node remain valid, redesign your message flows where possible to replace Check nodes with Validate nodes. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 816 v “Terminals and properties” on page 816
Purpose The message domain, message set, and message type of the message are collectively called the message template. The domain defines the parser that is used for the message. The set is the message set to which the message belongs. The type is the structure of the message itself. You can check the incoming message against one or more of these properties. The message property is checked only if you select its corresponding Check property, which means that a message property that contains a null string can be compared.
Message flows
815
If the message properties match the specification, the message is propagated to the Match terminal of the node. If the message properties do not match the specification, the message is propagated to the Failure terminal. If the Failure terminal is not connected to some failure handling processing, an exception is generated. The Check node is contained in the Validation drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Use the Check node to ensure that the message is routed appropriately through the message flow. For example, you can configure the node to direct a message that requests stock purchases through a different route from that required for a message that requests stock sales. Another example of this node’s use is for the receipt of electronic messages from staff at your head office. These messages are used for multiple purposes; for example, to request technical support or stationery, or to advise you about new customer leads. These messages can be processed automatically because your staff complete a standard form. If you want these messages to be processed separately from other messages received, use the Check node to ensure that only staff messages with a specific message type are processed by this message flow.
Terminals and properties When you have put an instance of the Check node into a message flow, node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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 Check node terminals 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 message is routed if the incoming message does not match the specified properties.
Match
The output terminal to which the message is routed if the incoming message matches the specified properties.
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 Check node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
Check
The name of the node
816
Message Flows
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.
The Check node Basic properties are described in the following table. Property
M
C
Default
Domain
No
No
Check domain
Yes
No
Set
No
No
Description The name of the domain.
Cleared
This property checks that a message belongs to a particular domain. To check the parser that is to be used for the incoming message, select this check box and select one of the values from the Domain list. The message set to which the incoming message belongs. If you are using the MRM, IDOC, or XMLNSC parser, check that the incoming message belongs to a particular message set by selecting Check set and entering the name of the message set in Set. Leave Set clear for other parsers. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Check set
Yes
No
Type
No
No
Cleared
If you select this check box, the incoming message is checked against the Set property. The message name. If you are using the MRM parser, check that the incoming message is a particular message type by selecting Check type and entering the name of the message in Type. Leave Type clear for other parsers.
Check type Yes
No
||
Property
M
C
| | | | |
Events
No
No
|
If you select this check box, the incoming message is checked against the Type property.
The Monitoring properties of the node are described in the following table:
|
| | |
Cleared
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Collector node Use the Collector node to create message collections based on rules that you configure in the node.
Message flows
817
This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 819 v “Terminals and properties” on page 820
Purpose Use the Collector node to create a message collection from one or more sources based on configurable criteria. For example, you might need to extract, combine and transform information from three different sources. The messages from these different sources might arrive at the input terminals at different times and in an unknown order. A collection is defined by configuring an event handler for each input terminal. Each event handler controls the acceptance of a message into a collection according to the following properties: v Number of messages v Collect messages for a set period of time v Match the contents of a correlation path v Match the contents against a correlation pattern The correlation properties allow collections to be made according to the content of the messages. The content is specified using an XPath expression. The Collector node ensures that each collection contains an identical correlation string across all its inputs. For more information about XPath 1.0 query syntax, see W3C XPath 1.0 Specification. A message collection comes into existence when the first message arrives at any of the dynamic input terminals on the Collector node. Message collections are stored on a WebSphere MQ queue. When the conditions set by the event handlers for a message collection have been met, the message collection is complete and ready to be propagated. For example, if you set the event handlers on the Collector node to wait for 2 messages from each input terminal, the message collection is complete when 2 messages have been received by every terminal. When the next message arrives on an input terminal it is added to a new message collection. You can select from a number of options to determine how the propagation of the message collections are coordinated. You can enable the message collection to be automatically propagated for processing, or alternatively for the message collections to be propagated when a control messages is received. You can also set an expiry timeout for message collections that fail to be completed in a satisfactory time, using a property on the Collector node. The timeout starts when the first message is added to a message collection. If the timeout expires without the message collection becoming complete, the incomplete message collection is propagated to the Expire terminal. Set a value for the collection expiry to ensure that incomplete message collections do not remain stored on a queue indefinitely. Add appropriate processing to your message flow to handle incomplete message collections. The Collector node is contained in the Routing drawer of the message flow node palette, and is represented in the workbench by the following icon:
818
Message Flows
Using this node in a message flow Look at the Collector Node sample to see an example of how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Use the Collector node to group together messages from different input sources for further processing. A message collection can be processed by the following nodes only: v Compute v JavaCompute Errors might be generated if you try to process a message collection with a node that does not support message collections. The Collector node has one static input terminal: Control, and four static output terminals: Out, Expire, Failure and Catch. These static terminals are always present on the node. In addition to the static input and output terminals, you can add dynamic input terminals for each input source that you want to use with the Collector node. You can add and configure as many input terminals as required to the Collector node. You can configure the properties of each input terminal separately to control how the messages received on each input terminal are added to the appropriate message collection. You can use the Control terminal to trigger the output of completed message collections from the Collector node. Configure the Event coordination property to set the behavior of the Collector node when messages are received on the Control terminal. When a message collection is successfully completed, it is ready to be propagated to the Out terminal. If a value greater than zero is set on the Collection expiry property, then any incomplete message collections are propagated to the Expire terminal. A new transaction is created when a message collection is complete, and is propagated to the next node. Any exceptions that are caught from downstream nodes cause the message collection to be propagated to the Catch terminal on the Collector node, together with the exception list. If the Catch terminal is not connected to any other nodes, then the transaction is caused to rollback. Messages in the message collection are backed out onto the Collector node’s queue. The exception list is written to the system log. This step is repeated until the message collection is successfully processed. In order to avoid a situation where an exception in the flow causes the message collection to fail to be propagated successfully, ensure you connect the Catch terminal to a flow to handle any exceptions. Also ensure you set an expiry timeout to propagate incomplete message collections. | | | | | |
Note: Any exceptions that occur downstream of the Collector node get routed to the Catch terminal. The exception is not processed any further upstream, because the completion of the message collection in the Collector node is the start of the transaction. This behavior is similar to the AggregateReply node. Do not connect a Throw node to the Catch terminal of the Collector node, because control is returned to the same Catch terminal.
Message flows
819
Configuring the Collector node 1. On the Advanced tab: a. Enter a value for Persistence Mode. This value is used to specify whether messages are stored on the Collector node’s queues persistently. If you use additional instances of a message flow or multiple inputs to the Collector node, you can use the Correlation path and Correlation pattern properties to ensure that related messages are added to the same message collection. If you use additional instances, or multiple inputs to the Collector node the order of messages in the message collection can be unpredictable. The order of messages is also unpredictable if you use WebSphere MQ cluster queues as inputs to the Collector node.
Terminals and properties When you have put an instance of the Collector node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 Collector node terminals are described in the following table. Terminal
Description
Control
The static input terminal that accepts control messages. Any message received by the Control terminal is treated as a control message.
Out
The output terminal to which the complete message collection is routed if the received messages satisfy the configured conditions for the message collection.
Expire
The output terminal to which the incomplete message collection is routed if the received messages do not satisfy the configured conditions within the time specified on the Collection expiry property. If you have not set a value for the Collection expiry property this terminal is not used.
Failure
The output terminal to which the message collection is routed if a failure is detected during processing.
Catch
The output terminal to which the message collection is routed if an exception is thrown downstream and caught by this node.
The Collector node can have further dynamic input terminals. 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 Collector node Description properties are described in the following table: Property
M
C
Default
Description
Node name
No
No
The node type, Collector
The name of the node.
Short Description
No
No
820
Message Flows
A brief description of the node.
Property
M
C
Long Description
No
No
Default
Description Text that describes the purpose of the node in the message flow.
The Collector node has two types of Basic properties. You can set properties for each dynamic input terminal that you add to the Collector node in the Collection Definition table in the Basic properties. The properties in the Collection Definition table define the event handlers for the messages arriving on the individual input terminals. The properties that you can set for each of the dynamic input terminals are described in the following table: Property
M
C
Default
Terminal
Yes
No
The terminal This is not a property of the node, but a label to show name the name of the dynamic input terminal.
Description
Enter values for the event handler properties for each dynamic input terminal that you have added to the Collector node in the Collection Definition table. Quantity
Yes
No
1
This property specifies the number of messages that the input terminal accepts to add to a message collection. The default value is 1; if you accept this default value, only one message is added to a collection. If a second message is received on the terminal, a new collection instance is created for it. If you select 0 (zero) or do not specify a value, there is no limit to the number of messages accepted. In this case, the value that is set on the Timeout property must be greater than zero.
Timeout
Yes
No
This property specifies the maximum time in seconds for which the input terminal accepts messages. If you select 0 (zero) or do not specify a value for, the timeout is disabled and there is no limit on the time to wait for messages. In this case, the value that is set on the Quantity property must be greater than zero.
Correlation path
No
No
Messages are only accepted into a message collection if they have the same correlation string. If the message has a different correlation string, it is offered to the next collection in the queue. If none of the collections accept the message, then a new collection is created with correlation string set to the value of the correlation string in the message. Messages are grouped by the value from the correlation path. The correlation path is defined using XPath. You can define your own correlation path using XPath, or select from the following predefined paths: v $Root/Properties/WildcardMatch v $Root/MQMD/CorrelID v $LocalEnvironment/FileInput/Name v $Root/JMSTransport/Transport_Folders/ Header_Values/JMSCorrelationID If you define a value for Correlation path, you can optionally configure a Correlation pattern.
Message flows
821
Property
M
C
Correlation pattern
No
No
Default
Description This property specifies a pattern to match the contents of a correlation path value against. You must set the Correlation path property before you set the value for the Correlation pattern property. If you set the correlation pattern, you must use one * character, optionally surrounded by other text. For example, *.dat. If the correlation pattern is blank, the entire text from the correlation path must be matched by the incoming message.
The remaining Basic properties for the Collector node are shown in the following table: Property
M
C
Collection name
No
No
Default
Description This property specifies the name of the message collection. v If you set this property to contain the wildcard *, the wildcard is replaced by the correlation string from the relevant event handler. v If you leave this property blank or use * and the correlation string is empty, then the collection name is set to an empty string.
Collection expiry
No
Yes
0
The amount of time, in seconds, that the Collector node waits for messages to arrive. After this time an incomplete message collection is expired and propagated to the Expire output terminal. The default value is zero; if you accept this value, the collection expiry is disabled and the Collector node waits for messages indefinitely. Set a value greater than zero to ensure that the message collection is processed, even if not all messages are received. A warning is issued if this property is not set.
822
Message Flows
Property
M
C
Default
Description
Event coordination
Yes
No
Disabled
This property specifies how messages received on the Control terminal for event coordination processing are handled in the Collector node. v If you accept the default value (Disabled), messages to the Control terminal are ignored and collections are propagated when they are complete. v If you select All complete collections, complete message collections are held on a WebSphere MQ queue. When a message is received on the control terminal, all complete message collections on the WebSphere MQ queue are propagated to the Out terminal. v If you select First complete collection, complete message collections are held on a WebSphere MQ queue. When a message is received on the control terminal, the first complete message collection on the WebSphere MQ queue is propagated to the Out terminal. The collections are propagated in the same order that they become complete. If the WebSphere MQ queue is empty when the message is received on the Control terminal, the next complete message collection is immediately propagated to the Out terminal.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Compute node Use the Compute node to construct one or more new output messages. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 824 v “Configuring the Compute node” on page 824 v “Defining database interaction” on page 824 v “Specifying ESQL” on page 825 v “Setting the mode” on page 827 v “Validating messages” on page 829 v “Terminals and properties” on page 829
Purpose 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. Message flows
823
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” on page 825. Use the Compute node to: v Build a new message using a set of assignment statements v Copy messages between parsers v Convert messages from one code set to another v Transform messages from one format to another The Compute node is contained in the Transformation drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following samples to see how to use this node: v Airline Reservations sample v Aggregation sample v JMS Nodes sample v Large Messaging sample v Message Routing sample v Scribble sample v Timeout Processing sample v Video Rental sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Consider a message flow in which you want to give each order that you receive a unique identifier for audit purposes. The Compute node does not modify its input message; it creates a new, modified copy of the message as an output message. You can use the Compute node to insert a unique identifier for your order into the output message, which can be used by subsequent nodes in the message flow.
Configuring the Compute node When you have put an instance of the Compute node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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. Configure the Compute node by: 1. “Defining database interaction” 2. “Specifying ESQL” on page 825 3. “Setting the mode” on page 827 4. “Validating messages” on page 829 Defining database interaction:
824
Message Flows
To access a database from this node: v On the Basic tab, 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 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 .SBIPPROC.
v Select the Transaction setting from the drop-down menu. The values are: – Automatic (the default). The message flow, of which the Compute node is a part, is committed if it is successful. That is, the actions that you define in the ESQL module are performed on the message and it continues through the message flow. If the message flow fails, it is rolled back. If you choose Automatic, 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. – Commit. To commit the action of the Compute node on the database, irrespective of the success or failure of the message flow as a whole, select Commit. The database update is committed even if the message flow itself fails. The value that you choose is implemented for the one or more database tables that you have added; you cannot select a different value for each table. v To treat database warning messages as errors and have the node 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. v To force 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 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). If an error occurs, 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 can include the ESQL THROW statement to throw an exception in this node, or you can use the Throw node to generate your own exception at a later point in the message flow. Specifying ESQL: Code ESQL statements to customize the behavior of the Compute node. For example, you can customize the node to create a new output message or messages, using input message or database content (unchanged or modified), or new data. For example, you might want to modify a value in the input message by adding a value from a database, and storing the result in a field in the output message.
Message flows
825
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. The ESQL file, which by default has the name <message_flow_name>.esql, contains ESQL for every node in the message flow that requires it. Each portion of code that is related to a specific node is known as a module. If an ESQL file does not already exist for this message flow, double-click the Compute node, or right-click the node and click Open ESQL. This action creates and opens a new ESQL file in the ESQL editor view. If you prefer, you can open the appropriate ESQL file in the Broker Development view and select this node in the Outline view. If the file exists already, 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, dependent, projects). Select the appropriate module and click OK. If no suitable modules are available, the list is empty. If the module that you have specified does not exist, it is created for you and the editor displays it. If the file and the module exist already, the editor highlights the correct module. If a module skeleton is created for this node in a new or existing ESQL file, it consists of the following ESQL. The default module name is shown in this example: CREATE COMPUTE MODULE _Compute CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN -- CALL CopyMessageHeaders(); -- CALL CopyEntireMessage(); RETURN TRUE; END; CREATE PROCEDURE CopyMessageHeaders() BEGIN DECLARE I INTEGER 1; DECLARE J INTEGER CARDINALITY(InputRoot.*[]); WHILE I < J DO SET OutputRoot.*[I] = InputRoot.*[I]; SET I = I + 1; END WHILE; END; CREATE PROCEDURE CopyEntireMessage() BEGIN SET OutputRoot = InputRoot; END; END MODULE;
If you create your own ESQL module, you must create this skeleton exactly as shown except for the procedure calls and definitions (described below). You can change the default name, but ensure that the name you specify matches the name of the corresponding node property ESQL Module. If you want the module name to include one or more spaces, enclose the name in double quotes in the ESQL Module property. Add your own ESQL to customize this node after the BEGIN statement that follows CREATE FUNCTION, and before RETURN TRUE. You can use the two calls included in the skeleton, to procedures CopyEntireMessage and CopyMessageHeaders.
826
Message Flows
These procedures, defined following function Main, provide common functions that you might want when you manipulate messages. The calls in the skeleton are commented out; remove the comment markers if you want to use the procedure. If you do not want to use a procedure, remove both the call and the procedure definition from the module. Setting the mode: The Compute Mode property controls which components are used by default in the output message. Select the property to specify whether the Message, LocalEnvironment (previously specified as DestinationList), and Exception List components that are either generated within the node or contained within the incoming message are used. This default value is used when the transformed message is routed to the Out terminal when processing in the node is completed. The default value is also used whenever a PROPAGATE statement does not specify the composition of its output message. Those components that are not included in your selection are passed on unchanged; even if you modify those components, the updates are local to this node. Conversely, those components that are included in the selection are not passed on and the updates that are made in the node persist. The seven possible values that the Compute Mode property can take are listed in the following table. Mode
Description
Message (the default)
The message is generated or passed through by the Compute node as modified within the node.
LocalEnvironment
The LocalEnvironment tree structure is generated or passed through by the Compute node as modified within the node.
LocalEnvironment And Message The LocalEnvironment tree structure and message are generated or passed through by the Compute node as modified by the node. Exception
The Exception List is generated or passed through by the Compute node as modified by the node.
Exception And Message
The Exception List and message are generated or passed through by the Compute node as modified by the node.
Exception and LocalEnvironment
The Exception List and LocalEnvironment tree structure are generated or passed through by the Compute node as modified by the node.
All
The message, Exception List, and LocalEnvironment are generated or passed through by the Compute node as modified by the node.
The value of the Compute Mode property specifies which new message trees are propagated from the Compute node. Therefore, for those message trees that are selected, the input messages are discarded unless they are explicitly copied into the new equivalent output message tree.
Message flows
827
If All is selected, the Compute node is expecting to generate all three new message trees for the Root, LocalEnvironment, and ExceptionList by populating the OutputRoot, OutputLocalEnvironment, and OutputExceptionList. The input message trees are not passed to the output unless they are copied explicitly from the Input to the Output. Therefore, if the Compute Mode property is set to All, you must code the following ESQL to allow the input trees to be propagated to the output terminal: SET OutputRoot = InputRoot; SET OutputLocalEnvironment = InputLocalEnvironment; SET OutputExceptionList = InputExceptionList;
If the ESQL was CopyEntireMessage(), the LocalEnvironment and ExceptionList are not copied across and are not propagated to the output terminal; they are lost at that node in the message flow. To produce a new or changed output message, and propagate the same LocalEnvironment and ExceptionList, set the Compute Mode property to Message so that the LocalEnvironment and ExceptionList that are passed to the Compute or Mapping node, are passed on from the Compute node. The Compute Mode applies only to propagation from the node. You can create all three output trees in a Compute or Mapping node and these can be manipulated and exist within the node. However, the Compute Mode determines whether such output trees are used on propagation from the node. On propagation from the node, the following trees are propagated from the Compute or Mapping node for the following settings. Compute Mode
Trees propagated
All
OutputRoot, OutputLocalEnvironment, OutputExceptionList
Message
OutputRoot, InputLocalEnvironment, InputExceptionList
LocalEnvironment
InputRoot, OutputLocalEnvironment, InputExceptionList
LocalEnvironment and Message
OutputRoot, OutputLocalEnvironment, InputExceptionList
Exception
InputRoot, InputLocalEnvironment, OutputExceptionList
Exception and Message
OutputRoot, InputLocalEnvironment, OutputExceptionList
Exception and LocalEnvironment
InputRoot, OutputLocalEnvironment, OutputExceptionList
Where an output tree is named, ESQL creates this message tree before propagation. If your ESQL does not create the tree, no tree is propagated for that correlation name, and the input tree is not used in its place because the Compute Mode property did not indicate this option. Therefore, dependent on Compute Mode property settings and your ESQL, you might delete a tree that was input to the node, because you did not transfer it to the output tree, or propagate a changed tree as you intended. The converse is also true. If your ESQL interrogates the input trees and does not need to propagate these trees, the Compute Mode property value might mean that the message tree propagates when you do not intend it to do so. For example, you
828
Message Flows
might not want to propagate the LocalEnvironment and ExceptionList from a Compute node, but because you selected Message, the input versions of the trees are propagated. Even if the ESQL explicitly deletes the OutputLocalEnvironment and OutputExceptionList, these changes are local to that node because the Compute Mode property setting causes the input trees to be propagated. The Environment component of the message tree is not affected by the Compute Mode property setting. Its contents, if any, are passed on from this node in the output message. Set this property to reflect the output message format that you require. If you select an option (or accept the default value) that does not include a particular part of the message, that part of the message is not included in any output message that is constructed. The Compute node has both an input and output message, so you can use ESQL to refer to fields in either message. You can also work with both InputLocalEnvironment and OutputLocalEnvironment, and InputExceptionList and OutputExceptionList, as well as the input and output message bodies. Validating messages: Set the validation properties to define how the message that is produced by the Compute node is to be validated. These properties do not cause the input message to be validated. It is expected that, if such validation is required, the validation has already been performed by the input node or a preceding validation node. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385.
Terminals and properties The Compute node terminals 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 routed if an unhandled exception occurs during the computation.
Out
The output terminal to which the transformed message is routed when processing in the node is completed. The transformed message might also be routed to this terminal by a PROPAGATE statement.
Out1
The first alternative output terminal to which the transformed message might be routed by a PROPAGATE statement.
Out2
The second alternative output terminal to which the transformed message might be routed by a PROPAGATE statement.
Out3
The third alternative output terminal to which the transformed message might be routed by a PROPAGATE statement.
Out4
The fourth alternative output terminal to which the transformed message might be routed by a PROPAGATE statement.
For the syntax of the PROPAGATE statement, see “PROPAGATE statement” on page 1578.
Message flows
829
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 Compute node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
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 Compute node Basic properties are described in the following table. Property
M
C
Data Source
No
Yes
Default
Description The ODBC data source name for the database within which reside any tables to which you refer in the ESQL file that is associated with this message flow (identified in the ESQL Module property). You can specify only one data source for the node. If the ESQL that is associated with this node includes a PASSTHRU statement or SELECT function and a database reference, you must specify a value for the Data Source property.
Transaction
Yes
No
Automatic
The transaction mode for the node. Valid options are Automatic and Commit. The property is valid only if you have selected a database table for input.
ESQL Module
Yes
No
Compute
The name of the module within the ESQL file that contains the statements to execute against the database and input and output messages.
Compute Mode
Yes
No
Message
Choose from: v Message v LocalEnvironment v LocalEnvironment And Message v Exception v Exception And Message v Exception And LocalEnvironment v All For more information about setting the mode options, see “Setting the mode” on page 827.
Treat warnings as errors
Yes
No
Cleared
If you select the 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.
The Parser Options properties for the Compute node are described in the following table.
830
Message Flows
Property
M
Use XMLNSC Compact No Parser for XMLNS Domain
C
Default
Description
No
Cleared
Setting this property causes the outgoing MQRFH2 to specify the XMLNS instead of XMLNSC parser, allowing an external application to remain unchanged. If outgoing messages do not contain MQRFH2 headers this property has no effect.
The Validation properties of the Compute node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure Action
No
No
Exception
This property controls what happens if a validation failure occurs. You can set this property only if Validate is set to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Database node Use the Database node to interact with a database in the specified ODBC data source. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 832 v “Terminals and properties” on page 832
Purpose You define the nature of the interaction by coding ESQL statements that specify the data from the input message, and perhaps transform it in some way (for example, to perform a calculation), and assign the result to a database table. 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. Message flows
831
You can use specialized forms of this node to: v Update values within a database table (the DataUpdate node) v Insert rows into a database table (the DataInsert node) v Delete rows from a database table (the DataDelete node) v Store the message, or parts of the message, in a warehouse (the Warehouse node) The Database node is contained in the Database drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following samples to see how to use this node: v Airline Reservations sample v Error Handler sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Consider a situation in which you receive an order for 20 monitors. If you have sufficient numbers of monitors in your warehouse, you want to reduce the stock level on your stock database. You can use the Database node to check that you have enough monitors available, and reduce the value of the quantity field in your database.
Terminals and properties When you have put an instance of the Database node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 terminals of the Database 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 to which the transformed message is routed when processing in the node is completed. The transformed message might also be routed to this terminal by a PROPAGATE statement.
Out1
The first alternative output terminal to which the transformed message might be routed by a PROPAGATE statement.
Out2
The second alternative output terminal to which the transformed message might be routed by a PROPAGATE statement.
Out3
The third alternative output terminal to which the transformed message might be routed by a PROPAGATE statement.
Out4
The fourth alternative output terminal to which the transformed message might be routed by a PROPAGATE statement.
832
Message Flows
Note: For the syntax of the PROPAGATE statement, see “PROPAGATE statement” on page 1578. 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 Database node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, Database
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 Database node Basic properties are described in the following table. Property
M
C
Data Source
No
Yes
Default
Description The ODBC data source name of the database that contains the tables to which you refer in the ESQL that is associated with this node (identified by the Statement property). This name identifies the appropriate database as it is known on the system on which this message flow is to run. 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 On z/OS systems, the broker uses the broker’s started task ID, or the user ID and password that are specified on the mqsisetdbparms command JCL, BIPSDBP in the customization data set .SBIPPROC.
If the ESQL that is associated with this node includes a PASSTHRU statement or SELECT function and a database reference, you must specify a value for the Data Source property.
Message flows
833
Property
M
C
Default
Description
Statement
Yes
No
Database
The name of the module in the ESQL file that contains the statements to use against the database. If you want the module name to include one or more spaces, enclose the name in double quotation marks. The ESQL file, which by default has the name <message_flow_name>.esql, contains ESQL for every node in the message flow that requires it. Each portion of code that is related to a specific node is known as a module. When you code ESQL statements that interact with tables, those tables are assumed to exist within this database. If they do not exist, a database error is generated by the broker at run time. Code ESQL statements to customize the behavior of the Database node in an ESQL file that is associated with the message flow in which you have included this instance of the Database node. If an ESQL file does not exist already for this message flow, double-click the Database node, or right-click the node and click Open ESQL to create and open a new ESQL file in the ESQL editor view. If an ESQL file exists already, click Browse beside the Statement property to display the Module Selection dialog box, which lists the available Database node modules that are defined in the ESQL files that are accessible by this message flow (ESQL files can be defined in other, dependent, projects). Select the appropriate module and click OK. If no suitable modules are available, the list is empty. If the module that you have specified does not exist, it is created for you and the editor displays it. If the file and the module exist already, the editor highlights the correct module. If a module skeleton is created for this node in a new or existing ESQL file, it consists of the following ESQL. The default module name is shown in this example: CREATE DATABASE MODULE _Database CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN RETURN TRUE; END; END MODULE; If you create your own ESQL module, create exactly this skeleton. You can update the default name, but ensure that the name that you specify matches the name of the corresponding node property Statement. To customize this node, add your own ESQL after the BEGIN statement and before RETURN TRUE. You can use all the ESQL statements including SET, WHILE, DECLARE, and IF in this module, but (unlike the Compute node) the Database node propagates, unchanged, the message that it receives at its input terminal to its output terminal. Therefore, like the Filter node, you have only one message to refer to in a Database node.
834
Message Flows
Property
M
C
Default
Description
Transaction
Yes
No
Automatic
The transaction mode for the node. The values are: v Automatic (the default). The message flow, of which the Database node is a part, is committed if it is successful; that is, the actions that you define in the ESQL module are performed and the message continues through the message flow. If the message flow fails, it is rolled back. If you select Automatic, the ability to commit or roll back the action of the Database node on the database depends on the success or failure of the entire message flow. v Commit. To commit any uncommitted actions that are performed in this message flow on the database that is 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.
Treat Warnings Yes as Errors
No
Cleared
For database warning messages to be treated as errors, and for 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 safely as a typical return code in most circumstances.
Yes Throw Exception on Database Error
No
Selected
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, 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). If an error has occurred, 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 use the default error handling by the broker. For example, you can include the ESQL THROW statement to throw an exception in this node, or you can use the Throw node to generate your own exception at a later point.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
DatabaseRetrieve node Use the DatabaseRetrieve node to ensure that information in a message is up to date.
Message flows
835
This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Making the JDBC provider service available to the DatabaseRetrieve node” on page 838 v “Using the Database Explorer view to query data sources” on page 838 v “Configuring the DatabaseRetrieve node” on page 839 v “Example” on page 839 v “Validating messages” on page 841 v “Terminals and properties” on page 841
Purpose Use the DatabaseRetrieve node to modify a message using information from a database. For example, you can add information to a message using a key that is contained in a message; the key can be an account number. The DatabaseRetrieve node is contained in the Database drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the Simplified Database Routing sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Input parameter values that are acquired from message elements in the incoming message are supported for insertion into prepared statements that are used by this node. These values are acquired from name, value, and name-value elements in the incoming parsed input message. Elements are acquired initially in the form of a com.ibm.broker.plugin.MbElement object, therefore the range of supported Java object types that values can take is governed by this object’s interface. When values are in the form of Java primitive types or Objects they are converted to their equivalent JDBC data type, as shown in the following table. Java
JDBC
Integer
INTEGER
Long
BIGINT
Double
DOUBLE
BigDecimal
NUMERIC
Boolean
BIT
byte[]
VARBINARY or LONGVARBINARY
BitSet
VARBINARY or LONGVARBINARY
String
VARCHAR or LONGVARCHAR
MbTime
java.sql.Time
MbTimestamp
java.sql.Timestamp
MbDate
java.sql.Date
Values are used from an element only if the element is of a known type, and its
836
Message Flows
value state is valid, otherwise an exception is issued. Output column values that are acquired in the result set from SQL queries that are carried out by this node are converted first into matching Java types, then into internal message element value types, as shown in the following table. JDBC
Java
ESQL Type
SMALLINT
Integer
INTEGER
INTEGER
Integer
INTEGER
BIGINT
Long
DECIMAL
DOUBLE
Double
FLOAT
REAL
Double
FLOAT
FLOAT
Double
FLOAT
NUMERIC
BigDecimal
DECIMAL
DECIMAL
BigDecimal
DECIMAL
BIT
Boolean
BOOLEAN
BOOLEAN
Boolean
BOOLEAN
BINARY
byte[]
BLOB
VARBINARY
byte[]
BLOB
LONGVARBINARY
byte[]
BLOB
CHAR
String
CHARACTER
VARCHAR
String
CHARACTER
LONGVARCHAR
String
CHARACTER
TINYINT
byte[1]
BLOB
TIME
java.util.Date
TIME
TIMESTAMP
java.util.Date
TIMESTAMP
DATE
java.util.Date
DATE
You can route a message to the same location, whether or not a query is successful against a given database, by wiring both of the non-failure output terminals to the same output location. If an error is found in the XPath expression of a pattern, it is reported during validation in the workbench. The reported error message might include the incorrect expression string and its associated unique dynamic or static terminal name, or the string might be marked as broker within the table. The DatabaseRetrieve node looks up values from a database and stores them as elements in the outgoing message assembly trees. The type of information that is obtained from the database in the form of output column values, which is acquired and passed back in the result set from SQL queries, is converted first into a matching Java type, then into an internal message element value type when it is finally stored in a location in am outgoing message assembly tree. If a message element already exists in the outgoing message tree, the new value overwrites the old value. If the target element does not exist, it is created, and the value is stored. The node needs query information that is used to form an SQL select query, which can access multiple tables in a database using multiple test conditions. Sometimes, not all the information that you want to retrieve in a result set is in a single database table. To get the column values that you want, you might need to retrieve them from two or more tables. This node supports the use of SELECT statements Message flows
837
that facilitate getting columns from one or more tables in a single result set. The normal join syntax that is supported is also referred to as inner join. Inner join information that is collected to form a query includes a list of table qualified column values to retrieve and a list of test conditions, which form the WHERE clause of the SELECT statement. Table qualified column values can form the left hand operand in a test condition. Choose a comparison operator to apply to this operand and, optionally, specify a right hand operand to complete the test condition. The operator could be a null comparison test, in which no right hand operand is needed. The value of the right hand operand can be a database type (such as Integer, Boolean, or Long), another table qualified column, or a value that is acquired from an element in the incoming message, as expressed through an XPath 1.0 general expression. The application of the expression must result in a single element, double, Boolean, or string being returned, otherwise an exception occurs. If the query returns multiple rows, the first row is chosen and the rest are ignored, unless the Multiple rows option is selected. In this case, all rows are processed, and values in those rows are used to update the outgoing message assembly trees. It can be useful to combine a DatabaseRetrieve node with other message flow nodes. For example, you can use an XSLTransform node to manipulate data before or after the DatabaseRetrieve node is invoked. The DatabaseRetrieve node has one input terminal (In) and three output terminals (Out, KeyNotFound, and Failure). If the message is modified successfully, it is routed to the Out terminal. If the message is not modified successfully or a failure is detected during processing, the message is routed to the Failure terminal. If no rows are returned in the result set following execution of a given SQL select query, the original message is routed to the KeyNotFound terminal.
Making the JDBC provider service available to the DatabaseRetrieve node The DatabaseRetrieve node constructs its JDBC connections using connection details that are stored in the broker’s registry as a configurable service. JDBCProvider configurable services are supplied for all supported databases. Use the mqsichangeproperties command to modify the settings of the supplied service for your chosen database, or create a new service using the mqsicreateconfigurableservice command. See Setting up a JDBC provider for type 4 connections for further information and assistance on working with JDBCProvider services. You must set up a different JDBCProvider service for each database to which you want to connect. When you have defined the service, set the Data source name property of this node to the name of the JDBCProvider service; the attributes of the service are used to establish connections for the DatabaseRetrieve node. You must stop and restart the broker for your changes to take effect, unless you intend to create a new execution group on the broker to which you will deploy the message flow that contains this node.
Using the Database Explorer view to query data sources Use the Database Explorer view to discover the names of tables within a target database, as well as the names of any columns in those tables. You must import
838
Message Flows
database definitions for your databases into the workbench before you can view them in the Database Explorer view; see “Adding database definitions to the workbench” on page 551. 1. Switch to the Broker Application Development perspective. 2. In the Database Explorer view, expand Connections. The database connections are listed. 3. Expand a database connection to list the databases, then expand the appropriate database. 4. Expand Schemas to list the schemas, then expand the appropriate schema. 5. Expand Tables to list all the tables. 6. Click a table to show its properties in the Properties view. 7. In the Properties view, click the Columns tab to view the column names.
Configuring the DatabaseRetrieve node When you have put an instance of the DatabaseRetrieve node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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.
Example The following example adds new elements (surname and wage) to the incoming message structure. This example uses a database table called Employee. EmployeeNumber
FamilyName
FirstName
Salary
00001
Smith
John
20000
00002
Jones
Harry
26000
00003
Doe
Jane
31000
To make a copy of the incoming message, select Copy message. When this property is selected, the node always creates an outgoing message assembly that is based on the incoming message assembly, and these trees in the new outgoing message assembly are modified and propagated to the node’s Out terminal. This behavior enables modification of the outgoing message tree itself ($OutputRoot), in addition to the other logical trees in the message assembly: $OutputLocalEnvironment, $OutputDestinationList, $OutputExceptionList and $Environment. If the logical trees only in the message assembly are to be modified by this node, for performance reasons do not select Copy message. When this property is not selected, the node always works against the original incoming message assembly, and it expects that no updates are attempted against the message tree. If an XPath expression in the Data Element Table tries to update this message tree through a reference to $OutputRoot, an MbReadOnlyMessageException occurs. The incoming message is: <EmployeeRecord> <EmployeeNumber>00001
Message flows
839
The Query elements table looks like this: Table name
Column name
Employee
FamilyName
Employee
Salary
Employee
EmployeeNumber
Value Operator Type
=
Element
Value
$OutputRoot/XMLNSC/ EmpRecord/EmpNumber
and the Data Element Table looks like this: Column name
Message element
Employee.FamilyName $OutputRoot/XMLNSC/EmployeeRecord/Surname Employee.Salary
$OutputRoot/XMLNSC/EmployeeRecord/Wage
The DatabaseRetrieve node connects to the Employee database table and extracts the value to compare from each incoming message. The XPath expression that is used to navigate to the message body is $InputBody/EmployeeRecord/ EmployeeNumber. The SQL query is: SELECT Employee.FamilyName, Employee.Salary FROM Employee WHERE EmployeeNumber=? ORDER BY Employee.FamilyName ASC, Employee.Salary ASC
where ? is the value that is retrieved from the incoming message, which is located through the Value property in the third row of the Query elements table, which has a Value Type of Element. v If the value at this location is 00001, information for John Smith is retrieved. The first data element row says get the value of the FamilyName column that is returned from the query, and insert it into a new element named ″Surname″ under EmployeeRecord. The second data element row says get the value of the Salary column that is returned from the query, and insert it into a new element named ″Wage″ under EmployeeRecord. The resulting outgoing message is: <EmployeeRecord> <EmployeeNumber>00001 <Surname>Smith <Wage>20000
v If the value at this location is 00002, information for Harry Jones is retrieved. The resulting outgoing message is: <EmployeeRecord> <EmployeeNumber>00002 <Surname>Jones <Wage>26000
If you select the Multiple rows property, and details of both of the employees are returned from a query in the form of two rows in the result set, the resulting outgoing message is: <EmployeeRecord> <EmployeeNumber>00001 <Surname>Smith <Wage>20000 <EmployeeNumber>00002 <Surname>Jones <Wage>26000
840
Message Flows
Validating messages Set the Validation properties to define how the message that is produced by the DatabaseRetrieve node is to be validated. These properties do not cause the input message to be validated. It is expected that, if such validation is required, the validation has already been performed by the input node or a preceding validation node. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385.
Terminals and properties The DatabaseRetrieve node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts a message for processing by the node.
Out
The output terminal to which the outgoing message is routed when it has been modified successfully.
KeyNotFound
The output terminal to which the original message is routed, unchanged, when the result set is empty.
Failure
The output terminal to which the message is routed if a failure is detected during processing.
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 DatabaseRetrieve node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
DatabaseRetrieve 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 DatabaseRetrieve node Basic properties are described in the following table.
Message flows
841
Property
M
C
Default
Description
Data source name
Yes
Yes
DB2
The alias that is used to locate JDBCProvider service definition that is stored in the broker registry. The alias is used to locate and build the JDBC connection URL that is used to connect to a DBMS. The connection URL is driver specific, but it includes the database name to which to connect. If connection to the database is by a login account and password, the node also uses this property as a lookup key, through which these values can be acquired from an expected matching broker registry DSN entry. If the DBMS is password protected, define the -n parameter on the mqsisetdbparms command for the JDBC unique security key before you deploy the message flow that contains this DatabaseRetrieve node.
Copy message
No
Yes
Cleared
This property indicates if a copy of the original incoming message is required because the message tree is to be updated, possibly in addition to logical trees within the message assembly. By default, this check box is cleared. For performance reasons, select this property only if the input message will be augmented.
Multiple rows
No
Yes
Cleared
This property indicates if all rows are processed when a query returns multiple rows. If you select Multiple rows, all rows are processed, and values in those rows are used to update the outgoing message assembly trees. If you do not select this property, the first row is chosen and the rest are ignored.
Query elements
Yes
No
A table of query elements that are used to compose a single SQL select statement. The table consists of five columns and one or more rows. The columns are Table name, Column name, Operator, Value Type, and Value. These five properties describe a query element, indicating a table qualified column value to be retrieved from a database. In this case, the element forms part of the SELECT and ORDER BY clauses in the generated query. Otherwise, the query element acts as a test condition that forms a predicate within the WHERE clause in the generated query.
Table name
Yes
No
The name of a database table that forms part of the SQL select statement, including the schema name; for example, myschema.mytable.
Column name
Yes
No
The name of the column in the database table to be retrieved in the results set, as qualified by the value of the Table name property. This SELECT clause can refer to this name as a column value to return from a query or to be referenced in a test condition within the WHERE clause.
842
Message Flows
Property
M
C
Default
Description
Operator
Yes
No
A comparison operator to apply to a left hand operand (the table column that is specified in the row’s first two columns) and optionally a right hand operand value. If you specify an Ascending ’ASC’ or Descending ’DESC’ operator value for this property, this row signifies the declaration of a table qualified column that forms part of the SELECT and ORDER BY clauses in the generated query and optionally can be referenced in future rows as a right hand operand value.
Value Type
Yes
No
A value that is either set to None, or that indicates the type of value that is expressed in the last column of this row. If this property is not set to None, it refers to a row that describes a test condition in the WHERE clause of the SQL select statement.
Value
Yes
No
A value that is either set to None, or that specifies one of a given set of property types as expressed by the Value Type property. For example, if the Value Type property is set to Element, the Value property collects an XPath 1.0 general expression. The value that is returned from the expression when it is applied to the node’s incoming message is used as the right hand operand value to be compared through this predicate. The compared value of the right hand operand must match the type that is retrieved for the table column that is compared against as the left hand operand. Complex expressions are possible, where zero or more values can be acquired from the incoming message, and manipulated to formed a single value for comparison. For example, the sum of multiple field values in the incoming message can be calculated by a general expression that is presented for a value type of Element.
The DatabaseRetrieve node Data Element Table properties are described in the following table. Property
M
C
Default
Description
Data elements
Yes
No
A list of data elements. A data element is described by the Column name and Message element properties.
Column name
Yes
No
The name of the database column from which to obtain the element value. The list of names is updated dynamically based on the column entries that are entered in the Query elements table.
Message element
Yes
No
An XPath 1.0 read-write path expression that describes the path location of a message element. The message element is where the database value is stored. The XPath expression must evaluate to a single element in the message.
The DatabaseRetrieve node Validation properties are described in the following table. For a full description of these properties, see “Validation properties” on page 1385.
Message flows
843
Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure action
No
No
Exception
This property controls what happens if a validation failure occurs. You can set this property only if Validate is set to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
DatabaseRoute node
|
Use the DatabaseRoute node to route messages using information from a database in conjunction with XPath expressions. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 845 v “Making the JDBC provider service available to the DatabaseRoute node” on page 848 v “Using the Database Explorer view to query data sources” on page 848 v “Configuring the DatabaseRoute node” on page 848 v “Example” on page 848 v “Terminals” on page 849 v “Properties” on page 850
Purpose The DatabaseRoute node uses a collection of named column values from a selected database row and synchronously applies one or more XPath expressions to these acquired values to make routing decisions. For more information about XPath 1.0 query syntax, see W3C XPath 1.0 Specification. The DatabaseRoute node is contained in the Database drawer of the message flow node palette, and is represented in the workbench by the following icon:
844
Message Flows
Using this node in a message flow Look at the Simplified Database Routing sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Input parameter values that are acquired from message elements in the incoming message are supported for insertion into prepared statements that are used by this node. These values are acquired from name, value, and name-value elements in the incoming parsed input message. Elements are acquired initially in the form of a com.ibm.broker.plugin.MbElement object, therefore the range of supported Java object types that values can take is governed by this object’s interface. When values are in the form of Java primitive types or Objects they are converted into their equivalent JDBC data type, as shown in the following table. Java
JDBC
Integer
INTEGER
Long
BIGINT
Double
DOUBLE
BigDecimal
NUMERIC
Boolean
BIT
byte[]
VARBINARY or LONGVARBINARY
BitSet
VARBINARY or LONGVARBINARY
String
VARCHAR or LONGVARCHAR
MbTime
java.sql.Time
MbTimestamp
java.sql.Timestamp
MbDate
java.sql.Date
Values are used from an element only if the element is of a known type, and its value state is valid, otherwise an exception is issued. Output column values that are acquired in the result set from SQL queries that are carried out by this node are converted first into matching Java types, then into internal message element value types, as shown in the following table. JDBC
Java
ESQL Type
SMALLINT
Integer
INTEGER
INTEGER
Integer
INTEGER
BIGINT
Long
DECIMAL
DOUBLE
Double
FLOAT
REAL
Double
FLOAT
FLOAT
Double
FLOAT
NUMERIC
BigDecimal
DECIMAL
DECIMAL
BigDecimal
DECIMAL
BIT
Boolean
BOOLEAN
BOOLEAN
Boolean
BOOLEAN
BINARY
byte[]
BLOB
VARBINARY
byte[]
BLOB
LONGVARBINARY
byte[]
BLOB
Message flows
845
JDBC
Java
ESQL Type
CHAR
String
CHARACTER
VARCHAR
String
CHARACTER
LONGVARCHAR
String
CHARACTER
TINYINT
byte[1]
BLOB
TIME
java.util.Date
TIME
TIMESTAMP
java.util.Date
TIMESTAMP
DATE
java.util.Date
DATE
You can route a message to the same location, whether or not a query is successful against a given database, by wiring both of the non-failure output terminals to the same output location. If an error is found in the XPath expression of a pattern, it is reported during validation in the workbench. The reported error message might include the incorrect expression string and its associated unique dynamic or static terminal name, or the string might be marked as broken within the table. The node needs query information that is used to form an SQL select query, which can access multiple tables in a database using multiple test conditions. Sometimes, not all the information that you want to retrieve in a result set is in a single database table. To get the column values that you want, you might need to retrieve them from two or more tables. This node supports the use of SELECT statements that facilitate getting columns from one or more tables in a single result set. The normal join syntax that is supported is also referred to as inner join. Inner join information that is collected to form a query includes a list of table qualified column values to retrieve and a list of test conditions, which form the WHERE clause of the SELECT statement. Table qualified column values can form the left operand in a test condition. Choose a comparison operator to apply to this operand and, optionally, specify a right operand to complete the test condition. The operator could be a null comparison test, in which no right operand is needed. The value of the right operand can be a database type (such as Integer, Boolean, or Long), another table qualified column, or a value that is acquired from an element in the incoming message, as expressed through an XPath 1.0 general expression. When you deploy a DatabaseRoute node in a message flow, you can select a value that is associated with the Data Source Name property. The list of values contains references to existing IBM predefined JDBC provider entries that are defined when a broker is first created. These entries are incomplete, so you must modify them to access the data source definition with which you want to work. If an existing default IBM predefined JDBC provider is already referenced and in use by another JDBC database node that requires different settings, use the mqsicreateconfigurableservice command to specify a new JDBC provider entry. You can also use the mqsideleteconfigurableservice command to delete any unwanted JDBC provider entries. The DatabaseRoute node has one input terminal and a minimum of four output terminals: Match, keyNotFound, Default, and Failure. The keyNotFound, Default, and Failure output terminals are static, so they are always present on the node. The dynamic Match terminal is created automatically each time a new DatabaseRoute node is selected and used in the Message Flow editor. This behavior means that you do not always need to create this node’s first dynamic
846
Message Flows
output terminal, which is the minimum number of terminals needed for this node to operate. You can rename this dynamic terminal if ″Match″ is not an appropriate name. A message is copied to the Default terminal if none of the filter expressions are true. If an exception occurs during filtering, the message is propagated to the Failure terminal. If the database query that is applied to the node’s data source produces an empty result set (that is, no database rows are matched), a message is copied to the keyNotFound terminal. The DatabaseRoute node can define one or more dynamic output terminals. For all terminals, the associated filter expression is applied to the input message and, if the result is true, a copy of the message is routed to the given terminal. Each filter expression in the Filter table can be applied to: v The input message v The collection of named column values that are selected from a matched database row v Both the input message and the returned column values v Neither because expressions can be any valid general XPath 1.0 expression. As with the Route node, expressions are applied in the order that they are given in the filter table. If the result is true, a copy of the message is routed to its associated dynamic output terminal. If you set the Distribution Mode property to First, the application of all filter expressions might not occur. The filter expression can fail if you compare a returned column value to a string literal. How a column entry is stored (for example, a fixed-length character field) determines what is returned for a given column from the database. Whitespace padding occurs for fixed-length character fields that are retrieved from a database, where the value that is stored is less than the specified column character storage length. In this case, padding occurs to the right of the character string that is returned, forming part of the string. You should remember this when comparing such a column value to a string literal, because an equality comparison expression might fail if the literal does not contain the exact same string, including padding characters. For example, in a table called Employee, a database column called LastName that is defined as char(10) with the value ’Smith’, is returned as ’Smith ’, therefore the filter expression must be: $Employee_LastName = 'Smith
'
which resolves to true. The expression: $Employee_LastName = 'Smith'
resolves to false. Alternatively, the XPath expression can use the following function: Function: string normalize-space(string?)
The normalize-space function returns the argument string with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters with a single space. Therefore the expression would be: normalize-space($Employee_LastName) = 'Smith' Message flows
847
Making the JDBC provider service available to the DatabaseRoute node The DatabaseRoute node constructs its JDBC connections using connection details that are stored in the broker’s registry as a configurable service. JDBCProvider configurable services are supplied for all supported databases. Use the mqsichangeproperties command to modify the settings of the supplied service for your chosen database, or create a new service using the mqsicreateconfigurableservice command. See Setting up a JDBC provider for type 4 connections for further information and assistance on working with JDBCProvider services. You must set up a different JDBCProvider service for each database to which you want to connect. When you have defined the service, set the Data Source Name property of this node to the name of the JDBCProvider service; the attributes of the service are used to establish connections for the DatabaseRoute node. You must stop and restart the broker for your changes to take effect, unless you intend to create a new execution group on the broker to which you will deploy the message flow that contains this node.
Using the Database Explorer view to query data sources Use the Database Explorer view to discover the names of tables within a target database, as well as the names of any columns in those tables. You must import database definitions for your databases into the workbench before you can view them in the Database Explorer view; see “Adding database definitions to the workbench” on page 551 1. Switch to the Broker Application Development perspective. 2. In the Database Explorer view, expand Connections. The database connections are listed. 3. Expand a database connection to list the databases, then expand the appropriate database. 4. Expand Schemas to list the schemas, then expand the appropriate schema. 5. Expand Tables to list all the tables. 6. Click a table to show its properties in the Properties view. 7. In the Properties view, click the Columns tab to view the column names.
Configuring the DatabaseRoute node When you have put an instance of the DatabaseRoute node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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.
Example Consider the following example, which uses a database table called Employee.
848
Message Flows
EmployeeNumber
FamilyName
FirstName
Salary
00001
Smith
John
20000
EmployeeNumber
FamilyName
FirstName
Salary
00002
Jones
Harry
26000
00003
Doe
Jane
31000
The following DatabaseRoute node properties are set as specified: Table Name
Column Name
Operator
Value Type
Value
Employee
FamilyName
ASC
None
None
Employee
Salary
ASC
None
None
Employee
EmployeeNumber
=
Element
$Body/ EmployeeRecord/ EmployeeNumber
The DatabaseRoute node connects to the Employee database table and extracts the value to compare from each incoming message. The XPath expression that is used to navigate to the message body is $Body/EmployeeRecord/EmployeeNumber. The SQL query is: SELECT Employee.FamilyName, Employee.Salary FROM Employee WHERE EmployeeNumber=? ORDER BY Employee.FamilyName ASC, Employee.Salary ASC
where ? is the value that is retrieved from the incoming message. This value is located through the Value property in the third row of the query elements table, which has a value type of Element. v If the value at this location is 00001, information for John Smith is retrieved. The first XPath expression, which is associated with the out_expr1 dynamic terminal, is not met, so it does not meet its condition, and no message is propagated to the Out terminal. The second XPath expression is met, so a copy of the input message is routed to the out_expr2 dynamic terminal. v If the value at this location is 00002, information for Harry Jones is retrieved. The first XPath expression, which is associated with the out_expr1 dynamic terminal, is met, so a copy of the input message is routed to the out_expr1 terminal. The second XPath expression is not processed because the Distribution Mode property is set to First.
Terminals The DatabaseRoute node terminals are described in the following table. Terminal
Description
In
The static input terminal that accepts a message for processing by the node.
Match
A dynamic output terminal to which the original message can be routed when processing completes successfully. You can create additional dynamic terminals; see “Dynamic terminals” on page 850.
Default
The static output terminal to which the message is routed if no filter expression resolves to true.
keyNotFound
The static output terminal to which the message is copied if no database rows are matched.
Failure
The static output terminal to which the message is routed if a failure is detected during processing.
Message flows
849
Dynamic terminals The DatabaseRoute node can have further dynamic output terminals. Not all dynamic output terminals that are created on a DatabaseRoute node need to be mapped to an expression in the filter table. For unmapped dynamic output terminals, messages are never propagated to them. Several expressions can map to the same single dynamic output terminal. For more information about using dynamic terminals, see “Using dynamic terminals” on page 261.
Properties 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 DatabaseRoute node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, DatabaseRoute
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 DatabaseRoute node Basic properties are described in the following table. Property
M
C
Default
Description
Data Source Name
Yes
Yes
DB2
The alias that is used to locate JDBCProvider service definition that is stored in the broker registry. The alias is used to locate and build the JDBC connection URL for connection to a DBMS. The connection URL is driver specific, but it includes the database name to which to connect. If connection to the database is by a login account and password, the node also uses this property as a lookup key, through which these values can be acquired from an expected matching broker registry DSN entry. If the DBMS is password protected, define the -n parameter on the mqsisetdbparms command for the JDBC unique security key before you deploy the message flow that contains this DatabaseRoute node.
850
Message Flows
Property
M
C
Default
Description
Query Elements
Yes
No
A table of query elements that are used to compose a single SQL select statement. The table consists of five columns and one or more rows. The columns are Table Name, Column Name, Operator, Value Type, and Value. These five properties describe a query element, indicating a table qualified column value to be retrieved from a database. In this case, the element forms part of the SELECT and ORDER BY clauses in the generated query. Otherwise, the query element acts as a test condition that forms a predicate within the WHERE clause in the generated query.
Table Name
Yes
No
The name of a database table that forms part of the SQL select statement, including the schema name; for example, myschema.mytable.
Column Name
Yes
No
The name of the column in the database table to be retrieved in the results set, as qualified by the value of the Table Name property. This SELECT clause can refer to this name as a column value to return from a query, or to be referenced in a test condition in the WHERE clause.
Operator
Yes
No
A comparison operator to apply to a left operand (the table column that is specified in the row’s first two columns) and optionally a right operand value. If you specify an Ascending ’ASC’ or Descending ’DESC’ operator value for this property, this row signifies the declaration of a table qualified column that forms part of the SELECT and ORDER BY clauses in the generated query and optionally can be referenced in future rows as a right operand value.
Value Type
Yes
No
A value that is either set to None, or that indicates the type of value that is expressed in the last column of this row. If this property is not set to None, it refers to a row that describes a test condition in the WHERE clause of the SQL select statement.
Value
Yes
No
A value that is either set to None, or that specifies one of a given set of property types as expressed by the Value Type property. For example, if the Value Type property is set to Element, the Value property collects an XPath 1.0 general expression. The value that is returned from the expression when it is applied to the node’s incoming message is used as the right operand value to be compared through this predicate. The compared value of the right operand must match the type that is retrieved for the table column that is compared against as the left operand. Complex expressions are possible, where zero or more values can be acquired from the incoming message, and manipulated to form a single value for comparison. For example, the sum of multiple field values in the incoming message can be calculated by a general expression that is presented for a value type of Element.
Message flows
851
Property
M
C
Default
Description
Distribution mode
No
Yes
All
This property specifies the routing behavior of this node when an inbound message matches multiple expressions. If the Distribution Mode property is set to First, the message is propagated to the first matching output terminal. If the Distribution Mode property is set to All, the message is propagated to all matching output terminals. If there is no matching output terminal, the message is propagated to the Default terminal.
The DatabaseRoute node Filter Expression Table properties are described in the following table. Property
M
C
Filter table
Yes
No
Default
Description A table of filters (XPath 1.0 general expressions) and associated terminal names that define any extra filtering that is performed by this node. The table consists of two columns and one or more rows. You must have at least one row in this table so that the node can perform routing logic. As with the Route node, expressions are evaluated in the order in which they appear in the table. To improve performance, put the XPath expressions that are satisfied most frequently at the top of the filter table.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
DataDelete node
|
Use the DataDelete node to interact with a database in the specified ODBC data source. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 853 v “Terminals and properties” on page 853
Purpose 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 to identify the action required.
852
Message Flows
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 contained in the Database drawer of the palette, and is represented in the workbench by the following 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.
Terminals and properties When you have put an instance of the DataDelete node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. (If you double-click the DataDelete 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. 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 DataDelete node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
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.
Message flows
853
The DataDelete node Basic properties are described in the following table. Property
M
C
Data source
No
Yes
Default
Description The ODBC data source name of the database that contains the tables to which you refer in the mappings that are associated with this node (identified by the Statement property). This name identifies the appropriate database on the system on which this message flow is to run. 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
On z/OS systems, the broker uses the broker started task ID, or the user ID and password that are specified on the mqsisetdbparms command JCL, BIPSDBP in the customization data set .SBIPPROC. 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. By default, the name that is 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.msgmap 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 of the 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.msgmap 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” on page 520.
Transaction
854
Yes
Message Flows
No
Automatic The transaction mode for the node. The values are: v 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 select 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. v 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.
Property
M
C
Default
Description
Treat warnings as errors
Yes
No
Cleared
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 by default. 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 typical return codes, and does not raise any exceptions. The most significant warning raised is not found, which can be handled as a typical return code safely in most circumstances.
Throw Yes exception on database error
No
Selected
For the broker to generate an exception when a database error is detected, select Throw exception on database error. The check box is selected by default. 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 can connect the Failure terminal to an error processing subroutine.
DataInsert node Use the DataInsert node to interact with a database in the specified ODBC data source. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 856 v “Terminals and properties” on page 856
Purpose The DataInsert node is a specialized form of the Database node, and the interaction is restricted to inserting one or more rows into a table within the database. You specify what is inserted by defining mapping statements that use the data from the input message to define 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 DataInsert node is contained in the Database drawer of the palette, and is represented in the workbench by the following icon:
Message flows
855
Using this node in a message flow Consider a situation in which your company has developed a new product. The details about the product have been sent from your engineering department, and you need to extract details from the message and add them as a new row in your stock database.
Terminals and properties When you have put an instance of the DataInsert node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. (If you double-click the DataInsert 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. The terminals of the DataInsert 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 DataInsert node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
DataInsert
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 DataInsert node Basic properties are described in the following table.
856
Message Flows
Property
M
C
Data source
No
Yes
Default
Description The ODBC data source name of the database that contains the tables to which you refer in the mappings that are associated with this node (identified by the Statement property). This name identifies the appropriate database on the system on which this message flow is to run. 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 On z/OS systems, the broker uses the broker started task ID, or the user ID and password that are specified on the mqsisetdbparms command JCL, BIPSDBP in the customization data set .SBIPPROC.
Statement
Yes
No
DataInsert
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. By default, the name that is 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_DataInsert.msgmap for the first DataInsert 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 of the 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 select 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.msgmap 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 DataInsert node with any other node that uses mappings (for example, a DataDelete 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” on page 520.
Transaction Yes
No
Automatic
The transaction mode for the node. The values are: v Automatic (the default). The message flow, of which the DataInsert node is a part, is committed if it is successful. That is, the actions that you define in the mappings are taken and the message continues through the message flow. If the message flow fails, it is rolled back. Therefore if you select Automatic, the ability to commit or roll back the action of the DataInsert node on the database depends on the success or failure of the entire message flow. v Commit. To commit any uncommitted actions that are taken in this message flow on the database that is 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.
Message flows
857
Property
M
C
Default
Description
Treat warnings as errors
Yes
No
Cleared
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 by default. 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 typical return codes, and does not raise any exceptions. The most significant warning raised is not found, which can be handled as a typical return code safely in most circumstances.
Throw exception on database error
Yes
No
Selected
For the broker to generate an exception when a database error is detected, select Throw exception on database error. The check box is selected by default. 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 can connect the failure terminal to an error processing subroutine.
DataUpdate node Use the DataUpdate node to interact with a database in the specified ODBC data source. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties” on page 859
Purpose The DataUpdate node is a specialized form of the Database node, and the interaction is restricted to updating one or more rows in a table within the database. You define what is updated by defining mapping statements that use the data from the input message 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 DataUpdate node is contained in the Database drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Consider a scenario in which you have added the details of a new product, a keyboard, to your stock database. Now you have received a message from the Goods In department that indicates that 500 keyboards have been delivered to
858
Message Flows
your premises. You can use the DataUpdate node to change the quantity of keyboards in your database from zero to 500.
Terminals and properties When you have put an instance of the DataUpdate node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. (If you double-click the DataUpdate 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. The terminals of the DataUpdate 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 DataUpdate node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
DataUpdate
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 DataUpdate node Basic properties are described in the following table. Property
M
C
Data source
No
Yes
Default
Description The ODBC data source name of the database that contains the tables to which you refer in the mappings that are associated with this node (identified by the Statement property). This name identifies the appropriate database on the system on which this message flow is to run. 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 On z/OS systems, the broker uses the broker started task ID, or the user ID and password that are specified on the mqsisetdbparms command JCL, BIPSDBP in the customization data set .SBIPPROC.
Message flows
859
Property
M
Statement Yes
C
Default
Description
No
DataUpdate 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. By default, the name that is 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_DataUpdate.msgmap for the first DataUpdate 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.msgmap 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 DataUpdate 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” on page 520.
Transaction Yes
No
Automatic The transaction mode for the node. The values are: v Automatic (the default). The message flow, of which the DataUpdate 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 DataUpdate node on the database depends on the success or failure of the entire message flow. v Commit. To commit any uncommitted actions that are performed in this message flow on the database that is 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.
Yes
No
Cleared
Treat warnings as errors
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 by default. 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 safely as a normal return code in most circumstances.
860
Message Flows
Property
M
C
Default
Description
Throw exception on database error
Yes
No
Selected
For the broker to generate an exception when a database error is detected, select Throw exception on database error. The check box is selected by default. 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 can connect the Failure terminal to an error processing subroutine.
EmailOutput node Use the EmailOutput node to send e-mail messages to one or more recipients. This topic contains the following sections: v “Purpose” v “Configuring the EmailOutput node” v “Terminals and properties” on page 864
Purpose The EmailOutput node delivers an e-mail message from a message flow to an SMTP serve that you specify. You can configure the EmailOutput node using the node properties in the Message Broker Toolkit, or dynamically from the LocalEnvironment and e-mail output header (EmailOutputHeader) that are associated with the message. The EmailOutput node is contained in the Email drawer of the message flow node palette, and is represented in the workbench by the following icon:
Look at the E-mail sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the EmailOutput node When you have put an instance of the EmailOutput node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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 four levels of configuration of the EmailOutput node are described below. v Option 1: Configure the EmailOutput node using the node properties in the Message Broker Toolkit to send an e-mail with a statically-defined subject and text to a statically-defined list of recipients. The same e-mail is sent to the same recipients and it has no attachments. This method is useful when you want to test the EmailOutput node, or when notification alone is sufficient.
Message flows
861
v Option 2: This option is the same as Option 1 but with the inclusion of an attachment. This option causes the e-mail message to be constructed as a MIME message. The subject, text, and list of recipients remains static, but the content of the attachment is sought dynamically from the message that is passed to the EmailOutput node at run time. The location of the attachment in the message is defined statically. v Option 3: This option allows for those properties in Options 1 and 2 to be optional, and to be overridden at run time by values that are specified in the LocalEnvironment, the e-mail output header (EmailOutputHeader), or the body of the message. This option allows a dynamic e-mail message to be produced where the SMTP server, list of recipients, subject, text, and multiple attachments are all determined at run time. This option requires previous nodes in the message flow to construct these overrides. Where a text value is not specified in the node properties for the main body of the e-mail, the body of the message that is passed to the EmailOutput node is used. v Option 4: This option passes a MIME message to the EmailOutput node. The EmailOutput node uses the MIME parser to write the MIME message to a bit stream. This message is then sent to the list of recipients in the SMTP header. LocalEnvironment overrides are not taken into consideration when a MIME message is passed.
E-mail output header The e-mail output header (EmailOutputHeader) is a child of root. Values that you specify in this header override equivalent properties that you set on the node. Use the SMTP output header specify any of the e-mail attributes, such as its recipients. Location
Description
Root.EmailOutputHeader.To
A comma separated list of e-mail addresses.
Root.EmailOutputHeader.Cc
A comma separated list of e-mail addresses.
Root.EmailOutputHeader.Bcc
A comma separated list of e-mail addresses.
Root.EmailOutputHeader.From
A comma separated list of e-mail addresses.
Root.EmailOutputHeader.Reply-To
A comma separated list of e-mail addresses.
Root.EmailOutputHeader.Subject
The subject of the e-mail.
LocalEnvironment Use the LocalEnvironment to specify overrides to the SMTP server connection information and attachments. LocalEnvironment
Description
Destination.Email.SMTPServer
The Server:Port of the SMTP server. Port is optional; if you do not specify it, the default value is 25.
862
Message Flows
LocalEnvironment
Description
Destination.Email.SecurityIdentity
The security identity for authentication with the SMTP server, which can be the name of the userid and password pair that is defined using the mqsisetdbparms command, or it can reference an external resource that has a securityIdentity attribute that references a userid and password that are defined using the mqsisetdbparms command. In both cases, the value is appended after the string “smtp::”. For example, if you use the mqsisetdbparms command to create a userid and password of smtp::myUseridPassword, the securityIdentity that is specified on the node, or indirectly in an external resource, is myUseridPassword.
Destination.Email.BodyContentType
Identifies that the body of the e-mail message contains HTML rather than plain text. You can set this property to text/plain, text/html, or text/xml; text/plain is the default value.
Destination.Email.MultiPartContentType
The type of multipart, including related, mixed, and alternative. You can set any value here.
Destination.Email.Attachment.Content
Either the actual attachment (BLOB/text), or an XPath or ESQL expression that references an element; for example, an element in the message tree or LocalEnvironment. The value of the referenced element is taken as the content of the attachment. v If the element is a BLOB, it is an attachment. v If the element is text, check to see if it can be resolved to another element in the message tree or LocalEnvironment. If it can be resolved, use that element. If it cannot be resolved, add this element as the attachment.
Destination.Email.Attachment.ContentType
The type of attachment (also known as Internet Media Type), including text/plain, text/html, and text/xml. You can set any value here.
Destination.Email.Attachment.ContentName
The name of the attachment.
Destination.Email.Attachment.ContentEncoding
The encoding of the attachment: 7bit, base64, or quoted-printable. v 7bit is the default value that is used for ASCII text. v Base64 is used for non ASCII, whether non English or binary data. This format can be difficult to read. v Quoted-printable is an alternative to Base64, and is appropriate when the majority of the data is ASCII with some non-ASCII parts. This format is more readable; it provides a more compact encoding because the ASCII parts are not encoded.
Broker properties You can also configure the SMTP server, port number, and security identity as a broker external resource property. To do this, use an alias that is specified in the SMTPServer property on the EmailOutput node. The security identity references a user ID and password pair that is defined on the broker using the mqsisetdbparms command. Use the mqsicreateconfigurableservice command to create an SMTP broker external resource for the alias that is specified on the node. Then use the Message flows
863
mqsichangeproperties command to create an SMTPServer property with the value in the form of server:port. The port value is optional; if you do not specify it, the default value is 25. You can also use the mqsichangeproperties command to create an SMTPSecurityIdentity property with a value that is the name of a security identity that can be resolved at run time to a user ID and password for authentication with the SMTP server. For example: mqsicreateconfigurableservice MY_BROKER –c SMTP –o SMTP_MyAlias
followed by: mqsichangeproperties MY_BROKER –c SMTP –o SMTP_MyAlias –n serverName –v smtp.hursley.ibm.com:25
These commands override the SMTP server and port values that are specified on any nodes that also specify an alias of SMTP_MyAlias. If the LocalEnvironment contains any overrides, they take preference over the broker external resource properties. See also the following example: mqsichangeproperties MY_BROKER –c SMTP –o SMTP_MyAlias –n securityIdentity –v mySecurityIdentity
You must also use the mqsisetdbparms command to define the security identity at the broker run time. Connecting the terminals: Connect the In terminal to the node from which outbound messages bound are routed. Connect the Out or Failure terminal of this node to another node in this message flow to process the message further, process errors, or send the message to an additional destination. If you connect one of these output terminals to another node in the message flow, the LocalEnvironment that is associated with the message is enhanced with the following information for each destination to which the message has been put by this node: Location
Description
WrittenDestination.Email.smtpServer
The Server:Port of the SMTP server.
WrittenDestination.Email.messageId
The ID of the e-mail sent message.
These values are written in WrittenDestination within the LocalEnvironment tree structure. If you do not connect either terminal, the LocalEnvironment tree is unchanged.
Terminals and properties The EmailOutput node terminals 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 message is routed if a failure is detected when the message is put to the output queue.
Out
The output terminal to which the message is routed if it has been successfully put to the output queue, and if further processing is required within this message flow.
864
Message Flows
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 EmailOutput node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node The name of the node. type, EmailOutput
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.
Use the EmailOutput node Basic properties are described in the following table. Property
M
C
server
No
Yes
Default
Description This property defines the SMTP server and port to which e-mails are sent from this node, and is in the format server:port; for example: my.smtp.server:25. The port value is optional, but if you do not specify a port value, the default value is 25. You can specify an alias value for this property. If the alias exists at run time, the specified values are used. If the alias does not exist at run time, the broker assumes the value to be a valid SMTP host.
The EmailOutput node Email properties are described in the following table. Property
M
C
Default
Description
ToAddresses
No
No
The main recipient or recipients of the e-mail. This property can include a single e-mail address or a comma-separated list of e-mail addresses.
CcAddresses
No
No
The carbon copy recipient or recipients of the e-mail. This property can include a single e-mail address or a comma-separated list of e-mail addresses.
BccAddresses
No
No
The blind carbon copy recipient or recipients of the e-mail. This property can include a single e-mail address or a comma-separated list of e-mail addresses.
FromAddress
No
No
The e-mail address of the sender of the e-mail.
Reply-ToAddress
No
No
The e-mail address to which recipients of the e-mail reply.
Subject
No
No
The subject of the e-mail.
MessageText
No
No
The main text of the e-mail. If you do not specify a value for the MessageText property, the text of the e-mail is the body of the message tree that is passed to the EmailOutput node.
Message flows
865
Property
M
C
Default
Description
BodyContentType
No
No
text/plain
You can use this property to force the content type for the body of the e-mail message. Valid values are: v None v text/plain v text/html v text/xml
The EmailOutput node Security properties are described in the following table. Property
M
C
securityIdentity
No
Yes
Default
Description A security identifier to retrieve a user ID and password that are configured at the broker run time.
The EmailOutput node Attachment properties are described in the following table. Property
M
C
AttachmentContent
No
No
An XPath or ESQL expression that references an element; for example, an element in the message tree, or LocalEnvironment. The content of the attachment is the value of the element that is referenced.
AttachmentContentName
No
No
The name of the attachment that is seen by the recipient of the e-mail. This property is optional. If you do not specify a name, a default name is assigned.
AttachmentContentType
No
No
text/plain
The type of the attachment. This property is optional, even if you have specified an attachment. Valid values are: v text/plain is simple text. v text/html is HTML. v text/xml is XML. v application/octet-stream is the default type for non-text and HTML (binary data).
AttachmentContentEncoding No
No
7bit
The encoding of the attachment. This property is optional. If you do not specify a value, a default encoding is assigned. Valid values are: v 7bit is the default value for ASCII text. v base64 is used for non-ASCII data, whether it is non-English or binary data. v quoted-printable is a more readable-alternative to base64. Use quoted-printable when the majority of the data is ASCII text with some non-ASCII parts. This option provides a more compact encoding because the ASCII parts are not encoded.
MultipartContentType
No
Mixed
The type of multipart. Valid values are: v Mixed: each MIME body part is independent of the others. v Alternative: Each MIME body part is an alternative to the others. v Related: All MIME body parts should be considered in the aggregate only.
No
Default
Description
The Validation properties of the EmailOutput node are described in the following table.
866
Message Flows
Refer to “Validation properties” on page 1385 for a full description of these properties. Property
M
C
Default
Description
Validate
Yes
Yes
Inherit
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure Action
Yes
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
EndpointLookup node Use the EndpointLookup node to access service metadata that resides in the WebSphere Service Registry and Repository. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 869 v “Terminals and properties” on page 869 Important: WebSphere Message Broker V6.1.0.2 only supports WebSphere Service Registry and Repository V6.1. Previous versions of the product are not supported.
Purpose This node is generic in that it retrieves service endpoint information related to a WebSphere Service Registry and Repository service, for example, WSDL. The EndpointLookup node is independent from any other domain context, and support is currently limited to querying endpoints for Web services. The EndpointLookup node provides a query interface that enables you to select single or all endpoints, and set up environment parameters to enable Web service invocation nodes to submit requests to the selected services. You can use two nodes to access service metadata that resides in the WebSphere Service Registry and Repository, the EndpointLookup node and the RegistryLookup node. These nodes are designed to be included in message processing flows that mediate between service consumers and service providers in an SOA installation. These nodes are for generic WebSphere Service Registry and Repository access. Message flows
867
The EndpointLookup node supports the SOAPRequest, SOAPAsyncRequest, and HTTPRequest nodes. The EndpointLookup node also generates SOAPRequest, SOAPAsyncRequest, or HTTPRequest node formats. The EndpointLookup node is contained in the Web services drawer of the message flow node palette, and is represented in the workbench by the following icon:
EndpointLookup node processing The EndpointLookup node processes messages in the following sequence. 1. The EndpointLookup node receives a message. 2. The EndpointLookup node retrieves the IT service endpoint information from the WebSphere Service Registry and Repository using the specified query string. The EndpointLookup node can be used to define a query dynamically within the message. Both the EndpointLookup and the RegistryLookup nodes can accept a query specified within the LocalEnvironment. Accepting a query specified within the LocalEnvironment overrides any property values set on the node, and all values are strings. XPath and ESQL are not supported when specifying the customer properties using the LocalEnvironment. When you use the LocalEnvironment to set the properties, you can define the properties at runtime, or message processing time, rather than defining them at development time. You must use the format LocalEnvironment.ServiceRegistryLookupProperties.Name where Name is the property you want to define. It is still mandatory to set values on the properties of the nodes because the nodes cannot deploy without doing so. 3. If one or more matches are found: v If Match Policy is set to One and a single endpoint is matched, the EndpointLookup node sets valid endpoints in the domain so that the existing WebSphere Message Broker built-in nodes, the SOAPRequest, SOAPAsyncRequest, and HTTPRequest nodes, can be used to invoke the service. The EndpointLookup node returns the first result it receives, and sets the endpoint address. However, the first result might not be the most current version. v If Match Policy is set to All, the EndpointLookup node adds all matching endpoints information to the message instance, leaving all other message content unchanged. These results are then sent to a JavaCompute node which selects the current version and sets the endpoint address. You must propagate the LocalEnvironment tree with the message. You can use this option to select the most current version of a particular Web service. Metadata information is propagated to the Out terminal, where it is available for further processing either by ESQL or by a JavaCompute node. 4. If no matches are found, the EndpointLookup node propagates the input message to the NoMatch terminal. Example usage. The node that precedes an EndpointLookup node receives a message and propagates the message to the EndpointLookup node. The EndpointLookup node uses the information defined within its properties to query the WebSphere Service Registry and Repository. Either one or more results are returned depending on whether you set the Match Policy property value to One or
868
Message Flows
All. The information received is placed into the LocalEnvironment tree and propagated on the Out terminal. If no results are returned a message is propagated on the NoMatch terminal.
Using this node in a message flow The EndpointLookup node can be used in any message flow that needs to access service metadata that resides in the WebSphere Service Registry and Repository. Look at the following sample to see how to use this node: v WSRR Connectivity sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the EndpointLookup node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 EndpointLookup node terminals 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 message is routed if an error occurs.
Out
The output terminal to which matching endpoint information is sent.
NoMatch
The terminal to which the message is sent if no matching entity is found based on the specified values.
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 EndpointLookup node Description properties are described in the following table: Property
M
C
Default
Description
Node name
No
No
The node type
The name of the node.
Short description
No
No
None
A brief description of the node.
Long description
No
No
None
Text that describes the purpose of the node in the message flow.
The EndpointLookup node Basic properties are described in the following table:
Message flows
869
Property
M
C
Default
Description
PortType Name
No
Yes
None
PortType Namespace
No
Yes
None
Name tuple that uniquely identifies a WebSphere Service Registry and Repository defined WSDL service portType. At least one of the properties is required. If you leave all three property values blank, you will get an error message when you try to save.
PortType Version
No
Yes
None
User Properties No
No
None
Enables a query to specify user-defined properties for the port. Add User Properties by clicking Add. Enter values for Property Name, Property Type, and Property Value.
Classification
No
No
None
The Web Ontology Language (OWL) classification system property. Each classifier is a class in OWL, and has a Uniform Resource Identifier (URI). Using classifications in the registry can help to make objects easier to find and can also add meaning to custom objects that are unique to a particular system. Add a Classification by clicking Add and typing the complete fully qualified OWL URI for the OWL classification.
Match Policy
Yes
No
One
The policies to be returned. Select One to match one policy, or All to match all policies to the search criteria. If you request a single Web service by setting Match Policy to One, the EndpointLookup node sets the endpoints so that service information is correctly placed in the domain context ensuring that existing WebSphere Message Broker built-in nodes correctly invoke the service.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Extract node
|
Use the Extract node to extract the contents of the input message that you want to be processed by later nodes in the message flow. Attention: The Extract node is deprecated in WebSphere Message Broker Version 6.0 and later releases. Although message flows that contain an Extract node remain valid, redesign your message flows where possible to replace Extract nodes with Mapping nodes. This topic contains the following sections: v “Purpose” on page 871 v “Using this node in a message flow” on page 871 v “Terminals and properties” on page 871
870
Message Flows
Purpose Using the Extract node, you can create a new output message that contains only a subset of the contents of the input message. The output message comprises only those elements of the input message that you specify for inclusion when configuring the Extract node, by defining mapping statements. The Extract node is contained in the Database drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow You might find this node useful if you require only a subset of the message after initial processing of the whole message. For example, you might want to store the whole message for audit purposes (in the Warehouse node), but propagate only a small part of the message (order information, perhaps) for further processing. For example, you receive orders from new clients and you want to collect their names and addresses for future promotions. Use the Extract node to get this information from each order, and send it as a new message to head office. These messages are processed at head office so that the customer details can be included in the next marketing campaign.
Terminals and properties When you have put an instance of the Extract node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. (If you double-click the Extract 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. The Extract node terminals 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 routed if a failure is detected during extraction.
Out
The output terminal to which the transformed message is routed if the input message is processed successfully.
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 Extract node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
Extract
The name of the node.
Message flows
871
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.
The Extract node Basic properties are described in the following table. Property
M
C
Default
Description
Mapping module
Yes
No
Extract
The name of the mapping routine that contains the statements to run against the message tree. By default, the name that is 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_Extract.msgmap for the first Extract node in message flow MFlow1). You cannot specify a value that includes spaces. To work with the mapping routine that is associated with this node, 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.msgmap 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 an Extract 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” on page 520.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
FileInput node
|
Use the FileInput node to process messages that are read from files. This topic contains the following sections: v “Purpose” on page 873 v “Using this node in a message flow” on page 875 v “Configuring the FileInput node” on page 875 v “Terminals and properties” on page 880
872
Message Flows
Purpose One or more messages can be read from a single file, and each message is propagated as a separate flow transaction. The part of a file that generates one message flow transaction is called a record. A file can be a single record, or a series of records. Properties on the node specify how the FileInput node determines the records in a file. The FileInput node is contained in the File drawer of the palette, and is represented in the workbench by the following icon:
File processing The FileInput node reads files from a specified directory called the input directory and propagates messages based on the contents of these files. Only files with names that match a specified pattern (the input pattern) are read. The FileInput node removes each file from the input directory as it is processed. Optionally, the FileInput node can transfer files from a remote FTP server to process them. If the remote file is successfully transferred, it is deleted from the FTP server and the transferred copy is processed as though it had been placed in the input directory. Only files that match the input pattern are transferred. The FileInput node uses subdirectories of the input directory to hold files during and after processing. All of these subdirectories begin with the prefix mqsi. Among these subdirectories are the archive directory, mqsiarchive, and the backout directory, mqsibackout. If the message flow processes the file successfully, the message flow transaction commits, and the file is deleted or moved to the archive directory. If processing is unsuccessful, the message flow transaction backs out, and the file is deleted and moved to the backout directory. You can determine which of these actions is to be taken by specifying properties on the node.
Record processing As a default, a file is treated as one record and is processed as a single message. By using properties on the node, you can specify whether the input file is to be split into records, each of which is separately processed. You can specify records as: v Fixed length. The records are all a specified number of bytes in length, starting with the first byte of the file. v Delimited. A particular sequence of bytes is specified as a record delimiter. An example of such a sequence is an end-of-line sequence. v Parsed sequence. A specified message domain parser reads bytes from the start of the file until a complete message is recognized, which is then processed. The same parser reads subsequent bytes for the next message and continues to do so until all of the file is processed.
Message flows
873
After the last record of the file is processed successfully, if the End of Data terminal is attached, a further End of Data message is propagated to the End of Data terminal. The End of Data message consists of an empty BLOB message and a LocalEnvironment.File structure, and allows explicit end-of-flow processing to be performed in another part of the flow.
Message structure The FileInput node handles messages in the following message domains: v MRM v XMLNSC v DataObject v v v v v v v
XMLNS JMSMap JMSStream MIME BLOB XML IDOC
When the FileInput node propagates a message, it stores the information in the LocalEnvironment.File message tree. If the input file is empty, the message is empty (assuming it passes any validation). The following table lists the LocalEnvironment.File message tree structure. Table 28. Element Name
Element Data Type
Description
Directory
CHARACTER
Absolute directory path of the input directory in the form used by the file system of the broker. For example, on Windows systems, this starts with the drive letter prefix (such as C:).
Name
CHARACTER
File name and extension.
LastModified
TIMESTAMP
Date and time the file was last modified.
TimeStamp
CHARACTER
Date and time the input node started processing the file in the coordinated universal time (UTC) zone, as a character string. This data is the string used to create archive and backout file names if a timestamp is included.
The following elements contain data about the current record: Offset
874
INTEGER
Message Flows
Start of the record within the file. The first record starts at offset 0. When it is part of the End of Data message tree, this is the length of the input file.
Table 28. (continued) Element Name
Element Data Type
Description
Record
INTEGER
Number of the record within the file. The first record is record number 1. When it is part of the End of Data message tree, this is the number of records.
Delimiter
CHARACTER
The characters used to separate this record from the preceding record, if Delimited is specified in Record detection. The first record has a null delimiter. When it is part of the End of Data message tree, this value is the delimiter that follows the last record, if any.
IsEmpty
BOOLEAN
Whether the record that is propagated by the message flow is empty. It is set to TRUE if the current record is empty. When it is part of the End of Data message tree, this property is always set to TRUE.
Using this node in a message flow The FileInput node can be used in any message flow that must accept messages in files. Look at the following samples to see how to use this node: v Batch Processing sample v WildcardMatch sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the FileInput node When you have put an instance of the FileInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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. Configure the FileInput node: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, enter the directories and files to be processed by the FileInput node, together with what to do with any duplicate files encountered. v In Input directory, specify the directory from which the FileInput node obtains files. You may specify the directory as an absolute or relative directory path. If the directory path is relative, it is based on the directory specified in the environment variable MQSI_FILENODES_ROOT_DIRECTORY. An example on Windows would be C:\fileinput. An example on UNIX would be /var/fileinput. v In File name or pattern, specify a file name pattern. This is either a file name or a character sequence (a pattern) that matches a file name. A pattern is a sequence containing at least one of the following wildcard characters: Message flows
875
Wildcard character
Description
Example
*
Any sequence of zero or more characters
*.xml matches all file names with an xml extension
?
Any single character
f??????.csv matches all file names consisting of the letter f followed by six characters and then the sequence .csv.
Only those files the names of which match the pattern will be processed from the input directory. v Select Action on successful processing to specify the action the FileInput node takes after successfully processing the file. The action can be to move the file to the archive subdirectory, to augment the file name with a time stamp and move the file to the archive subdirectory, or to delete the file. – If you select Move to Archive Subdirectory, the file is moved to the archive subdirectory of the input directory. The subdirectory name is mqsiarchive. For example, if the monitored directory is /var/fileinput, the archive subdirectory’s absolute path is /var/fileinput/mqsiarchive. If this directory does not exist, the broker creates it when it first tries to move a file there. – If you select Add Timestamp and Move to Archive Subdirectory, the current date and time is added to the file name, and the file is then moved to mqsiarchive. – If you select Delete, the file is deleted after successful processing. The FileInput node writes a message to the user trace, if user tracing is in operation, whenever it processes a file. v Select Replace duplicate archive files if you want to replace a file in the archive subdirectory with a successfully processed file of the same name. If you do not set this option, and a file with the same name already exists in the archive subdirectory, the node will throw an exception when it tries to move the successfully processed file. 3. On the Input Message Parsing tab, set values for the properties that the node uses to determine how to parse the incoming message. v In Message domain, select the name of the parser that you are using from the supplied list. The default is BLOB. You can choose from the following options: – MRM – – – – –
XMLNSC DataObject XMLNS JMSMap JMSStream
– MIME – BLOB – XML – IDOC You can also specify a user-defined parser, if appropriate.
876
Message Flows
v If you are using the MRM or IDOC parser, or the XMLNSC parser in validating mode, select the Message set that you want to use. This list is populated with available message sets when you select MRM, XMLNSC, or IDOC as the domain. v If you are using the MRM parser, select the correct message type from the list in Message type. This list is populated with available message types when you select the MRM parser. v If you are using the MRM or IDOC parser, select the correct message format from the list in Message format. This list is populated with available message formats when you select the MRM or IDOC parser. v Specify the message coded character set ID in Message coded character set ID. v Select the message encoding from the list in Message encoding or specify a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150. 4. On the Parser Options sub-tab: v Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. v If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 5. On the Polling tab, enter the FileInput node’s Polling interval. This property controls the frequency with which the FileInput node accesses the file system looking for files to process. After the initial scan of the directory when the flow is started, whenever the directory is found to contain no files that match the input pattern, the FileInput node waits for a period of time defined by this property. This avoids the need for the FileInput node to be continually accessing the file system, and, thereby, consuming large amounts of system resource. The smaller the value set in this property, the more quickly the FileInput node discovers files that appear in the input directory. This is at a cost of greater use of system resources. A larger value reduces the use of system resource but at the cost of the FileInput node discovering files to process less quickly. Do not use this property as a means to regulate work, or to schedule processing. If you want the FileInput node to monitor the input directory for selected periods only, you should start and stop the message flow at appropriate times. If you select FTP processing and set the Scan delay property on the FTP tab, the value that you set overrides the value set for the polling interval. 6. Use the Retry tab to define how retry processing is performed when a flow fails. You can set the following: v Retry mechanism determines the action that occurs should the flow fail. Choose from the following: – Select Failure for the node to report a failure without any retry attempts. – Select Short retry for the node to retry before reporting a failure if the condition persists. The number of times that it retries is specified in Retry threshold. – Select Short retry and long retry for the node to retry, first using the value in Retry threshold as the number of attempts it should make. If the condition persists after the Retry threshold has been reached, the node then uses the Long retry interval between attempts. Message flows
877
v Specify the Retry threshold. The number of times the node retries the flow transaction should the Retry mechanism property be set to either Short retry or Short retry and long retry. v Specify the Short retry interval. The length of time, in seconds, to wait between short retry attempts. v Specify the Long retry interval. The length of time to wait between long retry attempts until a message is successful, the message flow is stopped, or the message flow is redeployed. The broker property MinLongRetryInterval defines the minimum value that the Long retry interval can take. If the value is lower than the minimum then the broker value is used. v Specify the Action on failing file. This specifies what the node is to do with the input file after all attempts to process its contents fail. Choose from the following: – Move to Backout Subdirectory. The file is moved to the backout subdirectory in the input directory. The name of this subdirectory is mqsibackout. If the input directory is /var/fileinput, the absolute path of the backout subdirectory would be /var/fileinput/mqsibackout. If this subdirectory does not exist, the broker creates it when it first tries to move a file there. If the file fails to be moved to this subdirectory, perhaps because a file of the same name already exists there, the node adds the current date and time to the file name and makes a second attempt to move the file. If this second attempt fails, the node stops processing, messages BIP3331 and BIP3325 are issued and these direct you to resolve the problem with the subdirectory or file before attempting to restart the message flow. – Delete. The file is deleted after processing fails. – Add Time Stamp and Move to Backout Subdirectory. The current date and time are added to the file name, and then the file is moved to the backout subdirectory. 7. Use the Records and Elements tab to specify how each file is interpreted as records: v Use the Record detection property to determine how the file is split into records, each of which generates a single message. Choose from the following options: – Whole File specifies that the whole file is a single record. – Fixed Length specifies that each record is a fixed number of bytes in length. Each record should contain the number of bytes specified in the Length property, except possibly a shorter final record in the file. – Select Delimited if the records that you are processing are separated, or terminated, by a DOS or UNIX line end or by a sequence of user-defined delimiter bytes. Specify the delimiter and delimiter type in the Delimiter and Delimiter type properties. – Select Parsed Record Sequence if the file contains a sequence of one or more records that are serially recognized by the parser specified in Message domain. The node propagates each recognized record as a separate message. If you select this Record detection option, the parser specified in Message domain must be either XMLNSC or MRM (either CWF or TDS physical format). v If you specified Fixed Length in Record detection, use Length to specify the required length of the output record. This value must be between 1 byte and 100 MB. The default is 80 bytes.
878
Message Flows
If you specify Whole File, Fixed Length, or Delimited in Record detection, a limit of 100 MB applies to the length of the records. If you specify Parsed Record Sequence in Record detection, the FileInput node does not determine or limit the length of a record. Nodes that are downstream in the message flow might try to determine the record length or process a very long record. If you intend to process large records in this way, ensure that your broker has sufficient memory. You might need to apply flow techniques described in the Large Messaging sample to best use the available memory. v If you specified Delimited in Record detection, use Delimiter to specify the delimiter to be used. Choose from: – DOS or UNIX Line End, which, on UNIX systems, specifies the line feed character (, X’0A’), and, on Windows systems, specifies a carriage return character followed by a line feed character (, X’0D0A’). The node treats both of these strings as delimiters, irrespective of the system on which the broker is running. If they both appear in the same file, the node recognizes both as delimiters. The node does not recognize X’15’ which, on z/OS systems, is the ’newline’ byte; specify a value of Custom Delimiter in this property and a value of 15 in the Custom delimiter property if your input file is coded using EBCDIC new lines, such as EBCDIC files from a z/OS system. – Custom Delimiter, which permits a sequence of bytes to be specified in Custom delimiter v In Custom delimiter, specify the delimiter byte or bytes to be used when Custom delimiter is set in the Delimiter property. Specify this value as an even-numbered string of hexadecimal digits. The default is X’0A’ and the maximum length of the string is 16 bytes (represented by 32 hexadecimal digits). v If you specified Delimited in Record detection, use Delimiter type to specify the type of delimiter. Permitted values are: – Infix. If you select this value, each delimiter separates records. If the file ends with a delimiter the (zero length) file content following the final delimiter is still propagated although it contains no data. – Postfix. If you specify this value, each delimiter terminates records. If the file ends with a delimiter, no empty record is propagated after the delimiter. If the file does not end with a delimiter, the file is processed as if a delimiter follows the final bytes of the bytes of the file. Postfix is the default value. v The FileInput node considers each occurrence of the delimiter in the input file as either separating (infix) or terminating (postfix) each record. If the file begins with a delimiter, the node treats the (zero length) file contents preceding that delimiter as a record and propagates an empty record to the flow. The delimiter is never included in the propagated message. 8. Use the Validation tab to provide validation based on the message set for predefined messages. For more information about validation, see “Validating messages” on page 187. For information about how to complete this tab, see “Validation tab properties” on page 1386. 9. On the FTP tab, select the FTP check box if you want the node to read files from an FTP server using the File Transfer Protocol properties: v In FTP server and port, supply the Internet address and port number of an FTP server to be used. Use the following syntax: – or – :<port number> Message flows
879
If you specify the Internet address in IPv6 format, ensure that you enclose it in square brackets, for example: – [12a::13bd:24cd] or – [12a::13bd:24cd]:123 where 123 is the port number If you do not specify a port number, a port number of 21 is assumed. However, if an FtpServer configurable service is defined, then you can place the name of the configurable service in this field. See FtpServer configurable service properties for information on how an FtpServer configurable service definition and the properties on this tab interact. v In Security identity, specify the name of a security identity that has been defined using the mqsisetdbparms command. The user identifier and password that are to be used to log on to the FTP server are obtained from this definition, the name of which should have the prefix ftp::. The value in this property is overridden by the value in the FtpServer configurable service property securityIdentity, if it is set. v In Server directory, specify the directory in the FTP server from which to transfer files. The default is . which means the default directory after logon. If you specify this as a relative path, this directory is based on the default directory after FTP logon. Ensure that the syntax of the of the path conforms to the file system standards in the FTP server. The value in this property is overridden by the value in the FtpServer configurable service property remoteDirectory, if it is set. v In Transfer mode, specify how files are transferred. Select Binary if the file contents are not to be transformed. Select ASCII if the file is to be transmitted as ASCII. The value in this property is overridden by the value in the FtpServer configurable service property transferMode, if it is set. v In Scan delay, specify the delay, in seconds, between directory scans. The default is 60 seconds. The value set in this property overrides the value set for the polling interval on the Polling tab when the FTP check box is selected. The value in this property is overridden by the value in the FtpServer configurable service property scanDelay, if it is set. 10. On the Transactions tab, set the transaction mode. Although all file operations are non-transactional, the transaction mode on this input node determines whether the rest of the nodes in the flow are to be executed under sync point or not. Select Yes if you want the flow updates to be treated transactionally, if possible, No if you do not. The default for this property is Yes. 11. Optional: On the Instances tab, set values for the properties that control the additional instances (threads) that are available for a node. For more details, see “Configurable message flow properties” on page 1398.
Terminals and properties The FileInput node terminals are described in the following table. Terminal
Description
Failure
The output terminal to which a message is routed if an error occurs before a message is propagated to the Out terminal. Messages propagated to this terminal are not validated, even if you have specified, using the Validate property, that validation should take place.
Out
The output terminal to which the message is routed if it has been successfully extracted from the input file. If no errors occur within the input node, a message received from an external resource is always sent to the Out terminal first.
880
Message Flows
Terminal
Description
End of Data
The output terminal to which the End of Data message is routed after all the messages in a file have been processed. The End of Data message flow transaction is initiated only if this terminal is attached.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by this node. Exceptions are caught only if this terminal is attached.
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 FileInput node Description properties are described in the following table: Property
M
C
Default
Description
Node name
No
No
FileInput
The name of the node.
Short description
No
No
None
A brief description of the node.
Long description
No
No
None
Text that describes the purpose of the node in the message flow.
The FileInput node Basic properties are described in the following table: Property
M
C
Default
Description
Input directory
Yes
Yes
None
The path of the directory from which input files are processed. The directory is in the file system to which the broker has access.
File name or pattern
Yes
Yes
*
A file name or string containing optional wildcard characters (* or ?) identifying the file or files to process from the input directory.
Action on successful processing
Yes
No
Delete
The action the node takes on the file after successfully processing the contents. Valid options are: v Move to Archive Subdirectory v Add Time Stamp and Move to Archive Subdirectory v Delete
Replace duplicate archive files
Yes
No
Cleared
This property controls whether the node replaces existing archive files with the same name as the input file. It applies only when Action on successful processing is not Delete.
The FileInput node Input Message Parsing properties are described in the following table. Property
M
C
Message Domain
No
No
Default
Description The domain that is used to parse the incoming message.
Message flows
881
Property
M
C
Message Set
No
No
Default
Description The name or identifier of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message Set property, or restore the reference to this message set project.
Message Type
No
No
The name of the incoming message.
Message Format
No
No
The name of the physical format of the incoming message.
Message coded character set ID
Yes
No
Broker System Default
The ID of the coded character set used to interpret bytes of the file being read.
Message encoding
Yes
No
Broker System Default
The encoding scheme for numbers and large characters used to interpret bytes of the file being read. Valid values are Broker System Determined or a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150.
The FileInput node Parser Options properties are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are: v On Demand v Immediate v Complete For a full description of this property, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the syntax elements in the message tree have data types taken from the XML Schema.
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing property, Message Domain, is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
882
Message Flows
Property
M
C
Default
Description
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The FileInput node Polling property is described in the following table: Property
M
C
Default
Description
Polling interval (seconds)
Yes
Yes
5
The polling interval in seconds.
The FileInput node Retry properties are described in the following table: Property
M
C
Default
Description
Retry mechanism
Yes
No
Failure
How the node handles a flow failure. Valid options are: v Failure v Short retry v Short and long retry
Retry threshold
Yes
Yes
0
The number of times to retry the flow transaction when Retry mechanism is Short retry.
Short retry interval
No
Yes
0
The interval, in seconds, between each retry if Retry threshold is not zero.
Long retry interval
No
Yes
300
The interval between retries, if Retry mechanism is Short and long retry and the retry threshold has been exhausted.
Action on failing file
Yes
Yes
Move to The action the node takes with the input file after all Backout attempts to process its contents fail. Valid options are: Subdirectory v Move to Backout Subdirectory v Delete v Add Time Stamp and Move to Backout Subdirectory
The FileInput node Records and Elements properties are described in the following table:
Message flows
883
Property
M
C
Default
Description
Record detection
Yes
No
Whole File
The mechanism used to identify records in the input file. Valid options are: v Whole File v Fixed Length v Delimited v Parsed Record Sequence
Length
Yes
No
80
The length of each record, in bytes, when Fixed Length record detection is selected.
Delimiter
Yes
No
DOS or UNIX Line End
The type of delimiter bytes that separate, or terminate, each record when Delimited record detection is selected. Valid options are: v DOS or UNIX Line End v Custom Delimiter
Custom delimiter
No
No
Delimiter type
Yes
No
The delimiter bytes, expressed in hexadecimal, when Delimited record detection and Custom Delimiter are selected. This property is mandatory only if the Delimiter property is set to Custom Delimiter. Postfix
The position of the delimiter when Delimited record detection and Custom Delimiter are selected. Valid options are: v Postfix v Infix This property is ignored unless the Delimiter property is set to Custom Delimiter.
The FileInput node Validation properties are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are v None v Content and Value v Content
Failure action
No
No
Exception
This property controls what happens if validation fails. Valid values are: v User Trace v Local Error Log v Exception v Exception List
The FileInput node FTP properties are described in the following table: Property
M
C
Default
Description
FTP
No
Yes
Cleared
This property defines whether the node uses the File Transfer Protocol (FTP) properties listed on the FTP tab and reads files from an FTP server.
884
Message Flows
Property
M
C
Default
Description
FTP server and port
No
Yes
None
Either the IP address or name (and, optionally, the port number) of a remote FTP server; for example, ftp.server.com:21, or the name of a configurable service of type ’FtpServer’. If a configurable service name is specified, the following FTP properties can be overridden by the configurable service.
Security identity
No
Yes
Server directory
No
Yes
″.″
The directory on the FTP server from which to transfer files. If you specify this property as a relative path, it is relative to the home directory after logon. This property is overridden by the remoteDirectory property, if set, in the FtpServer configurable service.
Transfer mode
No
No
Binary
The FTP transfer mode for transfer of file data. Valid options are:
The name of the user identification used to access the FTP server. This property is overridden by the securityIdentity property, if set, in the FtpServer configurable service.
v Binary v ASCII This property is overridden by the transferMode property, if set, in the FtpServer configurable service. Scan delay
No
Yes
60
The delay, in seconds, between remote directory scans. This property overrides the value set for Polling interval when the FTP check box is selected. This property is overridden by the scanDelay property, if set, in the FtpServer configurable service.
The FileInput node Transactions properties are described in the following table: Property
M
C
Default
Description
Transaction mode
No
Yes
Yes
The transaction mode on this input node determines whether the rest of the nodes in the flow are executed under sync point. Valid options are: v Yes v No
The FileInput node Instances properties are described in the following table. For a full description of these properties, see “Configurable message flow properties” on page 1398. Property
M
C
Default
Description
Additional instances pool
No
Yes
Use Pool Associated with Message Flow
The pool from which additional instances are obtained. v If you select Use Pool Associated with Message Flow, additional instances are obtained from the message flow pool. v If you select Use Pool Associated with Node, additional instances are allocated from the node’s additional instances based on the number specified in the Additional instances property.
Message flows
885
Property
M
C
Default
Description
Additional instances
No
Yes
0
The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
FileOutput node
|
Use the FileOutput node to write messages to files. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 889 v “Configuring the FileOutput node” on page 889 v “Terminals and properties” on page 893
Purpose You can write one or more messages from message flow transactions to a file in the broker’s file system. Each message, as it is written to a file, is converted to a sequence of bytes called a record. Records are accumulated until a process called finish processing is triggered. Finish processing happens when no more records remain to process. At this point, the accumulated file is placed in the specified output directory or a remote FTP server directory. Properties on the node specify how records are accumulated into files and where the files are placed when they are finished. The FileOutput node is contained in the File drawer of the palette and is represented in the workbench by the following icon:
Record processing The FileOutput node writes files as a sequence of one or more records. Each record is generated from a single message received on the In terminal of the node. By default, each file comprises a single record, and finish processing occurs immediately after the record is written. In other cases, you can set properties on the FileOutput node to specify that the file comprises multiple records and how these records are accumulated in a file. Records can be accumulated in a file in the following ways:
886
Message Flows
v Concatenated: The record from each message is appended, unmodified, to the file. v Padded: Each record is adjusted to be a specific length and padded with a padding byte, if necessary, before being appended to the file. v Delimited: A delimiter is used to separate or terminate the records as they are appended to the file. For each message received, whether on the In terminal or the Finish File terminal, you can modify the output directory and the name of the file to be written (or finished) by the use of elements of the message. You can specify these elements, which, by default, identify elements in the local environment, on the Request properties tab of the node. |
File (finish) processing
| | | | | |
The FileOutput node writes accumulated messages to files placed in a specified directory (the output directory) at either of the following times: v After each record when the file is to contain a single record. (Specify this behavior by setting the Record definition property to Record is Whole File on the Records and Elements tab.) v When the Finish File terminal receives a message.
| |
The name of the directory and the name of the file are determined by the node properties that you specify and by elements of the message that is being processed.
| | | | | | | | | |
The FileOutput node uses subdirectories of the output directory to create files during processing and to move files after processing. All of these subdirectories begin with the prefix mqsi, and include subdirectories called mqsitransit (the transit directory) and mqsiarchive (the archive directory). Records are not accumulated directly into a file in the output directory but are accumulated in a file in the transit directory. Files are moved from the transit directory to the output directory when finish processing occurs. If a file that is to be moved to the output directory has the same name as a file that is already in the output directory, the file in the output directory can be deleted, moved to the archive directory (mqsiarchive), or renamed before being moved to the mqsiarchive directory.
| | | |
You can specify that the FileOutput node transfer files to a remote FTP server as part of finish processing. If the file is successfully transferred, it can be deleted from the local file system, or, optionally, retained for the rest of finish processing to occur as usual.
| | |
During the FTP operation, the FileOutput creates the destination file. However, the destination file is readable before the FTP operation is complete. Therefore, ensure that remote applications do not read the file until the FTP operation is complete.
| | | | | |
When multiple records are written, finish processing does not occur after the writing of each record; it occurs only when a message is received on the Finish File terminal of the node. Any message received on the Finish File terminal causes finish processing to commence. This behavior takes the file from the transit directory and either moves it to the specified output directory or transfers it to a remote FTP directory.
| |
It is not an error for finish processing to be initiated and for no file to be present in the transit directory.
Message flows
887
If you set the Record definition property to Record is Whole File on the Records and Elements tab, finish processing does not occur when a message is received on the Finish File processing; finish processing will already have occurred.
| | |
Message propagation For every message received on the In terminal and successfully processed by the node, a copy is propagated to the Out terminal if it is attached. This behavior allows further processing of the message. For every message received on the Finish File terminal and successfully processed by the node, a copy is propagated to the End of Data terminal if it is attached. This behavior allows further processing after the finish of a file. When the FileOutput node propagates a message, either to the Out terminal or to the End of Data terminal, it stores information in the LocalEnvironment.WrittenDestination.File message tree. This table describes the LocalEnvironment.WrittenDestination.File elements: Element Name
Element Data Type
Description
Directory
CHARACTER
Absolute directory path of the output directory in the form used by the file system of the broker. For example, on Windows systems, the directory path starts with the drive letter prefix (such as C:).
Name
CHARACTER
File name of the output file.
Action
CHARACTER
Possible values are: v Replace if an output file of the same name is replaced. v Create if a new output file is created. v Append if this is associated with a record that is appended to an output file. v Finish if a Finish File message is received and no file is found to finish (for example, if Record is Whole File is specified and a message is sent to the Finish File terminal). v Transmit if the file was transferred by FTP and the file was not retained.
Timestamp
CHARACTER
The date and time, in character string form, when the node started to process this file. This value prefixes the names of files that are archived if you set the Output file action property to Time Stamp, Archive and Replace Existing File on the Basic tab.
Multiple instances Several message flows might need to write to the same file, which can happen where there are more than zero additional instances, or where there are multiple flows containing FileOutput nodes. The FileOutput node permits only a single instance, within an execution group and between execution groups, to write to a file at a time. While a record is being written (or while finish processing is being performed), all other instances in the execution group must wait. The order in which instances gain access is not defined. For finish processing, the first instance to gain access performs the processing, and other instances will fail to find the file. This is not an error in the flows, and the Action element of the LocalEnvironment.WrittenDestination.File message tree is set
888
Message Flows
to Finish for all instances that fail to discover the file in the transit directory.
Using this node in a message flow The FileOutput node can be used in any message flow that needs to output messages in files. Look at the following samples to see how to use this node: v File Output sample v Batch Processing sample v WildcardMatch sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the FileOutput node When you have put an instance of the FileOutput node into a message flow, you can configure it. 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 in that view. To configure the FileOutput node: 1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab. 2. On the Basic tab, enter the details of the files created by the FileOutput node. a. In Directory, specify the output directory in which the FileOutput node is to place its files. Specify the directory as an absolute or relative directory path. If the directory path is relative, it is based on the directory specified in the environment variable MQSI_FILENODES_ROOT_DIRECTORY. Examples are, on Windows, C:\fileoutput, and, on UNIX, /var/fileoutput. If you want to write files in the directory which is itself identified by MQSI_FILENODES_ROOT_DIRECTORY, ensure that you specify a value of . in this property. The output directory path to be used may be overridden by values in the current message. See the information relating to the Request tab for details about how to do this. b. In File name or pattern, specify a file name pattern. This defines the name of the file which is to be created by the FileOutput node. It is either a specific file name or a character sequence, a pattern, that matches a file name. Only patterns with a single wildcard character (the asterisk, ’*’) are allowed in this property field. The file name to be used is determined as follows: v If the file name contains no wildcard, then the value of this property is the name of the file created. This must be a valid file name on the file system which hosts the broker to which the message flow is deployed. v If the file name contains a single wildcard, then the value of the element LocalEnvironment.Wildcard.WildcardMatch in the current message replaces the wildcard character, and the resulting value is the name of the file created. This must be a valid file name on the file system which hosts the broker to which the message flow is deployed. If the WildcardMatch value is not found, the wildcard character is replaced by the empty string. The name of the file can be overridden by values in the current message. See the information relating to the Request tab for details about how to do this. If the File name or pattern property is empty, the name must be Message flows
889
overridden by the current message. Note that wildcard substitution occurs only if this property is not overridden in this way. File names are passed to the file system to which the broker has access and have to respect the conventions of these file systems. For example, file names on Windows systems are not case-sensitive, while, on UNIX systems, file names which differ by case are considered distinct. c. In Output file action, specify how the file is to be processed when it is finished. Choose from: v Replace Existing File, the default, to specify that if a file of the same name already exists in the output directory, the new file replaces it. v Create File, to specify that a new file is created, and that if a file of the same name already exists in the output directory, the new file remains in the transit directory and an exception is thrown. v Archive and Replace Existing File, to specify that if any file of the same name already exists in the output directory, it is moved to the archive directory before the new file is placed in the output directory. v Time Stamp, Archive and Replace Existing File, to specify that if a file of the same name already exists in the output directory, its name is augmented with a time stamp (a character-based version of the date and time) before being moved to the archive directory. d. Select the Replace duplicate archive files check box to specify that, in cases where Archive and Replace Existing File or Time Stamp, Archive and Replace Existing File is specified in Output file action, files moved to the archive directory replace files that exist there already with the same name. By default, this check box is not selected. If this check box is not selected, it means that a if a file in the archive directory has the same name as a file that is to be moved there, an exception is raised, and the new file remains in the transit directory. 3. On the Request tab, specify the location of the data to be written, and any control information overriding the Basic tab’s Directory and File name or pattern properties. You can specify the properties on this tab as XPath or ESQL expressions. Content-assist is available in the properties pane and also in the XPath Expression Builder which you can invoke by using the Edit button to the right of each property. a. In Data location, specify the input data location. This is the location in the input message tree that contains the record to be written to the output file. The default value is $Body, meaning the entire message body ($InputRoot.Body). When you are specifying this property and the data in the message tree that it identifies is owned by a model-driven parser, such as the MRM parser or XMLNSC parser, be aware of the following considerations: v If you are using MRM CWF format, ensure that the identified message tree exists as a message definition. If this is defined as a global element only, exceptions BIP5180 and BIP5167 are generated. v If you are using MRM TDS format, the serialization of the identified message is successful if the element is defined as a global element or message. However, if the identified field is not found as a global element or message, note that: – If this is a leaf field in the message tree, the field is written as self-defining. No validation occurs even if validation is enabled.
890
Message Flows
– If this is a complex element, an internal exception is generated, BIP5522, indicating that the logical type cannot be converted to a string. v If you are using MRM XML, the events are similar as for the MRM TDS format except that, if the field is a complex element, it is written as self-defining. v If you use the XMLNSC parser, no validation occurs even if validation is enabled. b. In Request directory property location, specify the location of the value to override the Directory property on the Basic tab. If you do not specify a location, the default value is $LocalEnvironment/Destination/File/ Directory. If you specify a location but the element is empty or missing, the Directory property is used. The element is defined as follows: Element data type
Element attributes
CHARACTER
Absolute or relative directory path. Use the path separator character (’/’ or ’\’) according to the file system on which the broker is executing. Trailing path separator characters are ignored. Relative directory paths are based on the value of the MQSI_FILENODES_ROOT_DIRECTORY environment variable.
c. In Request file name property location, specify the location of the value to override the File name or pattern property on the Basic tab. If you do not specify a location, the default value is $LocalEnvironment/Destination/File/ Name. If you specify a location but the element is empty or missing, the File name or pattern property is used. The element is defined as follows: Element data type
Element attributes
CHARACTER
Explicit file name. No wildcard substitution occurs for this value.
4. Use the Records and Elements tab to specify how the FileOutput node writes the record derived from the message. v In Record definition, choose from: – Record is Whole File to specify that the file is to contain a single record. The file is finished immediately after the record is written; the FileOutput node does not wait for a message on the Finish File terminal. This is the default. – Record is Unmodified Data to specify that records are accumulated in a file with neither padding or delimiters applied. The file is finished only when a message is received on the Finish File terminal. – Record is Fixed Length Data to specify that records are padded to a given length if necessary and accumulated in a file by concatenation. You specify this length in the Length property. If the record is longer than the value specified in Length, the node generates an exception. Use the Padding byte property to specify the byte to be used for padding the message to the required length. The file is finished only when a message is received on the Finish File terminal. – Record is Delimited Data to specify that records are separated by a delimiter and accumulated by concatenation. The delimiter is specified by the Delimiter, Custom delimiter, and Delimiter type properties. The file is finished only when a message is received on the Finish File terminal. Message flows
891
v In Length, specify the length (in bytes) of records when Record is Fixed Length Data is specified in Record definition. Records longer than this value cause an exception to be thrown. This must be a value between 1 byte and 100 MB. The default is 80 bytes. v When Record is Fixed Length Data is specified in Record definition, use Padding byte to specify the byte to be used when padding records to the specified length if they are shorter than this length. Specify this as 2 hexadecimal digits. The default value is X’20’. v In Delimiter, specify the delimiter to be used if you specify Record is Delimited Data in Record definition. Choose from: – Broker System Line End to specify that a line end sequence of bytes is used as the delimiter as appropriate for the file system on which the broker is to run. This is the default. For example, on Windows systems, this is a ’carriage-return, line-feed’ pair (X’0D0A’); on UNIX systems, this is a single ’line-feed’ byte (X’0A’); on z/OS systems, it is a ’newline’ byte (X’15’). – Custom Delimiter to specify that the explicit delimiter sequence defined in the Custom delimiter property is to be used to delimit records. v In Custom delimiter, specify the delimiter sequence of bytes to be used to be used to delimit records when Custom Delimiter is specified in the Delimiter property. Specify this as an even-numbered string of hexadecimal digits. The default is X’0A’ and the maximum length of the string is 16 bytes. v If you specified Record is Delimited Data in Record definition, use Delimiter type to specify how the delimiter is to separate records. Choose from: – Postfix to specify that the delimiter is added after each record that is written. This is the default. – Infix to specify that the delimiter is only inserted between any two adjacent records. 5. On the Validation tab, specify the parser validation properties of the node. For more information about validation, see “Validating messages” on page 187. For information on how to fill in this tab, see “Validation tab properties” on page 1386.
| | | |
6. On the FTP tab, select the FTP check box if you want the node to transfer files to an FTP server using the File Transfer Protocol properties. v In FTP server and port, supply the internet address and port number of an FTP server to be used. Use the following syntax: – or – :<port number>
| | | |
If you specify the internet address in IPv6 format, ensure that you enclose it in square brackets, for example: – [12a::13bd:24cd] or – [12a::13bd:24cd]:123 where 123 is the port number
| | | | | | | |
If you do not specify a port number, a port number of 21 is assumed. However, if an FtpServer configurable service is defined, then you can place the name of the configurable service in this field. See FtpServer configurable service properties for information on how an FtpServer configurable service definition and the properties on this tab interact. v In Security identity, specify the name of a security identity that has been defined using the mqsisetdbparms command. The user identifier and password that are to be used to logon to the FTP server are obtained from
| |
892
Message Flows
this definition the name of which should have the prefix ftp::. The value in this property is overridden by the value in the FtpServer configurable service property securityIdentity, if it is set.
| | |
v In Server directory, specify the directory in the FTP server to which to transfer files. The default is . which means the default directory after login. If you specify this as a relative path, this directory is based on the default directory after FTP login. Ensure that the syntax of the of the path conforms to the file system standards in the FTP server. The value in this property is overridden by the value in the FtpServer configurable service property remoteDirectory, if it is set. v In Transfer mode, specify how files are transferred. Select Binary if the file contents are not to be transformed. Select ASCII if the file is to be transmitted as ASCII. The value in this property is overridden by the value in the FtpServer configurable service property transferMode, if it is set. v Select the Retain local file after transfer check box if you want to retain a local copy of this after the file transfer process has completed. If this check box is selected, the local copies are processed after transfer as are other output files, as specified on the Basic tab. If it is not selected, successfully transferred files are not retained locally.
| | | | | | | | | | | | | | | |
Terminals and properties The FileOutput node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts a message for processing by the node.
Finish File
The input terminal that accepts a message that triggers the finishing of a file.
Out
The message received on the In terminal is propagated to this terminal if the record is written successfully. The message is unchanged except for status information in the Local Environment.
End of Data
The message received on the Finish File terminal is propagated to this terminal if the file is finished successfully.
Failure
The output terminal to which the message is routed if a failure is detected when the message is propagated.
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 FileOutput node Description properties are described in the following table: Property
M
C
Default
Description
Node name
No
No
FileOutput
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 FileOutput node Basic properties are described in the following table:
Message flows
893
Property
M
C
Default
Description
Directory
No
Yes
None
The directory where the node places its files.
File name or pattern
No
Yes
None
The specific file name or a pattern containing a single wildcard which defines the name of the file to be created.
Output file action
Yes
No
Replace Existing File
Specifies the action to be taken when the output file is finished. Valid options are: v Replace Existing File v Create File v Archive and Replace Existing File v Time Stamp, Archive and Replace Existing File
Replace duplicate archive files
Yes
No
Cleared
Specifies whether files in the archive directory can be replaced by files of the same name being moved there.
The FileOutput node Request properties are described in the following table: Property
M
C
Default
Description
Data location
Yes
No
$Body
The location in the input message tree containing the record written to the output file.
Request directory property location
Yes
Yes
$LocalEnvironment/Destination/File/Directory
The message element location containing the name of the output directory.
Request file name property location
Yes
Yes
$LocalEnvironment/Destination/File/Name
The message element location containing the name of the output file.
The FileOutput node Records and Elements properties are described in the following table: Property
M
C
Default
Description
Record definition
Yes
No
Record is Whole File
This property controls how the records are placed in the output file. Valid options are: v Record is Whole File v Record is Unmodified Data v Record is Fixed Length Data v Record is Delimited Data
Length
Yes
No
80
The required length of the output record. This property applies only when Record is Fixed Length Data is specified in Record definition.
Padding byte
Yes
No
X’20’
The 2-digit hexadecimal byte to be used to pad short messages when Record is Fixed Length Data is specified in Record definition.
Delimiter
Yes
No
Broker System Line End
The delimiter to be used when Record is Delimited Data is specified in Record definition. Valid options are: v Broker System Line End v Custom Delimiter
894
Message Flows
Property
M
C
Default
Description
Custom delimiter
No
No
None
The delimiter byte sequence to be used when Record is Delimited Data is specified in the Record definition property and Custom Delimiter is specified in the Delimiter property.
Delimiter type
Yes
No
Postfix
This property specifies the way in which the delimiters are to be inserted between records when Record is Delimited Data is specified in Record definition. Valid options are: v Postfix v Infix
The FileOutput node Validation properties are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are: v None v Content and Value v Content v Inherit
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are: v User Trace v Local Error Log v Exception v Exception List
The FileOutput node FTP properties are described in the following table: Property
M
C
Default
Description
FTP
No
No
Cleared
This property defines whether the node uses the File Transfer Protocol (FTP) properties listed on the FTP tab and transfers files to an FTP server.
FTP server and port
No
Yes
None
Either the IP address or name (and, optionally, the port number) of a remote FTP server, for example ftp.server.com:21, or the name of a configurable service of type ’FtpServer’. If a configurable service name is specified, any or all of the following FTP properties can be overridden by the configurable service.
Security identity
No
Yes
None
The name of the user identification used to access the FTP server. This property is overridden by the securityIdentity property, if set, in the FtpServer configurable service.
Server directory
No
Yes
″.″
The directory on the FTP server to which to transfer files. If you specify this as a relative path, this relative to the home directory after login. This property is overridden by the remoteDirectory property, if set, in the FtpServer configurable service.
Message flows
895
Property
M
C
Default
Description
Transfer mode
No
Yes
Binary
The FTP transfer mode for transfer of file data. Valid options are: v Binary v ASCII This property is overridden by the transferMode property, if set, in the FtpServer configurable service.
Retain local file after transfer
No
No
Cleared
If this check box is selected, a local copy of a file that has been transferred to a remote FTP server is retained and placed in the output directory in accordance with the disposition of files as specified on the Basic tab. If this check box is not selected, no local copies of files that have been transferred to a remote FTP server are retained.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Filter node
|
Use the Filter node to route a message according to message content. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 897 v “Terminals and properties” on page 897
Purpose Create a filter expression in ESQL to define the route that the message is to take. You can include elements of the input message or message properties in the filter expression, and you can use data that is held in an external database to complete the expression. The output terminal to which the message is routed depends on whether the expression evaluates to true, false, or unknown. Connect the terminals that cover all situations that could result from the filter; if the node propagates the message to a terminal that is not connected, the message is discarded even if it is transactional. The Filter node accepts ESQL statements in the same way as the Compute and Database nodes. The last statement that is executed must be a RETURN <expression> statement, whose expression evaluates to a Boolean value. This Boolean value determines the terminal to which the message is routed. In many cases, the routing algorithm is a simple comparison of message field values. The comparison is described by the expression and the RETURN statement is the only statement. If you code RETURN without an expression (RETURN;) or with a null expression, the node propagates the message to the Unknown terminal.
896
Message Flows
If your message flow requires more complex routing options, use the RouteToLabel and Label nodes. The Filter node is contained in the Routing drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following samples for examples of how to use this node: v Airline Reservations sample v Scribble sample v Error Handler sample v Large Messaging sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Consider a situation in which you have produced an online test with ten multiple choice questions. Each message coming in has a candidate name and address followed by a series of answers. Each answer is checked, and if it is correct, the field SCORE is incremented by one. When all the answers have been checked, the field SCORE is tested to see if it is greater than five. If it is, the Filter node propagates the message to the flow that handles successful candidate input; otherwise, the message is filtered into the rejection process, and a rejection message is created.
Terminals and properties When you have put an instance of the Filter node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 Filter node terminals 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 message is routed if a failure is detected during the computation
Unknown
The output terminal to which the message is routed if the specified filter expression evaluates to unknown or a null value
False
The output terminal to which the message is routed if the specified filter expression evaluates to false
True
The output terminal to which the message is routed if the specified filter expression evaluates to true
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 value 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).
Message flows
897
The Filter node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node The name of the node. type
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 Filter node Basic properties are described in the following table. Property
M
C
Data Source
No
Yes
Default
Description The ODBC data source name of the database that contains the tables to which you refer in the ESQL that is associated with this node (identified by the Filter Expression property). This name identifies the appropriate database 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
On z/OS systems, the broker uses the broker started task ID, or the user ID and password that are specified on the mqsisetdbparms command JCL, BIPSDBP, in the customization data set .SBIPPROC. If the ESQL that is associated with this node includes a PASSTHRU statement or SELECT function and a database reference, you must specify a value for the Data Source property. Transaction Yes
898
No
Message Flows
Automatic The transaction mode for the node. The values are: v Automatic (the default). The message flow, of which the Filter node is a part, is committed if it is successful. That is, the actions that you define in the ESQL module 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 rollback the action of the Filter node on the database depends on the success or failure of the entire message flow. v Commit. To commit any uncommitted actions that are performed in this message flow on the database that is 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.
Property
M
Filter Yes Expression
C
Default
Description
No
Filter
The name of the module within the ESQL resource (file) that contains the statements to execute against the message that is received in the node The ESQL file, which by default has the name <message_flow_name>.esql, contains ESQL for every node in the message flow that requires it. Each portion of code that is related to a specific node is known as a module. If you want the module name to include one or more spaces, enclose it in double quotes in the Filter Expression property. Code ESQL statements to customize the behavior of the Filter node in an ESQL file that is associated with the message flow in which you have included this instance of the Filter node. If an ESQL file does not already exist for this message flow, double-click the Filter node, or right-click the node and click Open ESQL to create and open a new ESQL file in the ESQL editor view. If the file exists already, click Browse beside the Filter Expression property to display the Module Selection dialog box, which lists the available Filter node modules defined in the ESQL files that can be accessed by this message flow (ESQL files can be defined in other, dependent, projects). Select the appropriate module and click OK; if no suitable modules are available, the list is empty. If the module that you specify does not exist, that module is created for you, and the editor displays it. If the file and the module exist already, the editor highlights the correct module. If a module skeleton is created for this node in a new or existing ESQL file, it consists of the following ESQL. The default module name is shown in this example: CREATE FILTER MODULE _Filter CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN RETURN TRUE; END; END MODULE; If you create your own ESQL module, you must create this skeleton exactly. You can update the default name, but ensure that the name that you specify matches the name of the corresponding node property Filter Expression. To customize this node, add your own ESQL after the BEGIN statement, and before the RETURN statement. If the expression on the RETURN statement is not TRUE or FALSE, its value is resolved to determine the terminal to which the message is propagated. If the expression resolves to a null value, or you code RETURN;, or you omit the RETURN statement, the node propagates the message to the Unknown terminal. You can use all the ESQL statements including SET, WHILE, DECLARE, and IF in this module, but (unlike the Compute node) the Filter node propagates the message that it receives at its input terminal to its output terminal unchanged. Therefore, in the Filter node, like the Database node, you have only one message to which to refer. The ESQL correlation names that you use in a Filter node are different from those used for a Compute node. You cannot modify any part of any message, so the assignment statement (the SET statement, not the SET clause of the INSERT statement) can assign values only to temporary variables. The scope of actions that you can take with an assignment statement is therefore limited. Message flows
899
Property
M
C
Default
Description
Treat warnings as errors
Yes
No
Cleared
For database warning messages to be treated as errors, and to propagate the output message from the node 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 safely as a normal return code in most circumstances.
Throw exception on database error
Yes
No
Selected
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 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). If an error has occurred, 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 can include the ESQL THROW statement to throw an exception in this node, or you can use the Throw node to generate your own exception at a later point.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
FlowOrder node
|
Use the FlowOrder node to control the order in which a message is processed by a message flow. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 901 v “Connecting the terminals” on page 901 v “Terminals and properties” on page 902
Purpose The FlowOrder node propagates the input message to the first output terminal, and the sequence of nodes that is connected to this terminal processes the message. When that message processing is complete, control returns to the FlowOrder node. If the message processing completes successfully, the FlowOrder node propagates the input message to the second output terminal, and the sequence of nodes that is connected to this terminal processes the message.
900
Message Flows
The message that is propagated through the second output terminal is the input message; it is not modified in any way, even if the sequence of nodes that is connected to the first terminal has modified the message. You can include this node in a message flow at any point where the order of execution of subsequent nodes is important. If you connect multiple nodes to the first output terminal, the second output terminal, or both, the order in which the multiple connections on each terminal are processed is random and unpredictable. However, the message is propagated to all target nodes that are connected to the first output terminal, which must all complete successfully, before the message is propagated to any node that is connected to the second output terminal. Your message flow performance can benefit from including the FlowOrder node in a situation where one sequence of processing that is required for a message is significantly shorter than another sequence of processing. If you connect the shorter sequence to the first terminal, any failure is identified quickly and prevents execution of the second longer sequence of processing. The FlowOrder node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow For an example of using this node, assume that your company receives orders from customers using the Internet. When the order is received, it is processed by nodes that are connected to the first terminal of a FlowOrder node to debit the stock level in your database and raise an invoice. A check is made to see whether the customer has indicated that his details can be sent to other suppliers. If the customer has indicated that he does not want this information to be divulged, this check fails and no further processing occurs. If the customer is happy for you to share his details with other companies (that is, the test is successful), the input message is propagated to the second terminal so that the customer’s details can be added to the mailing list.
Connecting the terminals The FlowOrder node has no configurable properties that impact its operation. You determine how it operates by connecting the first and second output terminals to subsequent nodes in your message flow. 1. Connect the First terminal to the first node in the sequence of nodes that provide the first phase of processing this message. This sequence can contain one or more nodes that perform any valid processing. The sequence of nodes can optionally conclude with an output node. 2. Connect the Second terminal to the first node in the sequence of nodes that provide the second phase of processing this message. This sequence can contain one or more nodes that perform any valid processing. The sequence of nodes can optionally conclude with an output node. The message that is propagated through the Second terminal is identical to that propagated through the First terminal. Any changes that you have introduced as a result of the first phase of processing are ignored by this node. Message flows
901
If the first phase of processing fails, the FlowOrder node does not regain control and does not propagate the message through the Second terminal.
Terminals and properties When you have put an instance of the FlowOrder node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. The FlowOrder node terminals 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 message is routed if a failure is detected during the computation.
First
The output terminal to which the input message is routed in the first instance.
Second
The output terminal to which the input message is routed in the second instance. The message is routed to this terminal only if routing to First is successful.
The following table describes 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 FlowOrder node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
FlowOrder
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 Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
HTTPHeader node
|
Use the HTTPHeader node to add, modify, or delete HTTP headers such as HTTPInput, HTTPResponse, HTTPRequest and HTTPReply. This topic contains the following sections: v “Purpose” on page 903 v “Using this node in a message flow” on page 903
902
Message Flows
v “Terminals and properties”
Purpose The HTTPHeader node provides a toolkit interface to manipulate HTTP headers without any need for coding; it does not modify the message body. You can add or remove a whole header, or selected header properties. You can set the properties to a fixed value, or to a value specified by an XPath expression that accesses a value in one of the message trees. XPath is used to provide a valid location from which a value for a property can be copied. For example, the location can be the body of the message, the local environment tree or exception list. HTTPInput and HTTPResponse headers can only be deleted or carried forward from the incoming message; their header properties cannot be modified or added to. The HTTPHeader node is contained in the HTTP drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following sample for more details about how to use the node: v HTTPHeader node sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. This node has no mandatory properties. HTTPHeader node terminals 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 routed if a failure is detected during extraction.
Out
The output terminal to which the transformed message is routed if the input message is processed successfully.
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 HTTPHeader node Description properties are described in the following table:
Message flows
903
Property
M
C
Default
Description
Node name
No
No
HTTPHeader
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.
HTTPInput Header properties are described in the following table: Property
M
C
Default
Description
HTTPInput Header Options
No
Yes
Carry forward header
Options to control the HTTPInputHeader as a whole. Select Carry forward the header to carry forward values from incoming message if present. Select Delete header to delete the header if present.
HTTPResponse Header properties are described in the following table: Property
M
HTTPResponse Header No Options
C
Default
Description
Yes
Carry forward header
Options to control the HTTPResponseHeader as a whole. Select Carry forward the header to carry forward values from incoming message if present. Select Delete header to delete the header if present.
HTTPRequest Header properties are described in the following table: Property
M
C
Default
Description
HTTPRequest Header Options
No
Yes
Carry forward header
Configure the HTTPRequest header. These options are available. Carry forward header Select this option to carry forward values from an incoming message. Add header Select this option to add new properties to the header, or to modify or delete existing properties. Modify header Select this option to add properties, or modify and delete existing properties. Delete header Select this option to remove the HTTPRequest header and all associated properties from the incoming message.
Clear incoming values
904
Message Flows
No
Yes
Cleared
This option, which is enabled only if you choose Modify header, removes all property names and associated values from the incoming message if present.
Property
M
C
Default
Description
HTTPRequest Header
No
Yes
No default value
This field is enabled only if you chose Add header or Modify header for the HTTPRequest Header Options. The screen has no predefined properties; you use it to create custom properties and values. Use the property table to add new properties, or modify or delete existing properties, for the header. There is no limit to the number of properties. Each property must have a name and a type qualifier. The type qualifier can be Value, XPath, or Delete. Value
Enter a new valid value for the selected property. A null value or empty string is also considered as a valid value.
XPath
Specify a valid XPath expression. WebSphere Message Broker supports XPath definitions that start with an XPath variable such as $Root or $LocalEnvironment. Only the first occurrence is returned if there are multiple values for the given XPath expression. (Examples of valid XPath expressions are: $LocalEnvironment/Host, and $Root/HTTPRequest/Content-Type).
Delete
Specify the property to be deleted from the incoming message. The value associated with the selected property is also deleted.
HTTPReply Header properties are described in the following table: Property
M
C
Default
Description
HTTPReply Header Options
No
Yes
Carry forward header
Configure the HTTPReply header. These options are available. Carry forward header Select this option to carry forward values from an incoming message. Add header Select this option to add new properties to the header, or to modify or delete existing properties. Modify header Select this option to add properties, or modify and delete existing properties. Delete header Select this option to remove the HTTPReply header and all associated properties from the incoming message.
Clear incoming values
No
Yes
Cleared
This option, which is is enabled only if you choose Modify header, removes all property names and associated values from the incoming message if present.
Message flows
905
Property
M
C
Default
Description
HTTPReply Header
No
Yes
No default value
This field is enabled only if you chose Add header or Modify header for HTTPRequest Header Options. The screen has no predefined properties; you use it to create custom properties and values. Use the property table to add new properties, or modify or delete existing properties, for the header. There is no limit to the number of properties. Each property must have a name and a type qualifier. The type qualifier can be Value, XPath, or Delete. Value
Enter a new valid value for the selected property. A null value or empty string is also considered as a valid value.
XPath
Specify a valid XPath expression. WebSphere Message Broker supports XPath definitions that start with an XPath variable such as $Root or $LocalEnvironment. Only the first occurrence is returned if there are multiple values for the given XPath expression. (Examples of valid XPath expressions are: $LocalEnvironment/Host, and $Root/HTTPRequest/Content-Type).
Delete
Specify the property to be deleted from the incoming message. The value associated with the selected property is also deleted.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
HTTPInput node
|
Use the HTTPInput node to receive an HTTP message from an HTTP client for processing by a message flow. This topic contains the following sections: v “Purpose” v “Using the HTTPInput and HTTPReply nodes to act as a Web server” on page 908 v “Using this node in a message flow” on page 908 v “Connecting the terminals” on page 909 v “Terminals and properties” on page 909
Purpose If you use the HTTPInput node with the HTTPReply and HTTPRequest nodes, the broker can act as an intermediary for Web services, and Web service requests can
906
Message Flows
be transformed and routed in the same way as other message formats that are supported by WebSphere Message Broker. Web service requests can be received either in standard HTTP (1.0 or 1.1) format, or in HTTP over SSL (HTTPS) format. Set the Use HTTPS property to choose to handle either HTTP or HTTPS requests. If your message flows are processing SOAP messages, use the SOAP nodes in preference to the HTTPInput node to take advantage of enhanced features, including WS-Addressing and WS-Security. If you include an HTTPInput node in a message flow, you must either include an HTTPReply node in the same flow, or pass the message to another flow that includes an HTTPReply node (for example, through an MQOutput node to a second flow that starts with an MQInput node). In the latter case, the request from, and reply to, the client are coordinated by the request identifier stored in the LocalEnvironment. The HTTPInput node handles messages in the following message domains: v MRM v XMLNSC v XMLNS v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) When the HTTPInput node receives a message from a Web service client, the node starts the appropriate parsers to interpret the headers and the body of the message, and to create the message tree that is used internally by the message flow. The node creates a unique identifier for the input message and stores it as a binary array of 24 bytes in the LocalEnvironment tree at LocalEnvironment.Destination.HTTP.RequestIdentifer. This value is used by the HTTPReply node and must not be modified in any way. HTTP messages are always non-persistent, and have no associated order. HTTP messages are non-transactional. However, if the message flow interacts with a database or another external resource, such as a WebSphere MQ queue, these interactions are performed in a transaction. The HTTPInput node provides commit or rollback, depending on how the message flow has ended, and how it is configured for error handling (how failure terminals are connected, for example). If the message flow is rolled back by this node, a fault message is generated and returned to the client. The format of the fault is defined by the Fault format property. If an exception occurs downstream in this message flow, and it is not caught but is returned to this node, the node constructs an error reply to the client. This error is derived from the exception, and the format of the error is defined by the Fault format property. If you include an output node in a message flow that starts with an HTTPInput node, the output node can be any of the supported output nodes (including user-defined output nodes). You can create a message flow that receives messages from Web service clients, and generates messages for clients that use all of the supported transports to connect to the broker. You can configure the message flow to request the broker to provide any conversion that is necessary.
Message flows
907
If you create a message flow to use as a subflow, you cannot use a standard input node; you must use an Input node as the first node to create an In terminal for the subflow. If your message flow does not receive Web service requests, use any of the other input nodes. The HTTPInput node is contained in the HTTP drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow You can use the HTTPInput node in any message flow that accepts HTTP or HTTPS messages. The most common example is a message flow that implements a Web service. For more information about Web services, see “Working with Web services” on page 669. The HTTPInput node supports HTTP POST and HTTP GET. For more information about enabling HTTP GET, see “HTTPRequest node” on page 915. Using the HTTPInput and HTTPReply nodes to act as a Web server: | | | | | | | | | | | |
A broker can support multiple HTTPInput nodes. When you configure the HTTPInput node, specify the requests to which the node listens. If the broker is listening on address http://localhost:7080, for a request http://localhost:7080/Joe/ Mary, the HTTP listener removes the HTTP address, leaving the request Joe/Mary. The listener then matches the request with the information that is specified in the URL selector of the HTTPInput node; this match is done from the most specific to the most generic data. For example, if any one of the following values was specified in an HTTPInput node:
| | | | | | | | | | | | | | |
this format gets the message if no other node matches the request. So for the request: http://localhost:777/Joe/Sally, it matches Joe/*. If the request does not match any URL selector, and you do not have an input node with /* specified, the HTTPInput node returns a response to the originator. For example:
/Joe /Joe/Mary /Joe/* /*
WebSphere MQ Integrator error report HTTP Status 404 - Resource Not Found
URI /soap does not map to any message flow in broker VCP1BRK WebSphere MQ Integrator 500
908
Message Flows
You can use a URL of /* to catch any requests that failed to match the URLs in the HTTPInput nodes, so that you can send a reply message and take other actions as appropriate.
|
The broker must be configured to use a port (the default is 7080). The HTTP listener is started by the broker when a message flow that includes HTTP nodes or Web Services support is started. When a request comes in, the listener sends the request to the HTTPInput node through a WebSphere MQ message. The HTTP listener listens on Internet Protocol Version 6 (IPv6) and Internet Protocol Version 4 (IPv4) addresses where supported by the operating system. To enable IPv6 listening on Windows and HPUX platforms, set the environment variable _JAVA_OPTIONS to -Djava.net.preferIPv4Stack=false. You can use the mqsichangetrace command to collect trace information for the HTTP listener. To process the log, use the mqsireadlog command with qualifier set to httplistener.
Connecting the terminals The HTTPInput node routes each message that it retrieves successfully to the Out terminal. If message validation fails, the message is routed to the Failure terminal; you can connect nodes to this terminal to handle this condition. If you have not connected the Failure terminal, the message is discarded, the Maximum client wait time expires, and the TCP/IP listener returns an error to the client. No other situations exist in which the message is routed to the Failure terminal. If the message is caught by this node after an exception has been thrown further on in the message flow, the message is routed to the Catch terminal. If you have not connected the Catch terminal, the message is discarded, the Maximum client wait time expires, and the TCP/IP listener returns an error to the client.
Terminals and properties When you have put an instance of the HTTPInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. The terminals of the HTTPInput node are described in the following table. Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs.
Out
The output terminal to which the message is routed if it is successfully retrieved.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by this 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 HTTPInput node Description properties are described in the following table.
Message flows
909
Property
M
C
Default
Description
Node name
No
No
The node type, HTTPInput
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 HTTPInput node Basic properties are described in the following table. Property
M
C
Default Description
Path suffix for URL
Yes
Yes
This property identifies the location from where Web service requests are retrieved. Do not use the full URL. If the URL that you want is http://[:<port>]/[<path>], specify either /<path> or /<path fragment>/* where * is a wild card that you can use to mean match any.
Use HTTPS
No
Yes
Cleared This property identifies whether the node is to accept secure HTTP. If the node is to accept secure HTTP, select the check box.
The HTTPInput node Input Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
BLOB
The domain that is used to parse the incoming message. If you leave this field blank, the default value is BLOB. Select the name of the parser that you are using from the list: v MRM v XMLNSC v XMLNS v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) You can also specify a user-defined parser, if appropriate.
Message set
No
No
The name or identifier of the message set in which the incoming message is defined. All available message sets are in the list. If you are using the MRM parser or the XMLNSC parser in validating mode, select the Message set that you want to use. This list is populated with available message sets when you select MRM or XMLNSC as the domain. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
Message format
No
910
No
The name of the incoming message. If you are using the MRM parser, select the type of message from the list in Message type. This list is populated with messages that are defined in the Message set that you have selected.
Message Flows
No
The name of the physical format of the incoming message. If you are using the MRM parser, select the format of the message from the list in Message format. This list includes all the physical formats that you have defined for this Message set.
The properties of the Parser Options for the HTTPInput node are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are On Demand, Immediate, and Complete. By default, this property is set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
Use XMLNSC compact parser for XMLNS domain
No
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or the input message Parsing property Message domain is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
No Retain processing instructions
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
No
The HTTPInput node Error handling properties are described in the following table. Property
M
C
Default
Description
Maximum client wait time (sec)
Yes
No
180
The length of time, in seconds, for which the TCP/IP listener that received the input message from the Web service client waits for a response from the HTTPReply node in the message flow. If a response is received within this time, the listener propagates the response to the client. If a response is not received in this time, the listener sends a SOAP Fault message to the client indicating that its timeout has expired. The valid range is zero (which means an indefinite wait) to (231)-1.
Fault format
No
Yes
SOAP 1.1
The format of any HTTP errors that are returned to the client. Valid values are SOAP 1.1, SOAP 1.2, and HTML.
Message flows
911
The Validation properties of the HTTPInput node are described in the following table. If a message is propagated to the Failure terminal of the node, it is not validated. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. . Property M
C
Default Description
Validate No
Yes
None
Failure action
No
ExceptionThis property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
No
This property controls whether validation takes place. Valid values are None, Content and Value, and Content.
The Security properties of the HTTPInput node are described in the following table. Set values for the properties that control the extraction of an identity from a message when a security profile is associated with the node. For more information about these properties, see Identity, Configuring identity extraction, Message flow security, and Setting up message flow security Property
M
C
Default Description
Identity token type
No
No
None
This property specifies the type of identity token present in the incoming message. Valid values are: Transport Default, Username, Username + Password, and X.509 Certificate. If this property is not specified, the identity is retrieved from the transport headers and the type is set to Username + Password.
Identity token location
No
No
None
This property specifies where, in the message, the identity can be found. The location is specified as an ESQL field reference or XPath. If this property is not specified, the identity is retrieved from the Authorization Transport headers.
Identity No password location
No
None
This property specifies where, in the message, the password can be found. The location is specified as an ESQL field reference or XPath. If you do not specify a value for this property, the password is retrieved from the Authorization Transport headers. You can set this property only if the Identity type is set to Username + Password.
Identity IssuedBy location
No
No
None
This property specifies a string or path expression that describes the issuer of the identity. The location is specified as an ESQL field reference or XPath. This property is used in an identity mapper. If you do not specify a value for this property, the default value is the name of the User Agent, or, if this name is not set, the string HTTP.
Treat No security exceptions as normal exceptions
No
False
This specifies whether to treat security exceptions (such as Access Denied) as normal exceptions, and propagate them down the failure terminal (if wired). This is turned off by default, which ensures that security exceptions cause the message to be backed out even if the failure terminal is wired.
The HTTPInput node Advanced properties are described in the following table. Property
M
C
Default Description
Set destination list
No
No
Selected This property specifies whether to add the method binding name to the route to label destination list. If you select this check box, the method binding name is added so that you can use a RouteToLabel node in the message flow after the HTTPInput node.
912
Message Flows
Property
M
C
Default Description
Label prefix
No
No
None
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | | |
The prefix to add to the method name when routing to label. Add a label prefix to avoid a clash of corresponding label nodes when you include multiple WebSphere Message Broker input nodes in the same message flow. By default, there is no label prefix, therefore the method name and label name are identical.
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
HTTPReply node Use the HTTPReply node to return a response from the message flow to an HTTP client. This node generates the response to an HTTP client from which the input message was received by the HTTPInput node, and waits for confirmation that it has been sent. This topic contains the following sections: v “Purpose” v “Connecting the output terminals to another node” on page 914 v “Terminals and properties” on page 914
Purpose The HTTPReply node can be used in any message flow that needs to accept HTTP or HTTPS messages. The most common example of this is a message flow that implements a Web service. For more information about Web services, see “Working with Web services” on page 669. If you include an HTTPReply node in a message flow, you must either include an HTTPInput node in the same flow, or the message must be received from another flow that is running in the same broker, and that started with an HTTPInput node. The response is associated with the reply by a request identifier that is stored in LocalEnvironment by the HTTPInput node. This node constructs a reply message for the Web service client from the entire input message tree, and returns it to the requestor. The HTTPReply node is contained in the HTTP drawer of the palette, and is represented in the workbench by the following icon:
Message flows
913
Connecting the output terminals to another node Connect the Out or Failure terminal of this node to another node in this message flow if you want to process the message further, process errors, or send the message to an additional destination.
Terminals and properties When you have put an instance of the HTTPReply node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 HTTPReply node terminals 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 message is routed if a failure is detected when the message is propagated.
Out
The output terminal to which the message is routed if it has been propagated successfully, and if further processing is required within this message flow.
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 HTTPReply node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
HTTPReply The name of the node.
Short No description
No
A brief description of the node.
Long No description
No
Text that describes the purpose of the node in the message flow.
The HTTPReply node Basic properties are described in the following table. Property
M
C
Default
Description
Ignore transport failures
Yes
No
Selected
Select Ignore transport failures if you want transport-related failures to be ignored (for example, if the client is disconnected). If you clear the check box, and a transport-related error occurs, the input message is propagated to the Failure terminal. If you clear the check box, you must supply a value for Reply send timeout (sec).
914
Message Flows
Property
M
Reply send Yes timeout (sec)
C
Default
Description
No
120
Set the Reply send timeout (sec) value if you are not ignoring transport failures. This property specifies the length of time, in seconds, that the node waits for an acknowledgment that the client has received the reply. If the acknowledgment is received within this time, the input message is propagated through the Out terminal to the rest of the message flow, if it is connected. If an acknowledgment is not received within this time, the input message is propagated through the Failure terminal, if it is connected. If the Failure terminal is not connected, and an acknowledgment is not received in time, an exception is generated. The valid range is zero (which means an indefinite wait) to (231)-1. This property is valid only if Ignore transport failures is cleared.
Generate Yes default HTTP headers from reply or response
No
Selected
Select Generate default HTTP headers from reply or response if you want the default Web service headers to be created using values from the HTTPReplyHeader or the HTTPResponseHeader. If the appropriate header is not present in the input message, default values are used. The node always includes, in the HTTPReplyHeader, a Content-Length header, which is set to the correct calculated value, even if this was not included in the original request.
The Validation properties of the HTTPReply node are described in the following table. If a message is propagated to the Failure terminal of the node, it is not validated. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure action
No
No
Exception This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
HTTPRequest node Use the HTTPRequest node to interact with a Web service by using all or part of the input message as the request that is sent to that service. This topic contains the following sections: v “Purpose” on page 916 v “Using the HTTPRequest node to issue a request to a Web service” on page 916 Message flows
915
v v v v
“Using the HTTPRequest node in a message flow” on page 917 “Configuring the HTTPRequest node” on page 919 “Terminals and properties” on page 924 “LocalEnvironment overrides” on page 927
Purpose You can also configure the node to create a new output message from the contents of the input message, augmented by the contents of the Web service response, before you propagate the message to subsequent nodes in the message flow. Depending on the configuration, this node constructs an HTTP or an HTTP over SSL (HTTPS) request from the specified contents of the input message, and sends this request to the Web service. The node receives the response from the Web service, and parses the response for inclusion in the output tree. The node generates HTTP headers if these are required by your configuration. You can use this node in a message flow that does or does not contain an HTTPInput or HTTPReply node. The HTTPRequest node handles messages in the following message domains: v MRM v XMLNSC v XMLNS v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) The HTTPRequest node is contained in the HTTP drawer of the palette, and is represented in the workbench by the following icon:
Using the HTTPRequest node to issue a request to a Web service An HTTP request has two parts: 1. The URL of a service. 2. A stream of data that the remote server processes, then sends back a response, which is often a SOAP or other Web service message in XML. The URL is of the format http://[:port]/; for example, http://localhost:7080/request. This URL can be specified statically in the HTTPRequest node parameters as a field in the message itself, or as a field in the LocalEnvironment. The data to be sent to the Web service can be the whole, or a portion of, the message tree, as specified in the HTTPRequest node properties. The data must be in CCSID 1208 format for most requests. The reply can replace the input message, or be inserted into the message tree; the location is specified in the HTTPRequest node parameters. The domain for the reply is XMLNS. If the request is successful, the HTTPResponse is inserted into the front of the message tree, the reply placed in the specified location in the tree, and the request
916
Message Flows
propagated to the Out terminal. If the HTTPRequest node is not able to issue the request, an ExceptionList is inserted into the message tree and the tree is propagated to the Failure terminal. If the request is sent successfully by the HTTPRequest node, but the Web service is not successful, the HTTPResponse is inserted into the message tree, and propagated to the Error terminal. The error message location parameter on the HTTPRequest node specifies where in the tree the response is placed, for example OutputRoot.XMLNS.error. You might need to use a Compute node to cast this response to an appropriate code page to be able to display the data, for example: Set OutputRoot.XMLNS.error850 = CAST(InputRoot.XMLNS.error.BLOB as CHAR CCSID 850);
For information about HTTP, see Hypertext Transfer Protocol - HTTP/1.1. For more information about HTTP return codes, see HTTP Response codes. You can specify a timeout interval, so that if the request takes longer than the specified duration, the request is propagated to the Error terminal with an appropriate message. For each request that the HTTPRequest node processes, it opens a connection, and then closes it when the response is returned. If the timeout interval is specified, the socket is closed after the interval. This closure ensures that a request gets only the correct response, and any response data for a request that has timed out is discarded. You can use the HTTP proxy to route a request through an intermediate site. You can run tools as a proxy to see the request and the response, and therefore debug your flows. The HTTP destination is as seen by the proxy; if you specify the HTTP destination of localhost, and the HTTP proxy is running on a different computer, the request is routed to the remote proxy computer, not the computer from which the original request was issued.
Using the HTTPRequest node in a message flow The HTTPRequest node can be used in any message flow that needs to send an HTTP request. The most common example of this is a message flow that calls a Web service. For more information about Web services, see “Working with Web services” on page 669.
Handling errors The node interacts directly with an external service using TCP/IP; it can, therefore, experience the following types of error: v Errors that are generated by TCP/IP, for example no route to host or connection refused. If the node detects these errors, it generates an exception, populates the exception list with the error information that is received, and routes the input message unchanged to the Failure terminal. v Errors that are returned by the Web server. These errors are represented by HTTP status codes that are outside the range 100 to 299. If the node detects these errors, it routes the reply to the Error terminal while following the properties specified on the Error tab.
Message flows
917
The reply is produced as a BLOB message because the node cannot determine in what format the reply will be. If you have not configured this node to handle redirection, messages with a redirection status code (3xx) are also handled in the same way.
HTTP Response Codes The HTTPRequest node treats the 100 series status codes as a ’continue’ response, discards the current response, and waits for another response from the Web server. The 200 series status codes are treated as success, the settings on the various tabs on the node determine the format of the output message that is generated. and the response is routed to the Out terminal of the node. The 300 series status codes are for redirection. If the Follow HTTP(s) Redirection property is selected, the node does not resend the request to the new destination that is specified in the response. If the Follow HTTP(s) Redirection property is not selected, the codes are treated as an error, as described in “Using the HTTPRequest node to issue a request to a Web service” on page 916. For more information about HTTP return codes, see HTTP Response codes. The 400 and 500 series status codes are errors, and are treated as described in “Using the HTTPRequest node to issue a request to a Web service” on page 916. For more information about HTTP return codes, see HTTP Response codes.
Manipulating headers If you select Replace input message with web-service response or Replace input with error, the header for the input message (the header that belongs to the message when it arrives at the In terminal of the HTTPRequest node) is not propagated with the message that leaves the HTTPRequest node. However, if one of the properties that specifies a location in the message tree is specified, the input message’s headers are propagated. The HTTPResponse header, which contains the headers that are returned by the remote Web service, is the first header in the message (after Properties) that is propagated from the node. This action is taken regardless of the options that are chosen. Therefore, for the reply from the HTTPRequest node to be put to a WebSphere MQ queue, manipulate the headers so that an MQMD is the first header (after Properties). If you are replacing the input message with a response, you can copy the input message’s MQMD to the Environment tree before the HTTPRequest node, and then copy it back into the message tree after the HTTPRequest node. If you are specifying a location for the response, in order to maintain existing input message headers, you must move or remove the HTTP Response header so that the MQMD is the first header. The following example contains ESQL that removes the HTTPHeader: SET OutputRoot = InputRoot; SET OutputRoot.HTTPResponseHeader = NULL;
The following example contains ESQL for moving the HTTPHeader, and therefore preserving the information that it provides:
918
Message Flows
SET OutputRoot = InputRoot; DECLARE HTTPHeaderRef REFERENCE TO OutputRoot.HTTPResponseHeader; DETACH HTTPHeaderRef; ATTACH HTTPHeaderRef TO OutputRoot.MQMD AS NEXTSIBLING;
Configuring the HTTPRequest node When you have put an instance of the HTTPRequest node into a message flow, you can configure the node; see “Configuring a message flow node” on page 259. 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. Configure the HTTPRequest node: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab: a. The HTTPRequest node determines the URL for the Web service to which it sends a request. Set one of the following three options; the node checks these in the order shown (that is, the first always overrides the second, the second overrides the third): 1) X-Original-HTTP-URL in the HTTPRequest header in the input message 2) LocalEnvironment.Destination.HTTP.RequestURL in the input message 3) The Web service URL property The first two options provide dynamic methods to set a URL for each input message as it passes through the message flow. To use either of these options, include a Compute node in the message flow, before the HTTPRequest node, to create and initialize the required value. The third option provides a value that is fixed for every message that is received in this node. Set this property to contain a default setting that is used if the other fields have not been created, or contain a null value. If either field contains a value, the setting of this property is ignored. The Web service URL property must contain a valid URL or the deployment will fail. Ensure that the value that you set in X-Original-HTTP-URL or the LocalEnvironment.Destination.HTTP.RequestURL is also a valid URL; if it is not, the node uses the default setting from the Web service URL property. If a URL begins http://, the request node makes an HTTP request to the specified URL. If the URL begins https://, the request node makes an HTTP over SSL (HTTPS) request to the specified URL, using the parameters that are specified on the SSL tab for the node. b. Set the value of the Request timeout (sec) property, which is the length of time, in seconds, that the node waits for a response from the Web service. If a response is received within this time, the reply is propagated through the Out terminal to the rest of the message flow. If a response is not received within this time, the input message is propagated through the Failure terminal, if it is connected. If the Failure terminal is not connected, and a response is not received in this time, an exception is generated. 3. On the HTTP Settings tab: a. In HTTP(S) proxy location, set the location of the proxy server to which requests are sent. b. Select Follow HTTP(S) redirection to specify how the node handles Web service responses that contain an HTTP status code of 300 to 399: Message flows
919
v If you select the check box, the node follows the redirection that is provided in the response, and reissues the Web service request to the new URL (included in the message content). v If you clear the check box, the node does not follow the redirection provided. The response message is propagated to the Error terminal. c. Select one of the options for the HTTP version property. Valid values are: 1.0 or 1.1. If you select the HTTP version property value 1.1, you can also select Enable HTTP/1.1 keep-alive. d. Select one of the options for the HTTP method property. Valid values are: POST, GET, PUT, DELETE, and HEAD. 4. On the SSL tab, if you want to use HTTP over SSL (HTTPS) requests, set the values for HTTPS requests: a. Specify the Protocol property that you want to use to make the request. Both ends of an SSL connection must agree on the protocol to use, so the chosen protocol must be one that the remote server can accept. The following options are available: v SSL. This option is the default. This option tries to connect using the SSLv3 protocol first, but allows the handshake to fall back to the SSLv2 protocol where the SSLv2 protocol is supported by the underlying JSSE provider. v SSLv3. This option tries to connect with the SSLv3 protocol only. Fallback to SSLv2 is not allowed. v TLS. This option tries to connect with the TLS protocol only. Fallback to SSLv3 or SSLv2 is not allowed. b. Set the Allowed SSL ciphers property. This setting allows you to specify a single cipher (such as SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA) or a list of ciphers that are the only ones used by the connection. This set of ciphers must include one or more that are accepted by the remote server. A comma is used as a separator between the ciphers. The default value is an empty string, which enables the node to use any, or all, of the available ciphers during the SSL connection handshake. This method gives the greatest scope for making a successful SSL connection. 5. On the Response Message Parsing tab, set values for the properties that describe the message domain, message set, message type, and message format that the node uses to determine how to parse the response message returned by the Web service. If an error message is returned by the Web service, the values of these properties are ignored, and the message is parsed by the BLOB parser. a. In Message domain, select the name of the parser that you are using from the list. If the field is blank, the default value is BLOB. Choose from the following options: v MRM v XMLNSC v XMLNS v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) You can also specify a user-defined parser, if appropriate.
920
Message Flows
b. If you are using the MRM parser or the XMLNSC parser in validating mode, select the relevant Message set from the list. This list is populated with available message sets when you select MRM or XMLNSC as the Message domain. c. If you are using the MRM parser, select the correct message from the list in Message type. This list is populated with messages that are defined in the Message set that you have selected. d. If you are using the MRM parser, select the format of the message from the list in Message format. This list includes all the physical formats that you have defined for this Message set. 6. On the Parser Options sub-tab: a. Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. b. If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 7. On the Error Handling tab, set values for the properties that determine how an error message returned by the Web service is handled: a. For the whole Web service error message to be propagated as the output message, leave Replace input with error selected (the default setting). For the Web service error message to be included in the output message with part of the input message content, clear Replace input with error and set the Error message location property. If you clear this property, the node copies the input message to the output message and writes the Web service error message over the output message content at the specified location (the input message itself is not modified). b. In the Error message location field, enter the start location (within the output message tree) at which the parsed elements from the Web service error message bit stream are stored. This property is required only if you have cleared Replace input with error. You can enter any valid ESQL field reference, including expressions within the reference and new field references (to create a new node in the message tree for the response). For example, enter: OutputRoot.XMLNSC.ABC.DEF
or Environment.WSError
If you select Replace input with error, this property is ignored. 8. On the Advanced tab, set values for the Advanced properties that describe the structure and content of the Web service request and response: a. Specify the content of the request message that is sent to the Web service: v For the request message to be the whole input message body, leave Use whole input message as request selected (the default setting). For the request message to contain a subset of the input message, clear Use whole input message as request and set the Request message location in tree property. v In the Request message location in tree field, enter the start location from which the content of the input message tree is copied to the request message. This property is required only if you have cleared Use whole
Message flows
921
input message as request. The node creates a new request message and copies the specified parts of the input message (the input message itself is not modified). You can enter any valid ESQL field reference, including expressions within the reference. For example, enter: InputRoot.XMLNSC.ABC
If you select Use whole input message as request, this property is ignored. When the appropriate message tree content is parsed to create a bit stream, the message properties (Message domain, Message set, Message type, and Message format) that are associated with the input message body and stored in the Properties folder are used. b. Specify the content of the output message that is propagated to the next node in the message flow: v For the whole Web service response message to be propagated as the output message, leave Replace input message with web-service response selected (the default setting). For the Web service response message to be included in the output message with part of the input message content, clear Replace input message with web-service response and set the Response message location in tree property. If you clear this property, the node copies the input message to the output message and writes the Web service response message over the output message content at the specified location (the input message itself is not modified). v In the Response message location in tree field, enter the start location (within the output message tree) at which the parsed elements from the Web service response message bit stream are stored. This property is required only if you have cleared Replace input message with web-service response. You can enter any valid ESQL field reference, including expressions within the reference, and including new field references (to create a new node in the message tree for the response). For example, enter: OutputRoot.XMLNSC.ABC.DEF
or Environment.WSReply
If you select Replace input message with web-service response, this property is ignored. When the response bit stream is parsed to create message tree contents, the message properties (Message domain, Message set, Message type, and Message format), that you have specified in the Response Message Parsing properties of the node, are used. c. For the node to generate an HTTPRequestHeader for the request message, leave Generate default HTTP headers from input selected (the default setting). If you do not want the node to generate an HTTPRequestHeader for the request message, clear Generate default HTTP headers from input. To control the contents of the HTTPRequestHeader that is included in the request message, include a Compute node that adds an HTTPRequestHeader to the input message before this HTTPRequest node in the message flow, and clear this check box.
922
Message Flows
v If you have selected Generate default HTTP headers from input and the input message includes an HTTPRequestHeader, the HTTPRequest node extracts Web service headers from the input HTTPRequestHeader and adds any unique Web service headers, except Host (see the following table), that are present in an HTTPInputHeader, if one exists in the input message. (An HTTPInputHeader might be present if the input message has been received from a Web service by the HTTPInput node.) The HTTPRequest node also adds the Web service headers shown in the following table, with default values, if these are not present in the HTTPRequestHeader or the HTTPInputHeader. Header
Default value
SOAPAction
″″ (empty string)
Content-Type
text/xml; charset=utf-8
Host
The host name to which the request is to be sent.
The HTTPRequest node also adds the optional header Content-Length with the correct calculated value, even if this value is not present in the HTTPRequestHeader or the HTTPInputHeader. v If you have selected Generate default HTTP headers from input and the input message does not include an HTTPRequestHeader, the HTTPRequest node extracts Web service headers, except Host, from the HTTPInputHeader (if it is present in the input message). The HTTPRequest node adds the required Web service headers with default values, if these values are not present in the HTTPInputHeader. v If you have cleared Generate default HTTP headers from input and the input message includes an HTTPRequestHeader, the node extracts all Web service headers present in the input HTTPRequestHeader. The node does not check for the presence of an HTTPInputHeader in the input message, and it does not add the required Web service headers if they are not supplied by the input HTTPRequestHeader. v If you have cleared Generate default HTTP headers from input and the input message does not include an HTTPRequestHeader, no Web service headers are generated. The HTTPRequest node does not check for the presence of an HTTPInputHeader in the input message and does not add any required Web service header. The request message is propagated to the Web service without an HTTPRequestHeader. This action typically causes an error to be generated by the Web service, unless the Web service is configured to handle the message contents. 9. On the Validation tab, set Validation properties if you want the parser to validate the body of response messages against the Message set. (If a message is propagated to the Failure terminal of the node, it is not validated.) These properties do not cause the input message to be validated. It is expected that, if such validation is required, the validation has already been performed by the input node or a preceding validation node. For more details see “Validating messages” on page 187 and “Validation properties” on page 1385.
Connecting the output terminals to another node Connect the Out, Error, or Failure terminal of this node to another node in this message flow to process the message further, to process errors, or to send the message to an additional destination. If you do not connect the Error terminal, the message is discarded. If you do not connect the Failure terminal, the broker Message flows
923
provides default error processing, see “Handling errors in message flows” on page 227.
Terminals and properties The HTTPRequest node terminals 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 message is routed if a failure is detected during processing in the node.
Out
The output terminal to which the message is routed if it represents successful completion of the Web service request, and if further processing is required within this message flow.
Error
The output terminal to which messages that include an HTTP status code that is not in the range 200 through 299, including redirection codes (3xx) if you have not set the property Follow HTTP(s) redirection property, is routed.
The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk on the panel 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 broker archive file to deploy it). The HTTPRequest node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, HTTPRequest
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 HTTPRequest node Basic properties are described in the following table. Property
M
C
Web service URL
Yes
Yes
Request timeout Yes (sec)
No
Default
Description The URL for the Web service. You must provide this in the form http://[:<port>]/[<path>] where v http:// must be specified. v <port> has a default of 80. If you specify a value, you must include the : before the port number. v <path> has a default of /. If you specify a value, you must include the / before the path.
120
The time in seconds that the node waits for a response from the Web service. The valid range is 1 to (231)-1. You cannot enter a value that represents an unlimited wait.
The HTTPRequest node HTTP Settings properties are described in the following table. Property
M
C
HTTP(S) proxy location
No
Yes
924
Message Flows
Default
Description The proxy server to which requests are sent. This value must be in the form hostname:port.
Property
M
C
Default
Description
Follow HTTP(S) redirection
No
No
Cleared
If you select the check box, redirections are followed. If you clear this check box, redirections are not followed.
HTTP version
No
Yes
1.0
The HTTP version to use for requests. Valid values are 1.0 and 1.1.
Enable HTTP/1.1 No keep-alive
Yes
Selected (if HTTP version is 1.1)
Use HTTP/1.1 Keep-Alive.
HTTP method
No
POST
The HTTP method. Valid values are POST, GET, PUT, DELETE, and HEAD. By default, the HTTPRequest node uses the HTTP POST method when it connects to the remote Web server. HEAD is used to determine whether a service is available - for example, by a network dispatcher trying to work out which servers are available - and sends back the correct headers (including content-length) but no body data.
No
The HTTPRequest node SSL properties are described in the following table. Property
M
C
Default
Description
Protocol
No
Yes
SSL
The SSL protocol to use when making an HTTPS request.
Allowed SSL ciphers
No
Yes
A comma-separated list of ciphers to use when making an SSL request. The default value of an empty string means use all available ciphers.
The HTTPRequest node Response Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
BLOB
The domain that will be used to parse the response message that is received from the Web service. If the field is blank then the default is BLOB.
Message set
No
No
The name or identifier of the message set in which the response message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the response message.
Message format
No
No
The name of the physical format of the response message.
The HTTPRequest node Parser Options properties are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand This property controls when a response message is parsed. Valid values are On Demand, Immediate, and Complete. For a full description of this property, see “Parsing on demand” on page 1389.
Message flows
925
Property
M
C
Default
Description
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
Use XMLNSC No compact parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the response message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Response Message Parsing properties Domain is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in a response message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in a response message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in a response message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the response message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if the Validate property is set toNone); entries that are specified in Opaque Elements are ignored if validation is enabled.
The HTTPRequest node Error Handling properties are described in the following table. Property
M
C
Default
Description
Replace input with error
No
No
Selected
If you select this check box, the input message content is replaced by the error message content. If you clear this check box, you must specify Error message location.
Error message location
Yes
No
OutputRoot
The start location at which the parsed elements from the Web service error bit stream are stored. This property takes the form of an ESQL field reference.
The HTTPRequest node Advanced properties are described in the following table. Property
M
C
Default
Description
Use whole input message as request
No
No
Selected
If you select this check box, the whole input message body is to be passed to the Web service. If you clear this check box, you must select Request message location in tree.
926
Message Flows
Property
M
C
Default
Description
Request message location in tree
Yes
No
InputRoot
The start location from which the bit stream is created for sending to the Web service. This property takes the form of an ESQL field reference.
Replace input message with web-service response
No
No
Selected
If you select this check box, the Web service response message replaces the copy of the input message as the content of the output message that is created. If you clear this check box, you must select Response message location in tree.
Response message location in tree
Yes
No
OutputRoot
The start location at which the parsed elements from the Web service response bit stream are stored. This property takes the form of an ESQL field reference.
Generate default HTTP headers from input
No
No
Selected
If you select this check box, an HTTPRequestHeader is generated. If you clear this check box, a valid HTTPRequestHeader must exist in the input message.
The HTTPRequest node Validation properties are described in the following table. For a full description of these properties see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
LocalEnvironment overrides You can dynamically override set values in the LocalEnvironment in the same way as setting values in other elements of a message. The following values can be set under LocalEnvironment.Destination.HTTP. Setting
Description
RequestURL
Overrides the Web service URL property on the node. For example: SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://ibm.com/abc/';
Timeout
Overrides the Request timeout (sec) property on the node. For example: SET OutputLocalEnvironment.Destination.HTTP.Timeout = 42;
ProxyURL
Overrides the HTTP(S) proxy location property on the node. For example: SET OutputLocalEnvironment.Destination.HTTP.ProxyURL = 'my.proxy';
RequestLine.RequestURI
Overrides the RequestURI, which is the path after the URL and port. For example: SET OutputLocalEnvironment.Destination.HTTP.RequestLine.RequestURI = '/abc/def?x=y&g=h';
RequestLine.HTTPVersion Overrides the HTTP version property on the node. For example: SET OutputLocalEnvironment.Destination.HTTP.RequestLine.HTTPVersion = 'HTTP/1.1'; KeepAlive
Overrides the Enable HTTP/1.1 keep-alive property on the node. For example: SET OutputLocalEnvironment.Destination.HTTP.KeepAlive = TRUE;
RequestLine.Method
Overrides the HTTP method property on the node. For example: SET OutputLocalEnvironment.Destination.HTTP.RequestLine.Method = 'GET';
Message flows
927
Setting
Description
SSLProtocol
Overrides the SSLProtocol. For example: SET OutputLocalEnvironment.Destination.HTTP.SSLProtocol = 'TLS'; Valid values are: SSL, SSLv3, and TLS.
SSLCiphers
Overrides the Allowed SSL Ciphers property on the node. For example: SET OutputLocalEnvironment.Destination.HTTP.SSLCiphers = 'SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA';
| | | | | | | | | |
ProxyConnectHeaders
Specifies additional headers that are used if the outbound request is an SSL connection through a proxy. These additional headers are sent with the initial CONNECT request to the proxy. For example, you can send proxy authentication information to a proxy server when you are using SSL. You can send multiple headers but each one must be separated by a carriage return and a line feed (ASCII 0x0D 0x0A), in accordance with RFC2616; for example: DECLARE CRLF CHAR CAST(X'0D0A' AS CHAR CCSID 1208); SET OutputLocalEnvironment.Destination.HTTP.ProxyConnectHeaders = 'Proxy-Authorization: Basic Zm5lcmJsZTpwYXNzd29yZA==' || CRLF || 'Proxy-Connection: Keep-Alive' || CRLF;
| | | | | |
This setting is used only if the request is an SSL request through a proxy server. To send proxy authentication information for a non-SSL request, specify the individual headers in the HTTPRequestHeader folder, as shown in the following example: SET OutputRoot.HTTPRequestHeader."Proxy-Authorization" = 'Basic Zm5lcmJsZTpwYXNzd29yZA=='; SET OutputRoot.HTTPRequestHeader."Proxy-Connection" = 'Keep-Alive'; UseFolderMode
Sets the UseFolderMode. Use for bitstream generation; for certain parsers this changes the output bitstream. For example: SET OutputLocalEnvironment.Destination.HTTP.UseFolderMode = TRUE;
Working with WrittenDestination data After the request has been made, the WrittenDestination folder in the LocalEnvironment is updated with the URI to which the request was sent. A WrittenDestination for an HTTPRequest node has the following format: WrittenDestination = ( HTTP = ( RequestURL = 'http://server:port/folder/page' ) )
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
928
Message Flows
IMSRequest node
| | | |
Use the IMSRequest node to send a request to run a transaction on a local or remote IMS system, and wait for a response. IMS Connect must be configured and running on the IMS system.
| | | |
This topic contains the following sections: v “Purpose” v “Using the IMSRequest node in a message flow” v “Terminals and properties” on page 930
|
Purpose
| |
The following example illustrates a situation in which you would use an IMSRequest node.
| | | | | | | | | | | | | |
WebSphere Message Broker can be used to expose an existing target IMS banking application as a Web Service. For example, the IMS application provides transactions that operate on a database that contains information about customers’ bank accounts. In this example, the Web service consumer sends a SOAP message across HTTP to WebSphere Message Broker and synchronously waits for the response. The WebSphere Message Broker message flow transforms the SOAP message to IMS format (including the LLZZ and transaction code fields), then sends that bit stream to IMS. The message flow waits for a response. IMS schedules the destination program and queues the request data for that program. The target program accesses the customer account database, builds a response message that consists of the account statement, and returns it to the WebSphere Message Broker message flow. The message flow transforms the IMS format to a SOAP format and sends that SOAP response back across HTTP to the Web service consumer.
| | |
The IMSRequest node is contained in the IMS drawer of the message flow node palette, and is represented in the workbench by the following icon:
| | | |
To enable nodes that are available in WebSphere Message Broker Version 6.1.0.3 and later, use the -f parameter on the mqsichangebroker command. For more information, see mqsichangebroker command.
|
Using the IMSRequest node in a message flow
| | | | | |
The IMSRequest node sends requests to IMS via IMS Connect. The node takes the incoming message’s bit stream and sends it to IMS. It then receives a bit stream, which it passes to the response parser. The bit stream that is sent to IMS must conform to the format that is shown in the following diagram:
LL
| | | | |
ZZ
Transacton name
Rest of data
The message flow that contains the IMSRequest node ensures that the message that is received by the IMSRequest node has this structure where: v LLZZ is a four-byte field. The first two bytes indicate the length of the bit stream, and the other two bytes are reserved for use by IMS. Message flows
929
| | | | |
v For request segments, the transaction code must follow. The transaction code can contain up to eight characters; if it contains less than eight characters, the transaction code must be delimited by a space. The response segments do not need to have the transaction name, but an IMS program can add it. v The rest of the data comprises anything else that the IMS program needs.
| | | |
The IMS program produces many messages. You can receive all messages as a single transmission bit stream, or you can receive them separately. Each message can contain multiple segments; all segments for each message are returned at the same time.
| | | | | | |
The IMSRequest has two modes of operation, which you specify by selecting or clearing the Use connection properties defined on node check box. If you select the check box, all properties are taken from the node by using the following properties in the node connection details section: v Hostname v Port number v Data store name
| | | |
If you clear the Use connection properties defined on node check box, all connection details are retrieved from the configurable services. However, if the Security identity property is set, the security identity on the configurable service is ignored and the value of the node property is used instead.
| | |
Look at the IMS Synchronous Request sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
|
Using configurable services for IMS nodes
| | |
You can configure IMS nodes to get connection details from a configurable service. For details about creating, changing, reporting, and deleting the configurable services, see “Changing connection details for IMS nodes” on page 206.
|
Terminals and properties
| | | | |
When you have put an instance of the IMSRequest node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 IMSRequest node terminals are described in the following table.
||
Terminal
Description
|
In
The input terminal that receives the message that triggers the node.
| |
Out
The output terminal to which the node sends a message after it has been received from the external resource. The message is sent to the terminal unchanged, except for some added status information.
|
Failure
If an error occurs in the IMSRequest node, the message is sent to the Failure terminal.
930
Message Flows
|
Terminal
Description
| | | | | | | | | |
Timeout
The output terminal to which the message is sent if a timeout occurs. The input message is propagated to this terminal with an exception list that describes the timeout. If the Timeout terminal is not connected and a timeout occurs, the message is routed to the Failure terminal. A timeout can occur in either of the following situations: v The IMS program has not responded by the time the execution timeout has expired. The execution timeout is configured by using the Timeout waiting for a transaction to be executed property on the IMSRequest node. v WebSphere Message Broker has not received the response across the TCP/IP network by the time the socket timeout expires. You can configure the socket timeout on the configurable service.
| | | | |
The following tables describe the node properties. The columns headed M indicate whether the property is mandatory (marked with an asterisk on the panel if you must enter a value when no default is defined); the columns headed C indicate whether the property is configurable (you can change the value when you add the message flow to the bar file to deploy it).
|
The IMSRequest node Description properties are described in the following table.
||
Property
| |
M
C
Default
Description
Node name No
No
The node type, IMSRequest
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 IMSRequest node Basic properties are described in the following table.
| ||
Property
M
C
Default Description
| | | | | |
Use connection properties defined on node
No
Yes
Selected If you select this check box, the connection properties that are defined on the node are used instead of a configurable service and security identity that are defined on the broker.
| | | |
Hostname
Yes
Yes
| | | | |
Port number
Yes
Yes
| | | | | | | |
Data store name
Yes
Yes
If you clear this check box, you must set the Configurable service and Security identity properties. The IP address or host name of the computer that is running the target IMS Connect system. This property is mandatory if the Use connection properties defined on node check box is selected and can be set only if the Use connection properties defined on node check box is selected. 0
The port number on which IMS Connect is listening for TCP/IP connections. You can obtain the port number from the IMS Connect job log on the IMS system. This property is mandatory only if the Use connection properties defined on node check box is selected and can be set only if the Use connection properties defined on node check box is selected. The name of the data store that IMS Connect is using. This value must match the ID parameter of the Datastore statement that is specified in the IMS Connect configuration member. This name also serves as the XCF member name for IMS during internal XCF communications between IMS Connect and IMS OTMA. You can obtain the data store name from the IMS Connect job log on the IMS system. This property is mandatory only if the Use connection properties defined on node check box is selected and can be set only if the Use connection properties defined on node check box is selected.
Message flows
931
|
Property
M
C
Default Description
| | | | | | |
Timeout waiting for a transaction to be executed
No
No
60
| | |
Configurable Yes service
You can set this property only if the Use connection properties defined on node check box is selected. If the check box is cleared, the ExecutionTimeoutSec property on the configurable service is used. Yes
The configurable service from which to get the connection details. All connection details are obtained from the configurable service, except for security information, which is obtained from the Security identity property.
| | | | | | | |
The time (in seconds) that the node waits for IMS to process a transaction. If IMS fails to process a transaction in this time, the node issues an exception, but the connection is not closed.
This property is mandatory if the Use connection properties defined on node check box is cleared, and can be set only if the Use connection properties defined on node is cleared. Security identity
No
Yes
An empty string
The security identity to look up in the broker to get the user name and password to use. You use the mqsisetdbparms command to set the security identity on the broker. The default value for this property is an empty string, which signifies that the user ID and password are not passed to IMS Connect.
The IMSRequest node Advanced properties are described in the following table.
| ||
Property
M
| | | | | | | | | | | | | |
Commit mode
Yes No
C
Default
Description
1: SEND_THEN_COMMIT
The commit mode to use when processing IMS transactions. Available values are: v 1: SEND_THEN_COMMIT: (the default value) The transaction is processed using commit mode 1 in IMS. The request transaction is run and data is sent back to the node. After the node acknowledges that it has received the response, the transaction is committed. You cannot process the response before it is committed. The node sends the response after the acknowledgment is sent to IMS. v 0: COMMIT_THEN_SEND: The transaction is processed using commit mode 0 in IMS. The request transaction is run and committed before data is sent back to the node. The node waits for all response messages to be returned before it continues processing.
932
Message Flows
|
Property
M
| | | | | | | | | | | | | | |
Sync level
Yes No
C
Default
Description
1: CONFIRM
The synchronization level to use when processing IMS transactions. If Commit mode is set to 0, the Sync level is automatically set to 1: CONFIRM. If Commit mode is set to 1, the Sync level property can have either of the following values: v 1: CONFIRM: (the default value) The node sends an acknowledgment to IMS after it receives the replies. The node then sends the response after the acknowledgment is sent to IMS. If you set the Sync level to 1: CONFIRM, the IMS program is blocked until the IMSRequest node acknowledges the transaction output, which might have an impact on performance. v 0: NONE: The node does not send any acknowledgments. This value is applicable only when Commit mode is set to 1.
| | | | | | | | | |
Typically, Sync level can be set to 0: NONE for read-only types of interactions, like queries, which do not need an acknowledgment. However, for critical transactions that involve updates and deletions, it is important to be able to acknowledge the output from IMS. If the acknowledgment is not received (for example, due to a connection failure between WebSphere Message Broker and IMS Connect), the transaction is backed out, avoiding the need for a compensation transaction.
The IMSRequest node Request properties are described in the following table.
| ||
Property
M
| | | | | |
Data Location
Yes No
C
Description
$Body
The location in the incoming message tree from which data is retrieved to form the request that is sent from the IMSRequest node to IMS. The default value, $Body, represents the incoming message body. You can enter any XPath or ESQL expression that defines the location of the message tree to serialize and send to IMS.
The IMSRequest node Result properties are described in the following table.
| ||
Property
| | | | | | | | | | | | | | |
Default
M
C
Default
Description
Output data No location
No
$OutputRoot
The message tree location to which the IMSRequest node copies the response message tree in the outgoing message assembly. The default value, $OutputRoot, replaces the incoming message with the response.
Copy local No environment
No
Selected
This property controls whether to copy the incoming local environment or propagate the incoming local environment. By default, this check box is selected, which signifies that the local environment is copied so that the incoming local environment is preserved. The additions to the local environment are visible only to nodes downstream of this node. If this check box is cleared, the incoming local environment is used for the outgoing message. Any modifications that are made to the local environment by this node are visible to both downstream and upstream nodes after this node has completed.
The IMSRequest node Response Message Parsing properties are described in the following table.
Message flows
933
||
Property
M
C
| |
Message domain
No
No
| | | | | |
Message set
No
No
| |
Message type
No
No
The name of the response message.
| |
Message format
No
No
The name of the physical format of the response message.
| | | |
Yes No Message coded character set ID
EBCDIC (500)
The ID of the coded character set that is used to interpret bytes of the file that is being read. Valid values are EBCDIC (500) and Broker System Default.
| | | | | |
Message encoding
Big Endian, with S390 Floating Point (785)
The encoding scheme for numbers and large characters that is used to interpret bytes of the file that is being read. Valid values are: v Little Endian, with IEEE Floating Point (546) v Big Endian, with IEEE Floating Point (273) v Big Endian, with S390 Floating Point (785) v Broker System Determined
Yes No
Default
Description The domain to use to parse the message from the external resource’s supplied bit stream.
Set automatically
| | |
The name of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
For more information about encoding, see “Converting data with message flows” on page 150.
The IMSRequest node Parser Options properties are described in the following table.
| | ||
Property
M
C
Default
Description
| | |
Parse timing
Yes
No
On Demand
This property controls when a response message is parsed. Valid values are On Demand, Immediate, and Complete.
| |
For a full description of this property, see “Parsing on demand” on page 1389.
| | | | |
Build tree using XML schema data types
Yes
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
| | | | | | |
Use XMLNSC compact Yes parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the response message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Response Message Parsing properties Domain is XMLNS.
| | | | | |
Retain mixed content
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in a response message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
934
Message Flows
Yes
|
Property
M
C
Default
Description
| | | | | |
Retain comments
Yes
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in a response message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
| | | | | | |
Retain processing instructions
Yes
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in a response message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
| | | | | | |
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the response message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
|
The IMSRequest node Validation properties are described in the following table.
|
For a full description of these properties see “Validation properties” on page 1385.
||
Property
M
C
Default
Description
| |
Validate
Yes
Yes
None
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
| | | | |
Failure action
Yes
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Input node Use the Input node as an In terminal for an embedded message flow (a subflow). This topic contains the following sections: v “Purpose” on page 936 v “Using this node in a message flow” on page 936 v “Terminals and properties” on page 936
Message flows
935
Purpose You can use a subflow for a common task that can be represented by a sequence of message flow nodes. For example, you can create a subflow to increment or decrement a loop counter, or to provide error processing that is common to a number of message flows. You must use an Input node to provide the In terminal to a subflow; you cannot use a standard input node (a built-in input node such as MQInput, or a user-defined input node). When you have started your subflow with an Input node, you can connect it to any In terminal on any message flow node, including an Output node. You can include one or more Input nodes in a subflow. Each Input node that you include provides a terminal through which to introduce messages to the subflow. If you include more than one Input node, you cannot predict the order in which the messages are processed through the subflow. The Input node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
When you select and include a subflow in a message flow, it is represented by the following icon:
When you include the subflow in a message flow, this icon shows a terminal for each Input node that you include in the subflow, and the name of the terminal (which you can see when you hover over it) matches the name of that instance of the Input node. Give your Input nodes meaningful names that you can recognize easily when you use their corresponding terminal on the subflow node in your message flow.
Using this node in a message flow Look at the following sample to see how to use this node: v Error Handler sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the Input node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. The Input node terminals are described in the following table.
936
Message Flows
Terminal
Description
Out
The input terminal that delivers a message to the subflow.
The following table describes 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 Input node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type, Input.
The name of the node.
Short No Description
No
A brief description of the node.
Long No Description
No
Text that describes the purpose of the node in the message flow.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
JavaCompute node Use the JavaCompute node to work with messages using the Java language. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 938 v “Specifying Java” on page 938 v “Terminals and properties” on page 939
Purpose Using this node, you can achieve the following tasks: v Examine an incoming message and, depending on its content, propagate it unchanged to one of the node’s two output terminals; the node behaves in a similar way to a Filter node, but uses Java instead of ESQL to decide which output terminal to use. v Change part of an incoming message and propagate the changed message to one of the output terminals using Java. v Create and build a new output message that is totally independent of the input message using Java. Message flows
937
The Java code that is used by the node is stored in an Eclipse Java project. The JavaCompute node is contained in the Transformation drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow The JavaCompute node uses the same execution model as Java user-defined nodes and therefore the restrictions and assumptions associated with Java user-defined nodes also apply to Java code developed for JavaCompute nodes, see Creating a message processing or output node in Java. Only one instance of the JavaCompute node is created regardless of the number of threads running against the flow (either as a result of additional instances or multiple input nodes). Therefore all of your user Java code must be threadsafe and reentrant. For more information see User-defined extensions execution model and Threading considerations for user-defined extensions. Double-click the JavaCompute node to open the New JavaCompute Node Class wizard. The wizard guides you through the creation of a new Java project and a Java class that contains some skeleton code. This skeleton code is displayed in a Java editor. For more information about creating Java code for a JavaCompute node, and for examples of the skeleton code or template that are provided, see “Creating Java code for a JavaCompute node” on page 498. If it is not the first time that you have double-clicked the node, the Java code is displayed. Look at the following sample to see how to use this node. v JavaCompute Node sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Specifying Java Code Java statements to customize the behavior of the JavaCompute node. For example, you can customize the node to create a new output message or messages, using input message or database content (unchanged or modified), or new data. For example, you might want to modify a value in the input message by adding a value from a database, and store the result in a field in the output message. Code the Java statements that you want in a Java file that is associated with the JavaCompute node. If a Java file does not already exist for this node, right-click the JavaCompute node and click Open Java to create and open a new Java file in the Editor view. If the file exists already, click Browse beside the Java Class property to display the JavaCompute Node Type Selection window, which lists the Java classes that can be accessed by this message flow. Select the appropriate Java class and click OK. The list of matching types show suitable Java classes when at least one character is entered in the Select field. All Java classes are shown if you enter ’*’ in the Select field. Restriction: Do not try to create another instance of a JavaCompute node from Java code; this is not supported.
938
Message Flows
Terminals and properties When you have put an instance of the JavaCompute node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. To associate an instance of a JavaCompute node with a Java class, configure the node’s properties. 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 JavaCompute node terminals 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 routed if a failure is detected during the computation. (Even if the Validate property is set, messages that are propagated to the Failure terminal of the node are not validated.)
Out
The output terminal to which the transformed message is routed.
Alternate
An alternative output terminal to which the transformed message can be routed, instead of to the Out terminal.
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 JavaCompute node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type: JavaCompute
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 JavaCompute node has the Basic property that is described in the following table. Property
M
C
Default Description
Java class
Yes
No
None
The name of the Java class that is used in this node. This name must be displayed in the list of Java classes that are available in the project references for the message flow project.
The Parser Options properties for the JavaCompute node are described in the following table.
Message flows
939
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, allowing an external application to remain unchanged. If outgoing messages do not contain MQRFH2 headers, this property has no effect.
The Validation properties of the JavaCompute node are described in the following table. Set the validation properties to define how the message that is produced by the JavaCompute node is validated. These properties do not cause the input message to be validated. It is expected that, if such validation is required, the validation has already been performed by the input node or a preceding validation node. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place, and what part of the message is validated. Valid values are None, Content and Value, Content, and Inherit.
Failure action
No
No
Exception This property controls what happens if a validation failure occurs. You can set this property only if Validate is set to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
JMSHeader node
|
Use the JMSHeader node to modify contents of the JMS Header_Values and Application properties so that you can control the node’s output without programming. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 941 v “Terminals and properties” on page 941
Purpose Use the node to control the output from a JMSOutput node. A subset of common values can be changed in the JMS Header, and user-chosen properties can be added, changed, or deleted for the Application properties.
940
Message Flows
For JMS Header_Values properties, the node provides a set of fields that you can modify using predefined values, user-defined values, or XPath expressions. XPath is used to provide a valid location from which a value for a property can be copied. For example, the location can be the body of the message, the local environment tree, or an exception list. For JMS Application properties, the node provides a way to add, modify, and delete name-value pairs of application properties. The JMSHeader node is contained in the JMS drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following sample for more details about how to use the node: v JMSHeader node sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. This node has no mandatory properties. JMSHeader node terminals 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 routed if a failure is detected during extraction.
Out
The output terminal to which the transformed message is routed if the input message is processed successfully.
The following tables describes 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 JMSHeader node Description properties are described in the following table: Property
M
C
Default
Description
Node name
No
No
JMSHeader
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.
Message flows
941
The JMSHeader node JMS transport header options are described in the following table: Property
M
C
Default
Description
JMS header options
No
Yes
Carry forward header
Options to control the JMSTransport header as a whole. Select Carry forward header to carry forward any values that are present in an incoming message. Select Add header to add a new header using the specified property values. If a header already exists, the header is modified using the specified property values. If Inherit from header is specified as a property value and the header does not exist, the default value for the property is used. Select Modify header to change an existing header using the specified property values. If a header does not exist, a new header is added first. If Inherit from header is specified as a property value and the header does not exist, the default value for the property is used. Select Delete header to delete the header, if it exists. Note: The Add header and Modify header options both add a header if it does not exist, and change a header if it does exist. However, the default values offered by each option differ, so use the appropriate option.
The JMSHeader node JMSHeader_Value properties are described in the following table: Property
M
C
Default
Description
JMS Delivery Mode
No
Yes
Non _Persistent
Filter messages by message delivery mode: v Non_Persistent v Persistent
JMS Message Expiration(ms)
No
Yes
0
Ask the JMS provider to keep the output JMS message for a specified time. Values are in milliseconds; the default value 0 means that the message should not expire.
JMS Message Priority
No
Yes
4
Assign relative importance to the message. A receiving JMS client application or a JMSOutput node can use this value. JMS defines a ten-level priority value, with 0 as the lowest priority and 9 as the highest.
JMS Correlation Identifier
No
Yes
No default value
A client can use the JMS Correlation Identifier header field to link one message with another. A typical use is to link a response message with its request message.
JMS Reply To
No
Yes
No default value
The JMS Reply To header field contains a destination supplied by a client when a message is sent. It is the destination where a reply message should be sent to.
The JMSHeader node Application properties are described in the following table:
942
Message Flows
Property
M
C
Default
Description
Application Properties
No
Yes
No default value
This screen is enabled only if you chose Add header or Modify header for JMS Transport header. The screen has no predefined properties; you use it to create custom properties and values. Use the property table to add new properties, or modify or delete existing properties, for the header. There is no limit to the number of properties. Each property must have a name, and a type qualifier. The type qualifier can be Value, XPath, or Delete.
Clear incoming values
||
Property
M
C
| | | | |
Events
No
No
|
Yes
Cleared
Enter a new valid value for the selected property. A null value or empty string is also considered as a valid value.
XPath
Specify a valid XPath expression. WebSphere Message Broker supports XPath definitions that start with an XPath variable such as $Root or $LocalEnvironment. Only the first occurrence is returned if there are multiple values for the given XPath expression. (Examples of valid XPath expressions are: $LocalEnvironment/ Host, and $Root/HTTPRequest/ContentType).
Delete
Specify the property to be deleted from the incoming message. The value associated with the selected property is also deleted.
This option, which is is enabled only if you choose Modify header, removes all property names and associated values from the incoming message if present.
The Monitoring properties of the node are described in the following table:
|
| | |
No
Value
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
JMSInput node Use the JMSInput node to receive messages from JMS destinations. JMS destinations are accessed through a connection to a JMS provider. This topic contains the following sections: v “Purpose” on page 944 v “Using the JMSInput node in a message flow” on page 944 v “Making the JMS provider client available to the JMS nodes” on page 945 Message flows
943
v “Connecting the terminals” on page 945 v “Configuring for coordinated transactions” on page 946 v “Terminals and properties” on page 948
Purpose The JMSInput node acts as a JMS message consumer and can receive all six message types that are defined in the Java Message Service Specification, version 1.1. Messages are received by using method calls, which are described in the JMS specification. The JMSInput node is contained in the JMS drawer of the palette, and is represented in the workbench by the following icon:
Using the JMSInput node in a message flow The following sample contains a message flow in which the JMSInput node is used. This sample is an example of how to use the JMSInput node. v JMS Nodes sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. The JMSInput node receives and propagates messages with a JMS message tree. You can set the properties of the JMSInput node to control the way in which the JMS messages are received. The JMSInput node handles messages in the following message domains: v BLOB v XMLNSC v XMLNS v MRM v JMSMap v JMSStream v MIME v XML (this domain is deprecated; use XMLNSC) Message flows that handle messages that are received from connections to JMS providers must always start with a JMSInput node. If you include an output node in a message flow that starts with a JMSInput node, it can be any of the supported output nodes (including user-defined output nodes); you do not need to include a JMSOutput node. However, if you do not include a JMSOutput node, you must include the JMSMQTransform node to transform the message to the format that is expected by the output node. If you are propagating JMS messages and creating a message flow to use as a subflow, you cannot use a standard input node; you must use an instance of the JMSInput node as the first node in order to create an In terminal for the subflow. When you use 32-bit execution groups in a default 64-bit host environment, you must set the WebSphere MQ JMS Java library paths on the MQSI_LIBPATH32. For example:
944
Message Flows
export MQSI_LIBPATH32=$MQSI_LIBPATH32:/usr/mqm/lib:/usr/mqm/java/lib
Restriction: When the JMSInput node receives publication topics, it internally restricts the message flow property Additional Instances to zero to prevent the receipt of duplicate publications.
Making the JMS provider client available to the JMS nodes Configurable services are defined for a number of JMS providers. You can choose one of the predefined services, or you can create a new service for a new provider, or for one of the existing providers. The predefined services are listed in Configurable services properties. v If you want to use the WebSphere MQ JMS provider, and you have installed WebSphere MQ in the default location on the broker system, the properties are already set and you do not have to make any changes. v If you want to use the WebSphere MQ JMS provider, and you have installed WebSphere MQ in a different (non default) location, or if you want to use one of the other defined services, you must set the jarsURL property to identify the location of the service JAR files on the broker system. Use the mqsireportproperties command to view the provider properties, and the mqsichangeproperties command to set or modify the properties. v If no service is defined for your JMS provider, or if you want to create another service for an existing JMS provider, use the mqsicreateconfigurableservice command to identify the new service and to set its properties. v When you configure the node, select the appropriate service from the list of predefined services shown for the JMS provider name property, or type in the name of your required service. v Some JMS providers provide an alternative interface to the standard JMS specification for particular JMS API calls. In these cases, IBM supplies a Java class to interface with that proprietary API. For example, if the JMS nodes use BEA WebLogic as the JMS provider, and the nodes need to participate in a globally coordinated message flow, you must modify the configurable services properties that are associated with that vendor. For more information, see “Configuring the broker to enable a JMS provider’s proprietary API” on page 205. v Some JMS providers, such as the BEA WebLogic provider, do not update the optional JMSXDeliveryCount field in the JMS message header; therefore, JMSInput node backout processing is not possible. To cope with any failures in the message flow, connect the Failure terminal of the JMSInput node.
Connecting the terminals For each message that is received successfully, the JMSInput node routes the message to the Out terminal. If this action fails, the message is retried. If the retry threshold is reached, where the threshold is defined by the Backout threshold property of the node, the message is routed to the Failure terminal. You can connect nodes to the Failure terminal to handle this condition. If an exception occurs in the failure path, the path is retried until the number of attempts is twice the Backout threshold. If that limit is exceeded, the message is put to the Backout destination. If you have not connected nodes to the Failure terminal, the message is written to the Backout destination. If you have not specified a Backout destination, the node issues a BIP4669 error message and stops processing further input. Message flows
945
If processing is not resumed after you restart the broker or execution group, check the event log for a cause, such as an incorrect parser being specified in the node properties. Correct the problem and redeploy the message flow. If the message itself is not valid, remove the message from the input queue to resume processing. If the message is caught by the JMSInput node after an exception has been generated elsewhere in the message flow, the message is routed to the Catch terminal. If you have not connected nodes to the Catch terminal, the node backs out messages for re-delivery until the problem is resolved, or the Backout threshold is reached. If you do not define a Backout destination, the node issues a BIP4669 error message and stops processing further input.
Configuring for coordinated transactions When you include a JMSInput node in a message flow, the value that you set for Transaction mode defines whether messages are received under sync point. v If you set this property to Global, the message is received under external sync point coordination; that is, within a WebSphere MQ unit of work. Any messages that are sent subsequently by an output node in the same instance of the message flow are put under sync point, unless the output node overrides this setting explicitly. v If you set this property to Local, the message is received under the local sync point control of the JMSInput node. Any messages that are sent subsequently by an output node in the flow are not put under local sync point, unless an individual output node specifies that the message must be put under local sync point. v If you set this property to None, the message is not received under sync point. Any messages that are sent subsequently by an output node in the flow are not put under sync point, unless an individual output node specifies that the message must be put under sync point. To receive messages under external sync point, you must take additional configuration steps, which need be applied only the first time that a JMSOutput or JMSInput node is deployed to the broker for a particular JMS provider. v On distributed systems, the external sync point coordinator for the broker is WebSphere MQ. Before you deploy a message flow in which the Transaction mode property is set to Global, modify the queue manager .ini file to include extra definitions for each JMS provider resource manager that participates in globally-coordinated transactions. –
Windows
1. 2. 3. 4.
On Windows systems:
Start WebSphere MQ Explorer. Right-click the queue manager name in the left pane and click Properties. Click XA resource managers in the left pane. Set the SwitchFile property to the following value: install_dir/bin/ JMSSwitch.dll XAOpenString=Initial Context,location JNDI,Optional_parms ThreadOfControl=THREAD
For more information, see the System Administration Guide section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. –
946
Message Flows
Linux UNIX On Linux and UNIX systems, add a stanza to the queue manager .ini file for each JMS provider. For example:
XAResourceManager: Name=Jms_Provider_Name SwitchFile=/install_dir/bin/ JMSSwitch.so XAOpenString=Initial Context,location JNDI,Optional_parms ThreadOfControl=THREAD
Where: Name
is an installation defined name that identifies a JMS provider resource manager.
SwitchFile is the file system path to the JMSSwitch library that is supplied in the bin directory of the broker. XAOpenString can have the following values: - Initial Context is the value that is set in the JMSInput node property Initial context factory. - location JNDI is the value that is set in the JMSInput node property Location JNDI bindings. This value must include the leading keyword, which is one of file://, iiop://, or ldap://. The following parameters are optional: - LDAP Principal matches the value that is set for the broker by using the mqsicreatebroker or mqsichangebroker commands. - LDAP Credentials matches the value that is set for the broker by using the mqsicreatebroker or mqsichangebroker commands. - Recovery Connection Factory Name is the JNDI administered connection factory that is defined in the bindings file . If a value is not specified, you must add a default value for recoverXAQCF to the bindings file. In either case, the Recovery Connection Factory must be defined as an XA Queue Connection Factory for the JMS provider that is associated with the Initial context factory. The optional parameters are comma separated and are positional. Therefore, any parameters that are missing must be represented by a comma. 1. Update the Java CLASSPATH environment variable for the broker’s queue manager to include a reference to xarecovery.jar; for example: install_dir/classes/xarecovery.jar
2. Update the Java PATH environment variable for the broker’s queue manager to point to the bin directory in which the SwitchFile is located; for example: install_dir/bin
Finally, ensure that you have taken the following configuration steps: – In the message flow, ensure that the co-ordinated property is enabled by using the Broker Archive editor. – Ensure that each node that must be part of the XA transaction is set to the global transaction mode. – Ensure that the service ID that is used for the broker and the queue manager is the same user ID. – Ensure that the JNDI connection factory objects that the JMS nodes use for a global transaction are configured to be of the type MQXAConnectionFactory, MQXAQueueConnectionFactory, or MQXATopicConnectionFactory. For more information, see the System Administration Guide section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. Message flows
947
To use the same queue manager for both the broker and the JMS provider, ensure that your WebSphere MQ installation is at the minimum required level: WebSphere MQ Version 6.0 Fix Pack 1 or above is required for XA to use the same queue manager for both the broker and the provider. v
On z/OS, the external sync point manager is Resource Recovery Services (RRS). The only JMS provider that is supported on z/OS is WebSphere MQ JMS. The only transport option that is supported for WebSphere MQ JMS on z/OS is the bind option. sync point control for the JMS provider is managed with RRS sync point coordination of the queue manager of the broker. You do not need to modify the .ini file. z/OS
Terminals and properties When you have put an instance of the JMSInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk. The terminals of the JMSInput node are described in the following table. Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs. Even if the Validation property is set, messages that are propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is retrieved successfully.
Catch
The output terminal to which the message is routed if an exception is generated downstream and caught by this 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 Description properties of the JMSInput node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, The name of the node. JMSInput
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 Basic properties of the JMSInput node are described in the following table.
948
Message Flows
Property
M
C
Default
Description
Source queue
No
No
Selected
The name of the queue from which the node receives incoming messages. If the node is to read from a queue (point-to-point), select Source queue and enter the name of the source queue, which is the JMS queue that is listed in the bindings file. This property is mutually exclusive with Subscription topic.
Subscription topic
No
No
Cleared
The name of the topic to which the node is subscribed. If the node is to read from a Subscription topic (publish/subscribe), select Subscription topic and enter the name of the subscription topic. v If you select Subscription topic, the node operates in the publish/subscribe message domain only. v This property is mutually exclusive with Source queue. v The Subscription topic name must conform to the standards of the JMS provider that is being used by the node.
Durable subscription ID
No
No
The identifier for a durable subscription topic. If the node is to receive publications from a durable subscription topic, enter a Durable subscription ID. v Removing a durable subscription is a separate administration task. For information about removing a durable subscription see the JMS provider documentation. v This property is valid only when a Subscription topic string has been specified.
The JMS Connection properties of the JMSInput node are described in the following table. Property
M
C
Default
Description
JMS provider Yes name
No
WebSphere MQ
Select a JMS vendor name from the list, or enter a name of your choice. When you select a name from the list, the Initial context factory property is updated automatically with the relevant java class. If you enter your own JMS provider name, you must also enter a value for the Initial context factory The name must match the name of a configurable service that is defined for the broker to which you deploy the message flow.
Initial context Yes factory
Yes
com.sun.jndi.fscontext.The starting point for a JNDI name space. RefFSContextFactory A JMS application uses the initial context to obtain and look up the connection factory and queue or topic objects for the JMS provider. If you select a JMS provider name from the list in JMS provider name, the Initial context factory property is updated automatically with the relevant Java class. If you enter your own JMS provider name, you must also enter a value for the Initial context factory. The default value is com.sun.jndi.fscontext.RefFSContextFactory, which defines the file-based Initial context factory for the WebSphere MQ JMS provider.
Message flows
949
Property
M
C
Location JNDI bindings
Yes
Yes
Default
Description The system path or the LDAP location for the bindings file. The bindings file contains definitions for the JNDI administered objects that are used by the JMSInput node. When you enter a value for Location JNDI bindings, ensure that it complies with the following instructions: v Construct the bindings file before you deploy a message flow that contains a JMSInput node. v Do not include the file name of the bindings file in this field. v If you have specified an LDAP location that requires authentication, configure the LDAP principal (userid) and LDAP credentials (password) separately. These values are configured at broker level. For information about configuring these values, see mqsicreatebroker command and mqsichangebroker command. v The string value must include the leading keyword, which must be one of the following options: – file:// – iiop:// – ldap:// For information about constructing the JNDI administered objects bindings file, see the JMS provider documentation.
Connection Yes factory name
Yes
The name of the connection factory that is used by the JMSInput node to create a connection to the JMS provider. This name must already exist in the bindings file. The Connection factory name can be a JMS QueueConnectionFactory or a JMS TopicConnectionFactory, but it must match the message model that is used by the node. Alternatively, you can specify the generic JMS ConnectionFactory, which can be used for both JMS queue or JMS topic destinations.
Backout destination
No
Yes
The JMSInput node sends input messages to this destination when errors prevent the message flow from processing the message, and the message must be removed from the input destination. The backout destination name must exist in the bindings file.
Backout threshold
No
Yes
0
The value that controls when a re-delivered message is put to the backout destination. For example, if the value is 3, the JMS provider attempts to deliver the message to the input destination three times. After the third attempted delivery, the message is removed from the input destination and is sent to the Backout destination.
The Input Message Parsing properties of the JMSInput node are described in the following table.
950
Message Flows
Property
M
C
Default
Message domain
No
No
Description The domain that is used to parse the incoming message. v MRM v XMLNSC v XMLNS v JMSMap v JMSStream v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) You can also specify a user-defined parser, if appropriate. The Message domain that is set on the node takes precedence except when the Message domain is set to blank on the node property. If Message domain is left blank, the JMSInput node determines the message domain in one of two ways: v By checking for the presence of data in the JMSType header value of the JMS input message v Based upon the Java Class of the JMS message For more information, see Order of precedence for deriving the message domain.
Message set
No
No
The name or identifier of the message set in which the incoming message is defined. If you are using the MRM parser or the XMLNSC parser in validating mode, select the Message set that you want to use. This list is populated with available message sets when you select MRM or XMLNSC as the Message domain. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message. If you are using the MRM parser, select the message that you want from the list in Message type. This list is populated with messages that are defined in the Message set that you have selected.
Message format
No
No
The name of the physical format of the incoming message. If you are using the MRM parser, select the format of the message from the list in Message format. This list includes all of the physical formats that you have defined for this Message set.
The properties of the Parser Options for the JMSInput node are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are: v On Demand v Immediate v Complete Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389.
Message flows
951
Property
M
C
Default
Description
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema.
Use XMLNSC compact parser for XMLNS domain
No
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing properties Message domain is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
For more information about how the XMLNSC parser operates, see “Manipulating messages in the XMLNSC domain” on page 391.
The Message Selectors properties of the JMSInput node are described in the following table. Set these properties if you need to filter messages. Property
M
C
Application property
No
Yes
Default
Description The message selector that filters messages according to the application property value. If the JMS provider is required to filter messages, based on message properties that are set by the originating JMS client application, enter a value for Application property, specifying both the property name and the selection conditions; for example, OrderValue > 200. Leave Application property blank if you do not want the input node to make a selection based on application property. For a description of how to construct the JMS message selector, see JMS message selector.
952
Message Flows
Property
M
C
Timestamp
No
Yes
Default
Description The message selector that filters messages according to the JMSTimestamp. If the JMS provider is required to filter messages that have been generated at specific times, enter a value for Timestamp, where the value is an unqualified Java millisecond time; for example, 105757642321. Qualify the selector with operators, such as BETWEEN or AND. Leave Timestamp blank if you do not want the input node to make a selection based on the JMSTimeStamp.
Delivery mode
No
Yes
All
The message selector that filters messages according to the message delivery mode. If the JMS provider is required to filter messages based on the JMSDeliveryMode header value in the JMS messages, select an option for Delivery mode from the list: v Select Non Persistent to receive messages that are marked as non persistent by the originating JMS client application. v Select Persistent to receive messages that are marked as persistent by the originating JMS client application. v Select All to receive both persistent and non persistent messages. (This value is the default.)
Priority
No
Yes
The message selector that filters messages according to the message priority. If the JMS provider is required to filter messages based on the JMSPriority header value in the JMS message, enter a value for Priority. Valid values for Priority are from 0 (lowest) to 9 (highest); for example, enter 5 to receive messages of priority 5. You can also qualify the selector; for example, > 4 to receive messages with a priority greater than 4, or BETWEEN 4 AND 8 to receive messages with a priority in the range 4 to 8. Leave Priority blank if you do not want the input node to make a selection based on the JMSPriority.
Message ID
No
Yes
The message selector that filters messages according to the message ID. If the JMS provider is required to filter messages based on the JMSMessageID header, enter a value for Message ID. Enter a specific Message ID or enter a conditional selector; for example, enter > WMBRK123456 to return messages where the Message ID is greater than WMBRK123456. Leave Message ID blank if you do not want the input node to make a selection based on JMSMessageID.
Redelivered
No
Yes
If the JMS provider is required to filter messages based on the JMSRedelivered header, enter a value for Redelivered: v Enter FALSE if the input node accepts only messages that have not been redelivered by the JMS provider. v Enter TRUE if the input node accepts only messages that have been redelivered by the JMS provider. v Leave Redelivered blank if you do not want the input node to make a selection based on JMSRedelivered.
Message flows
953
Property
M
C
Default
Correlation ID
No
Yes
Description The message selector that filters messages according to the correlation ID. If the JMS provider is required to filter messages based on the JMSCorrelationID header, enter a value for Correlation ID. Enter a specific Correlation ID or enter a conditional string; for example, WMBRKABCDEFG returns messages with a Correlation ID that matches this value. Leave Correlation ID blank if you do not want the input node to make a selection based on JMSCorrelationID.
The Advanced properties of the JMSInput node are described in the following table. Property M
C
Default
Description
TransactionYes mode
No
none
This property controls whether the incoming message is received under external sync point, local sync point, or out of sync point. v Select None if the incoming message is to be treated as non persistent. If you select this value, the message is received using a non-transacted JMS session that is created using the Session.AUTO_ACKNOWLEDGE flag. v Select Local if the JMSInput node must coordinate the commit or roll back of JMS messages that are received by the node, along with any other resources such as DB2 or WebSphere MQ that perform work within the message flow. If you select this value, the node uses a transacted JMS session. v Select Global if the JMSInput node must participate in a global message flow transaction that is managed by the broker’s external sync point coordinator. The sync point coordinator is the broker’s queue manager on distributed systems and RRS (Resource Recovery Services) on z/OS. If you select this value, any messages that are received by the node are globally coordinated using an XA JMS session.
The Validation properties of the JMSInput node are described in the following table. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are: v None v Content and Value v Content If you select Content or Content and Value, select an option from the Failure action list.
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are: v User Trace v Local Error Log v Exception (The default value) v Exception List
The Monitoring properties of the node are described in the following table:
|
954
Message Flows
||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
JMSMQTransform node Use the JMSMQTransform node to transform a message with a JMS message tree into a message that has a message tree structure that is compatible with the format of messages that are produced by the WebSphere MQ JMS provider. This topic contains the following sections: v “Purpose” v “Using the JMSMQTransform node in a message flow” v “Terminals and properties”
Purpose You can use the JMSMQTransform node to send messages to legacy message flows and to interoperate with WebSphere MQ JMS and WebSphere Message Broker publish/subscribe. The JMSMQTransform node handles messages in all supported message domains. The JMSMQTransform node is contained in the JMS drawer of the palette, and is represented in the workbench by the following icon:
Using the JMSMQTransform node in a message flow The following sample contains a message flow in which the JMSMQTransform node is used. Refer to this sample for an example of how to use the JMSMQTransform node. v JMS Nodes sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the JMSMQTransform node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. The terminals of the JMSMQTransform node are described in the following table.
Message flows
955
Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs. Even if the Validation property is set, messages that are propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is successfully retrieved from the JMS destination.
In
The input terminal that accepts a message for processing by the node.
The following table describes 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 JMSMQTransform node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type, JMSMQTransform
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 Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
JMSOutput node
|
Use the JMSOutput node to send messages to JMS destinations. This topic contains the following sections: v “Purpose” on page 957 v “Using the JMSOutput node in a message flow” on page 957 v “Controlling the type of the JMS output message” on page 957 v “Sending a JMS message to a destination list” on page 957 v “Making the JMS provider client available to the JMS nodes” on page 958 v “Using the Message Destination Mode” on page 958 v “Working with the JMS message ID” on page 960 v “Configuring for coordinated transactions” on page 961 v “Connecting the terminals” on page 963 v “Terminals and properties” on page 963
956
Message Flows
Purpose The JMSOutput node acts as a JMS message producer, and can publish all six message types that are defined in the Java Message Service Specification, version 1.1. Messages are published by using method calls, which are described in the JMS specification. The JMSOutput node is contained in the JMS drawer of the palette, and is represented in the workbench by the following icon:
Using the JMSOutput node in a message flow The following sample contains a message flow in which the JMSOutput node is used. Look at this sample for an example of how to use the JMSOutput node. v JMS Nodes sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Message flows that handle messages that are received from connections to JMS providers must always start with a JMSInput node. If you include the JMSOutput node in a message flow, you do not need to include a JMSInput node; but if you do not include a JMSInput node, you must include the MQJMSTransform node to transform the message to the format that is expected by the JMSOutput node. If you are propagating JMS messages and creating a message flow to use as a subflow, use an instance of the JMSOutput node as the last node to create an out terminal for the subflow.
Controlling the type of the JMS output message In the JMS message tree, the JMS message type is represented by the PayloadType field of the Message_MetaData subfolder. To control the type of JMS message that is created by the JMSOutput node, use ESQL code to set the Payload value, as shown in the following example: SET OutputRoot.JMSTransport.Transport_Folders.Message_MetaData.PayloadType=Payload value
For more information about the JMS message tree and payload values, see Representation of messages across the JMS Transport.
Sending a JMS message to a destination list To send a JMS message to a destination list, ensure that the following conditions are met. v Select Send to destination list in local environment on the Basic properties tab of the JMSOutput node. v Set up the list in the LocalEnvironment, as shown in the following example. CREATE PROCEDURE CreateJMSDestinationList() BEGIN SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[1] SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[2] SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[3] END;
= 'jndi://TestDestQueue1'; = 'jndi://TestDestQueue2'; = 'jndi://TestDestQueue3';
Message flows
957
v Ensure that the message model (point-to-point or publish/subscribe) matches the model that is used by the JMSOutput node. In this case, the model is point-to-point. v If the destination name in the list is prefixed with the string “jndi://”, it indicates to the JMSOutput node that the value represents the name of a JNDI administered object, which needs to be looked up. Alternatively, if the JMS provider-specific format for a destination is known, it can be used; for example, queue://qmgrname/queuename for WebSphere MQ. Otherwise, the value is used to create a temporary destination. v The items to which the JMS destination list refers represent JMS destinations that can be either JMS queues or JMS topics. These destination types must be consistent with the connection factory type that is specified in the JMSOutput node that will process the destination list. For example, a JMS queue destination can be processed by a JMS QueueConnectionFactory or a generic JMS ConnectionFactory. Similarly, a JMS topic destination can be processed using a JMS TopicConnectionFactory or a generic JMS ConnectionFactory.
Making the JMS provider client available to the JMS nodes Configurable services are defined for a number of JMSProviders. You can choose one of the predefined services, or you can create a new service for a new provider, or for one of the existing providers. The predefined services are listed in Configurable services properties. v If you want to use the WebSphere MQ JMS Provider, and you have installed WebSphere MQ in the default location on the broker system, the properties are already set and you do not have to make any changes. v If you want to use the WebSphere MQ JMS Provider, and you have installed WebSphere MQ in a different (non default) location, or if you want to use one of the other defined services, you must set the jarsURL property to identify the location of the service JAR files on the broker system. Use the mqsireportproperties command to view the provider properties, and the mqsichangeproperties command to set or modify the properties. v If no service is defined for your JMS provider, or if you want to create another service for an existing JMS provider, use the mqsicreateconfigurableservice command to identify the new service and set its properties. v When you configure the node, select the appropriate service from the list of predefined services shown for the JMS provider name property, or type in the name of your new service. v Some JMS providers provide an alternative interface from the standard JMS specification for particular JMS API calls. In these cases, IBM supplies a Java JAR file to interface with that proprietary API. For example, if the JMS nodes use BEA WebLogic as the JMS provider, and the nodes need to participate in a globally coordinated message flow, you must modify the configurable services properties that are associated with that vendor. For more information, see “Configuring the broker to enable a JMS provider’s proprietary API” on page 205.
Using the Message Destination Mode The JMSOutput node acts as a message producer and supports the following message scenarios: v “Sending a datagram message” on page 959 v “Sending a reply message” on page 959 v “Sending a request message” on page 960
958
Message Flows
For more information about how to build JMS destination lists, see “Populating Destination in the LocalEnvironment tree” on page 337.
Sending a datagram message A datagram is a self-contained, independent entity of data that carries sufficient information to be routed from the source to the destination computer, without reliance on earlier exchanges between the source and destination computer and the transporting network. The following instructions describe how to send a datagram message: 1. On the Basic tab, set the message destination depending on the message model that is being used. Set one of the following properties to a valid JNDI administered object name: v Publication Topic v Destination Queue 2. Leave the Reply To Destination field blank. The node resolves the name of the JNDI administered object, which is supplied in either Publication Topic or Destination Queue, and sends the message to that JMS Destination.
Sending a reply message The sender of a message might want the recipient to reply to the message. In this case, the JMSOutput message can treat the outgoing message as a reply, and route it according to the value that is obtained from the JMSReplyTo property from the request message. You can modify the value of the JMSReplyTo property in the MbMessage; for example, using a Compute node or a JavaCompute node. This action allows dynamic routing of messages from the JMSOutput node. The node sends the message to the JMS Destination name that is set in the JMSReplyTo field of the MbMessage Tree. The JMSReplyTo value in the MbMessage Tree represents the name of the JMS Destination that is resolved from JNDI. For example: queue://QM_mn2/myJMSQueue4
In this case, the value is the JMS-provider specific representation of a JMS Destination for the WebSphere MQ JMS provider. If you do not want to specify a resolved JMS destination name, the JMSOutput node can also accept a JNDI administered object name in the JMSReplyTo field. However, the node must resolve an administered object name through JNDI before it can route the message to the underlying JMS Destination. In this case, the value in the JMSReplyTo field must be prefixed with the string: jndi:\\. For example: jndi:\\jmsQ4
where jmsQ4 is the name of the JNDI-administered object. Performance might be slightly impacted when you use this method because of the need to look up the administered object in JNDI.
Message flows
959
Sending a request message The JMSOutput node can send a message to a JMS Destination with the expectation of a response from the message consumer that processes the request. The following instructions describe how to send a request message: 1. On the Basic tab, set the message destination depending on the message model that is being used. Set one of the following properties to a valid JNDI-administered object name: v Publication Topic v Destination Queue 2. The JMSReplyTo destination in the outgoing message can be derived from the JMSReplyTo field of the MbMessage Tree that is passed to the node. Alternatively, this value can be overridden by a JNDI-administered object name that is set in the Reply To Destination node property. To allow the JMSOutput node to set the JMSReplyTo property dynamically in the outgoing message, leave the Reply To Destination field blank on the Basic tab, and set the JMSReplyTo value in the MbMessage using a Compute node or a JavaCompute node. The node looks first for a value in the JMSReplyTo field of the MbMessage. If the node finds the value, it passes this value into the JMSReplyTo field of the outgoing message. However, if the Reply To Destination field of the Basic tab has been specified, this value overrides anything that is set previously in the JMSReplyTo property of the outgoing message, after first resolving the name of the JNDI-administered object. The node resolves the name of the JNDI-administered object that is supplied in either Publication Topic or Destination Queue, and sends the message to that JMS Destination.
Working with the JMS message ID The JMS message ID is generated by the JMS provider when a message is sent by the JMSOutput node. You cannot set the message ID in the message flow, but you can use one of the following methods to obtain the generated ID after the message has been sent: v Connect a Compute node to the Out terminal. Connect a Compute node to the Out terminal of a JMSOutput node and interrogate the WrittenDestination List. For more information, see “Viewing the logical message tree in trace output” on page 189. An entry for a JMSOutput node has the following format: WrittenDestination = ( JMS = ( DestinationData = ( destinationName = 'queue://jmsQueue1' initialContext = 'com.sun.jndi.fscontext.RefFSContextFactory' JMSMessageID = ID:414d512054657374514d2020202020206ab98b4520017a02' JMSCorrelationID = 'ABCDEFGHIJKLMNOPQRSTUVW' ) ) )
v Configure a user exit to process an output message callback event. For more information, see “Exploiting user exits” on page 222.
960
Message Flows
Configuring for coordinated transactions When you include a JMSOutput node in a message flow, the value that you set for Transaction Mode defines whether messages are sent under syncpoint. v If you set the Transaction Mode to Global, the message is sent under external syncpoint coordination; that is, within a WebSphere MQ unit of work. Any messages that are sent subsequently by an output node in the same instance of the message flow are put under syncpoint, unless the output node overrides this setting explicitly. v If you set the Transaction Mode to Local, the message is sent under the local syncpoint control of the JMSOutput node. Any messages that are sent subsequently by an output node in the flow are not put under local syncpoint, unless an individual output node specifies that the message must be put under local syncpoint. v If you set the Transaction Mode to None, the message is not sent under syncpoint. Any messages that are sent subsequently by an output node in the flow are not put under syncpoint, unless an individual output node specifies that the message must be put under syncpoint. When you want to send messages under external syncpoint, you must perform additional configuration steps, which need to be applied only the first time that a JMSOutput or JMSInput is deployed to the broker for a particular JMS provider: v On distributed systems, the external syncpoint coordinator for the broker is WebSphere MQ. Before you deploy a message flow in which the Transaction Mode is set to Global, modify the queue manager .ini file to include extra definitions for each JMS provider resource manager that participates in globally coordinated transactions: –
On Windows systems: 1. Start WebSphere MQ Explorer. Windows
2. Right-click the queue manager name in the left pane and click Properties. 3. Click XA resource managers in the left pane. 4. Set the SwitchFile property to the following value: install_dir/bin/ JMSSwitch.dll XAOpenString=Initial Context,location JNDI,Optional_parms ThreadOfControl=THREAD
For more information, see the System Administration Guide section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. –
On Linux and UNIX systems, add a stanza to the queue manager’s .ini file for each JMS provider. For example: Linux
UNIX
XAResourceManager: Name=Jms_Provider_Name SwitchFile=/install_dir/bin/JMSSwitch.so XAOpenString=Initial Context,location JNDI,Optional_parms ThreadOfControl=THREAD
Where: Name
is an installation-defined name that identifies a JMS provider resource manager.
Message flows
961
SwitchFile is the file system path to the JMSSwitch library that is supplied in the bin directory of the broker. XAOpenString can have the following values: - Initial Context is the value that is set in the JMSInput node basic property Initial context factory. - location JNDI is the value that is set in the JMSInput node basic property Location of JNDI. This value must include the leading keyword, which is file://, iiop:// or ldap:// The following parameters are optional: - LDAP Principal matches the value that is set for the broker by using the mqsicreatebroker or mqsichangebroker commands. - LDAP Credentials matches the value that is set for the broker by using the mqsicreatebroker or mqsichangebroker commands. - Recovery Connection Factory Name is the JNDI administered connection factory that is defined in the bindings file. If a value is not specified, a default value for recoverXAQCF must be added to the bindings file. In either case, the Recovery Connection Factory must be defined as an XA Queue Connection Factory for the JMS provider that is associated with the Initial Context Factory. The optional parameters are comma-separated and are positional. Therefore, any parameters that are missing must be represented by a comma. 1. Update the Java CLASSPATH environment variable for the broker’s queue manager to include a reference to xarecovery.jar; for example: install_dir/classes/xarecovery.jar
2. Update the Java PATH environment variable for the broker’s queue manager to point to the bin directory, which is where the switch file is located; for example: install_dir/bin
For more information, see the System Administration Guide section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. To use the same queue manager for both the broker and the JMS provider, ensure that your WebSphere MQ installation is at the minimum required level: Version 6.0 Fix Pack 1. WebSphere MQ Version 6.0 Fix Pack 1 or above is required for XA to use the same queue manager for both the broker and the provider. –
z/OS On z/OS, the external syncpoint manager is Resource Recovery Services (RRS). The only JMS provider that is supported on z/OS is WebSphere MQ JMS. The only transport option that is supported for WebSphere MQ JMS on z/OS is the bind option. Syncpoint control for the JMS provider is managed with RRS syncpoint coordination of the queue manager of the broker. You do not need to modify the .ini file.
If the JMSOutput node uses BEA WebLogic as the JMS provider, and the nodes need to participate in a globally coordinated message flow, see “Making the JMS provider client available to the JMS nodes” on page 958 for more information.
962
Message Flows
Connecting the terminals Connect the In terminal of the JMSOutput node to the node from which outbound messages are routed. Connect the Out terminal of the JMSOutput node to another node in the message flow to process the message further, to process errors, or to send the message to an additional destination.
Terminals and properties When you have put an instance of the JMSOutput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk. The terminals of the JMSOutput 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 message is routed if an error occurs. Even if the Validation property is set, messages that are propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is successfully retrieved from the WebSphere MQ queue.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by this 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 Description properties of the JMSOutput node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, JMSOutput
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 Basic properties of the JMSOutput node are described in the following table. Property
M
C
Destination Queue
No
Yes
Default
Description The name of the queue to which the node publishes outgoing messages. If the JMSOutput node is to be used to send point-to-point messages, enter the Destination queue name for the JMS queue name that is listed in the bindings file.
Message flows
963
Property
M
C
Default
Description
Publication Topic
No
Yes
The name of the topic from which the node receives published messages. v If this property is configured, the node operates only in the publish/subscribe message domain. v This property is mutually exclusive with the Destination queue property. v The Publication Topic name must conform to the standards of the JMS provider that is being used by the node.
Reply to destination
No
Yes
The name of the JMS destination to which the receiving application must send a reply message. For a reply message to be returned to this JMS destination, the JMS destination name must be known to the domain of the JMS provider that is used by the receiving client. You can enter a JMS destination, which can be either a subscription queue or a destination topic. The default value is blank, in which case the JMS output message can be regarded as a datagram. If the field is blank, the JMSOutput node does not expect a reply from the receiving JMS client.
No Send to destination list in local environment
Yes
Cleared
When you have built a list of JMS destinations in the LocalEnvironment, select this check box to use the destination list. If you do not select this check box, the node uses the configured JMS destination. If you select this check box but you have not built a list of JMS destination in the LocalEnvironment, the node uses the configured JMS destination.
Message type
Yes
Determine output message type from the JMS Message Tree
Select a value from the list to configure the type of JMS message that is produced by the JMSOutput node. If you do not set a value for this property, the node assumes the output type from the metadata PayLoadType field in the JMS message tree, as indicated by the default value, Determine output message type from the JMS Message Tree. Valid values are: v Determine output message type from the JMS Message Tree v TextMessage v BytesMessage v MapMessage v StreamMessage v ObjectMessage v Base JMS message with no payload
No
The JMS Connection properties of the JMSOutput node are described in the following table. Property
M
C
Default
Description
JMS provider name
Yes
No
WebSphere MQ
Select a JMS vendor name from the list, or enter a name of your choice. When you select a name from the list, the Initial Context Factory property is updated automatically with the relevant java class. If you enter your own JMS provider name, you must also enter a value for the Initial Context Factory. The name must match the name of a configurable service defined for the broker to which you deploy the message flow.
964
Message Flows
Property
M
C
Default
Description
Initial Context Factory
Yes
Yes
com.sun.jndi.fscontext. RefFSContextFactory
This property is the starting point for a JNDI name space. A JMS application uses the initial context to obtain and look up the connection factory and queue or topic objects for the JMS provider. If you select a JMS provider name from the list in JMS provider name, the Initial Context Factory property is updated automatically with the relevant Java class. If you enter your own JMS provider name, you must also enter a value for the Initial Context Factory. The default value is com.sun.jndi.fscontext.RefFSContextFactory, which defines the file-based initial context factory for the WebSphere MQ JMS provider.
Location JNDI Bindings
No
Yes
The system path or the LDAP location for the bindings file. The bindings file contains definitions for the JNDI-administered objects that are used by the JMSOutput node. When you enter a value for Location JNDI Bindings, ensure that it complies with the following instructions: v Construct the bindings file before you deploy a message flow that contains a JMSOutput node. v Do not include the file name of the bindings file in this field. v If you have specified an LDAP location that requires authentication, configure both the LDAP principal (userid) and LDAP credentials (password) separately. These values are configured at broker level. For information about configuring these values, see mqsicreatebroker command and mqsichangebroker command. v The string value must include the leading keyword, which is one of: – file:// – iiop:// – ldap:// For information about constructing the JNDI-administered objects bindings file, see the documentation that is supplied with the JMS provider.
Connection Factory Name
No
Yes
The name of the connection factory that is used by the JMSOutput node to create a connection to the JMS provider. This name must already exist in the bindings file. The Connection factory can be a JMS QueueConnectionFactory or a JMS TopicConnectionFactory, but it must match the message model that is used by the node. Alternatively, you can specify the generic JMS ConnectionFactory, which can be used for both JMS queue or JMS topic destinations.
The Advanced properties of the JMSOutput node are described in the following table. Property
M
New No Correlation ID
C Yes
Default
Description If the JMSOutput node is required to generate a new Correlation ID for the message, select New Correlation ID. If you leave the check box cleared, the Correlation ID of the output message is taken from the JMSCorrelationID field in the JMSTransport_Header_Values section of the message tree.
Message flows
965
Property
M
C
Default
Description
Transaction Yes Mode
No
None
This property controls whether the incoming message is received under syncpoint. v Select None if the outgoing message is to be treated as non persistent. If you select this value, the message is sent using a non-transacted JMS session that is created using the Session.AUTO_ACKNOWLEDGE flag. v Select Local if the input node that received the message must coordinate the commit or roll-back of JMS messages that have been sent by the JMSOutput node, along with any other resources, such as DB2 or WebSphere MQ, that perform work within the message flow. If you select this value, the node uses a transacted JMS session. v Select Global if the JMSOutput node must participate in a global message flow transaction that is managed by the broker’s external syncpoint coordinator. The syncpoint coordinator is the broker’s queue manager on distributed systems, and RRS (Resource Recovery Services) on z/OS. If you select this value, any messages that are received by the node are globally coordinated using an XA JMS session.
Delivery Mode
No
Yes
Non Persistent
This property controls the persistence mode that a JMS provider uses for a message. Valid values are: v Automatic: the mode from the input message is inherited v Persistent: the message survives if the JMS provider has a system failure v Non Persistent: the message is lost if the JMS provider has a system failure
Message Expiration (ms)
No
Yes
0
This property controls the length of time, in milliseconds, for which the JMS provider keeps the output JMS message. The default value, 0, is used to indicate that the message must not expire. Select Inherit from header or enter an integer that represents a number of milliseconds. If you select Inherit from header, the property inherits the value of the JMSExpiry field in the JMS message, which is found at the following location: OutputRoot.JMSTransport.Transport_Folders.Header_Values.JMSExpiration
Message Priority
No
Yes
4
This property assigns relative importance to the message and it can be used for message selection by a receiving JMS client application or a JMSOutput node. Select a value between 0 (lowest priority) and 9 (highest priority) or select Inherit from header. The default value is 4, which indicates medium priority. Priorities in the range 0 to 4 relate to normal delivery. Priorities in the range 5 to 9 relate to graduations of expedited delivery. If you select Inherit from header, the property inherits the value of the JMSPriority field in the JMS message, which is found at the following location: OutputRoot.JMSTransport.Transport_Folders.Header_Values.JMSPriority
The Validation properties of the JMSOutput node are described in the following table. For more information about Validation properties, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are None, Content, Content And Value, and Inherit.
Failure Action No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
966
Message Flows
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
JMSReply node Use the JMSReply node to send messages to JMS destinations. This topic contains the following sections: v “Purpose” v “Using the JMSReply node in a message flow” v “Working with the JMS message ID” v “Terminals and properties” on page 968
Purpose The JMSReply node has a similar function to the JMSOutput node, but the JMSReply node sends JMS messages only to the reply destination that is supplied in the JMSReplyTo header field of the JMS message tree. Use the JMSReply node when you want to treat a JMS message that is output from a message flow as a reply to a JMS input message, and where you have no other routing requirements. The JMSReply node is contained in the JMS drawer of the palette, and is represented in the workbench by the following icon:
Using the JMSReply node in a message flow Consider a situation in which you create a message flow in which a JMSInput node message obtains point-to-point messages from a JMS destination called MyJMSInputQueue. The message flow updates a database using the contents of the message, then replies to a JMS destination called MyJMSReplyQueue, which is set by the generating application in the JMSReplyTo header of the input message. In a similar scenario for the publish/subscribe message model, a JMSInput node subscribes to TopicA, and the JMSReply node publishes on the TopicB destination, which was retrieved from the JMSReplyTo header of the input message.
Working with the JMS message ID The JMS message ID is generated by the JMS provider when a message is sent by the JMSReply node. You cannot set the message ID in the message flow, but you can use one of the following methods to obtain the generated ID after the message has been sent: v Connect a Compute node to the Out terminal. Message flows
967
Connect a Compute node to the Out terminal of a JMSReply node and interrogate the WrittenDestination List. For more information, see “Viewing the logical message tree in trace output” on page 189. An entry for a JMSReply node has the following format: WrittenDestination = ( JMS = ( DestinationData = ( destinationName = 'queue://jmsQueue1' initialContext = 'com.sun.jndi.fscontext.RefFSContextFactory' JMSMessageID = ID:414d512054657374514d2020202020206ab98b4520017a02' JMSCorrelationID = 'ABCDEFGHIJKLMNOPQRSTUVW' ) ) )
v Configure a user exit to process an output message callback event. For more information, see “Exploiting user exits” on page 222.
Terminals and properties When you have put an instance of the JMSReply node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk. The terminals of the JMSReply node are described in the following table. Terminal Description Failure
The output terminal to which the message is routed if an error occurs. Even if the Validation property is set, messages that are propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is successfully retrieved from the WebSphere MQ queue.
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 JMSReply node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
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 Basic properties of the JMSReply node are described in the following table.
968
Message Flows
Property
M
Send to No destination list in local environment
C
Default
Description
Yes
Cleared
When you have built a list of JMS destinations in the LocalEnvironment, select this check box to use the destination list. If you do not select this check box, the node uses the configured JMS destination. If you select this check box but you have not built a list of JMS destinations in the LocalEnvironment, the node uses the configured JMS destination.
The JMS Connection properties of the JMSReply node are described in the following table. Property
M
C
Default
Description
JMS provider name
Yes
No
WebSphere MQ
Select a JMS vendor name from the drop-down list, or enter a name of your choice. When you select a name from the list, the Initial Context Factory property is updated automatically with the relevant Java class. If you enter your own JMS provider name, you must also enter a value for the Initial Context Factory. The default value is WebSphere MQ.
Initial Context Factory
Yes
Yes
com.sun.jndi.fscontext. This property is the starting point for a JNDI name space. A JMS RefFSContextFactory application uses the initial context to obtain and look up the connection factory and queue or topic objects for the JMS provider. If you select a JMS provider name from the list in JMS provider name, the Initial Context Factory property is updated automatically with the relevant Java class. If you enter your own JMS provider name, you must also enter a value for the Initial Context Factory. The default value is com.sun.jndi.fscontext.RefFSContextFactory, which defines the file-based initial context factory for the WebSphere MQ JMS provider.
Location JNDI Bindings
Yes
Yes
This property specifies either the file system path or the LDAP location for the bindings file. The bindings file contains definitions for the JNDI-administered objects that are used by the JMSReply node. When you enter a value for Location JNDI Bindings, ensure that it complies with the following instructions: v Construct the bindings file before you deploy a message flow that contains a JMSReply node. v Do not include the file name of the bindings file in this field. v If you have specified an LDAP location that requires authentication, configure both the LDAP principal (userid) and LDAP credentials (password) separately. These values are configured at broker level. For information about configuring these values, refer to the mqsicreatebroker and mqsichangebroker commands. v The string value must include the leading keyword, which is one of: – file:// – iiop:// – ldap:// For information about constructing the JNDI-administered objects bindings file, refer to the documentation that is supplied with the JMS provider.
Message flows
969
Property
M
Connection Yes Factory Name
C
Default
Description
Yes
The name of the connection factory that is used by the JMSReply node to create a connection to the JMS provider. This name must already exist in the bindings file.
The Advanced properties of the JMSReply node are described in the following table. Property
M
C
Default
Description
New No Correlation ID
Yes Cleared
If the JMSReply node is required to generate a new Correlation ID for the message, select the check box. The check box is cleared by default; if you leave the check box cleared, the Correlation ID of the output message is taken from the JMSCorrelationID field in the JMSTransport_Header_Values section of the message tree.
Transaction No Mode
No
This property controls whether the incoming message is received under sync point. To define the transactional characteristics of how the message is handled, select one of the following values: v Select None if the outgoing message is to be treated as non-persistent. If you select this value, the message is sent using a non-transacted JMS session that is created using the Session.AUTO_ACKNOWLEDGE parameter. v Select Local if the input node that receives the message should coordinate the commit or roll-back of JMS messages that have been sent by the JMSReply node, along with any other resources, such as DB2 or WebSphere MQ, that perform work within the message flow. If you select this value, the node uses a transacted JMS session. v Select Global if the JMSReply node should participate in a global message flow transaction that is managed by the broker’s external sync point coordinator. The sync point coordinator is the broker’s queue manager on distributed systems, and RRS (Resource Recovery Services) on z/OS. If you select this value, any messages that are received by the node are globally coordinated using an XA JMS session.
Delivery Mode
Yes Automatic
No
None
Message Yes Yes 0 Expiration (ms)
This property controls the persistence mode that a JMS provider uses for a message. Valid values are: v Automatic: the mode from the input message is inherited v Persistent: the message survives if the JMS provider has a system failure v Non-persistent: the message is lost if the JMS provider has a system failure This property controls the length of time, in milliseconds, for which the JMS provider keeps the output JMS message. The default value, 0, is used to indicate that the message must not expire. Select Inherit from header or enter an integer that represents a number of milliseconds. If you select Inherit from header, the property inherits the value of the JMSExpiry field in the JMS message, which is found at the following location: OutputRoot.JMSTransport.Transport_Folders.Header_Values.JMSExpiration
Message Priority
No
Yes 4
This property assigns relative importance to the message and it can be used for message selection by a receiving JMS client application or a JMSReply node. Select a value between 0 (lowest priority) and 9 (highest priority) or select Inherit from header. The default value is 4, which indicates medium priority. Priorities in the range 0 to 4 relate to normal delivery. Priorities in the range 5 to 9 relate to graduations of expedited delivery. If you select Inherit from header, the property inherits the value of the JMSPriority field in the JMS message, which is found at the following location: OutputRoot.JMSTransport.Transport_Folders.Header_Values.JMSPriority
970
Message Flows
Property
M
C
Default
Description
Message type
No
Yes TextMessageThis property controls the class of the JMS output message. The default value is TextMessage. Valid values are: v TextMessage v BytesMessage v MapMessage v StreamMessage v ObjectMessage v Base JMS message with no payload If you do not set this property, the node assumes the output type from the metadata PayLoadType field in the JMS message tree.
The Validation properties of the JMSReply node are described in the following table. Refer to “Validation properties” on page 1385 for a full description of these properties. Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are: v None v Content and Value v Content v Inherit If a message is propagated to the Failure terminal of the node, it is not validated.
Failure Action
No
No
Exception
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | | |
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are: v User Trace v Local Error Log v Exception (default value) v Exception List
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Label node Use the Label node to process a message that is propagated by a RouteToLabel node to dynamically determine the route that the message takes through the message flow. This topic contains the following sections: v “Purpose” on page 972 v “Using this node in a message flow” on page 972 v “Terminals and properties” on page 972 Message flows
971
Purpose Use the Label node in combination with a RouteToLabel node to route a message through the message flow based on message content. The RouteToLabel node interrogates the LocalEnvironment of the message to determine the identifier of the Label node to which the message must be routed next. You can propagate the message by coding ESQL in a Compute node, or by coding Java in a JavaCompute or user-defined node. Precede the RouteToLabel node in the message flow with a Compute node or JavaCompute node and populate the LocalEnvironment of the message with the identifiers of one or more Label nodes that introduce the next sequence of processing for the message. Design your message flow so that a Label node logically follows a RouteToLabel node within a message flow, but do not connect it physically to the RouteToLabel node. The connection is made by the broker, when required, according to the contents of LocalEnvironment. The Label node provides a target for a routing decision, and does not process the message that it handles in any way. Typically, a Label node connects to a subflow that processes each message in a specific way, and either ends in an output node or in another RouteToLabel node. The Label node can also be used in conjunction with a SOAPExtract node or as the target of a PROPAGATE statement, which is specified in a Compute or Database node. The Label node is contained in the Routing drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following sample to see how to use this node: v Airline Reservations sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the Label node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 Label node terminals are described in the following table. Terminal
Description
Out
The output terminal to which the message is routed.
972
Message Flows
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 Label node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
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 Label node Basic properties are described in the following table. Property
M
C
Default
Label Name
Yes
No
An identifier for the node. It is used as a target for a message that is routed by a RouteToLabel node. Label Name must not be the same as the name of the instance of the node itself, and it must be unique within the message flow in which it appears. The name of the instance can be modified by the workbench if the subflow, of which this Label node is a part, is embedded into another message flow.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Mapping node Use the Mapping node to construct one or more new messages and populate them with various types of information. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 974 v “Terminals and properties” on page 974
Purpose You can populate the new messages with the following types of information: v New information v Modified information from the input message v Information taken from a database Message flows
973
You can modify elements of the message body data, its associated environment, and its exception list. When you first open or create a message map for the node, if you select This map is called from a message flow node and maps properties and message body, the headers in the input message are always copied to the output message without modification. To modify the message headers in a Mapping node, select This map is called from a message flow node and maps properties, headers, and message body. When you select this property, the map that is created allows additional elements, including WebSphere MQ, HTTP, and JMS headers, to be mapped. These components of the output message can be defined using mappings that are based on elements of both the input message and data from an external database. You create the mappings that are associated with this node, in the mapping file that is associated with this node, by mapping inputs (message or database) to outputs. You can modify the assignments made by these mappings using supplied or user-defined functions and procedures; for example, you can convert a string value to uppercase when you assign it to the message output field. Use the Mapping node to: v Build a new message v Copy messages between parsers v Transform a message from one format to another The Mapping node is contained in the Transformation drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following sample to see how to use this node: v Pager samples You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the Mapping node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 Mapping node terminals 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 if database warning messages are returned, even though the processing might have completed successfully.
974
Message Flows
Terminal
Description
Out
The output terminal that outputs the message following the execution of the mappings.
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 Mapping node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
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 Mapping node Basic properties are described in the following table. Property
M
C
Data Source
No
Yes
Default
Description The ODBC data source name of the database that contains the tables to which you refer in the mappings that are associated with this node (identified by the Mapping Module property). This name identifies the appropriate database 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 On z/OS systems, the broker uses the broker started task ID, or the user ID and password that are specified on the mqsisetdbparms command JCL, BIPSDBP in the customization data set .SBIPPROC.
Transaction Yes
No
Automatic The transaction mode for the node. The values are: v Automatic (the default). The message flow, of which the Mapping 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. If you choose Automatic, the ability to commit or rollback the action of the Mapping node on the database depends on the success or failure of the entire message flow. v Commit. To commit any uncommitted actions that are performed in this message flow on the database that is 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 fails.
Message flows
975
Property
M
C
Default
Description
Mapping Routine
Yes
No
Mapping
The name of the mapping routine that contains the statements to execute against the database or the message tree. By default, the name that is assigned to the mapping routine is identical to the name of the mapping 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_Mapping.msgmap for the first Mapping 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 this node can access. Select the routine that you want and click OK; the routine name is set in Mapping Module. 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 _<node_name>.msgmap 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 Mapping 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” on page 520.
976
Message Flows
Property
M
C
Default
Description
Mapping Mode
Yes
No
Message
The mode that is used to process information that is passed through the Mapping node. Valid values are: v Message (the default): the message is generated or passed through by the Mapping node, as modified within the node. v LocalEnvironment: the LocalEnvironment tree structure is generated or passed through by the Mapping node, as modified within the node. v LocalEnvironment And Message: the LocalEnvironment tree structure and message are generated or passed through by the Mapping node, as modified by the node. v Exception: the ExceptionList is generated or passed through by the Mapping node, as modified by the node. v Exception And Message: the ExceptionList and message are generated or passed through by the Mapping node, as modified by the node. v Exception And LocalEnvironment: the ExceptionList and LocalEnvironment tree structures are generated or passed through by the Mapping node, as modified by the node. v All: the message, ExceptionList, and LocalEnvironment are generated or passed through by the Mapping node, as modified by the node. You must set this property to reflect accurately the output message format that you need. If you select an option (or accept the default value) that does not include a particular component of the message, that component is not included in any output message that is constructed. You can choose any combination of Message, LocalEnvironment, and Exception components to be generated and modified by the Mapping node. To construct a map that propagates multiple target messages, set this property to LocalEnvironment And Message to ensure that the node executes correctly. LocalEnvironment was known as DestinationList in some previous versions; it is retained for compatibility. The Environment component of the message tree is not affected by the mode setting. Its contents, if any, are passed on from this node.
Treat Warnings as Errors
Yes
No
Cleared
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 safely as a normal return code in most circumstances.
Throw Exception on Database Error
Yes
No
Selected
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.
The parser options for the Mapping node are described in the following table.
Message flows
977
Property
M
C
Default
Description
Use XMLNSC Compact Parser for XMLNS Domain
No
No
Cleared
If you select this check box, the outgoing MQRFH2 specifies the XMLNS instead of XMLNSC parser, allowing an external application to remain unchanged. If outgoing messages do not contain MQRFH2 headers, this property has no effect.
The Validation properties of Mapping node are described in the following table. If a message is propagated to the Failure terminal of the node, it is not validated. These properties do not cause the input message to be validated. It is expected that, if such validation is required, the validation has already been performed by the input node or a preceding validation node. For more details about validating messages and validation properties, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure Action
No
No
Exception
This property controls what happens if a validation failure occurs. You can set this property only if Validate is set to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
MQeInput node Use the MQeInput node to receive messages from clients that connect to the broker using the WebSphere MQ Mobile Transport protocol. Attention: Using message flows that contain MQeInput and MQeOutput nodes in Version 6.1 is deprecated. The behavior that is described here is intended only for when you are deploying from Version 6.1 to a previous version, and to provide a route for migration. Redesign your flows to remove the MQe nodes and replace them with MQ nodes that are configured to your own specifications and coordinated with your MQe gateway configuration. For more details, see Migrating a message flow that contains WebSphere MQ Everyplace nodes. This topic contains the following sections: v “Purpose” v “Using the MQeInput node in a message flow” on page 980 v “WebSphere MQ Everyplace documentation” on page 980 v “Configuring the MQeInput node” on page 980 v “Terminals and properties” on page 984
Purpose The MQeInput node receives messages that are put to a message flow from a specified bridge queue on the broker’s WebSphere MQ Everyplace queue manager. The node also establishes the processing environment for the messages. You must create and configure the WebSphere MQ Everyplace queue manager before you deploy a message flow that contains this node. Message flows that handle messages that are received across WebSphere MQ connections must always start with an MQeInput node. You can set the MQeInput
978
Message Flows
node’s properties to control the way in which messages are received; for example, you can indicate that a message is to be processed under transaction control. When you deploy message flows that contain WebSphere MQ Everyplace nodes to a broker, you must deploy them to a single execution group, regardless of the number of message flows. The WebSphere MQ Everyplace nodes in the message flows must all specify the same WebSphere MQ Everyplace queue manager name. If you do not meet this restriction, an error is raised when you deploy. The MQeInput node handles messages in the following message domains: v MRM v XMLNSC v XMLNS v JMSMap v JMSStream v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) v IDOC (this domain is deprecated; use MRM) If you include an output node in a message flow that starts with an MQeInput node, it can be any of the supported output nodes, including user-defined output nodes; you do not need to include an MQeOutput node. You can create a message flow that receives messages from WebSphere MQ Everyplace clients and generates messages for clients that use any of the supported transports to connect to the broker, because you can configure the message flow to request the broker to provide any conversion that is necessary. WebSphere MQ Everyplace Version 1.2.6 is used by WebSphere Message Broker. This version is compatible with later versions of WebSphere MQ Everyplace. Clients that use later versions of WebSphere MQ Everyplace (for example, Version 2.0), work correctly when connected to this node, although additional functionality that is not supported in Version 1.2.6 (for example, JMS support) does not work. Queue managers are not interchangeable between different versions of WebSphere MQ Everyplace. Nodes must use a queue manager that was created using Version 1.2.6. Similarly, the client must use its own level of the code when creating a queue manager. You cannot use MQeInput nodes in message flows that you deploy to z/OS systems. z/OS
If you create a message flow to use as a subflow, you cannot use a standard input node; you must use an instance of the Input node as the first node to create an In terminal for the subflow. If your message flow does not receive messages across WebSphere MQ connections, you can choose another supported input node. The MQeInput node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
Message flows
979
Using the MQeInput node in a message flow For an example of how this node can be used, consider a farmer who checks his fields to see how well they are irrigated. He is carrying a PDA device with WebSphere MQ Everyplace installed. He sees an area of field that requires water, and uses his PDA and a Global Satellite Navigation link to send a message to an MQeInput node. The data is manipulated using a Compute node, and a message is published by a Publication node so that a remote SCADA device can pick up the message and trigger the irrigation sprinklers. The farmer can see the water delivered to the field, minutes after sending his message.
WebSphere MQ Everyplace documentation Find further information about WebSphere MQ Everyplace, and the properties of the node, in the WebSphere MQ Everyplace documentation on the WebSphere MQ Web page.
Configuring the MQeInput node When you have put an instance of the MQeInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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. Configure the MQeInput node as follows: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Default tab, set values for the properties that describe the message domain, message set, message type, and message format that the node uses to determine how to parse the incoming message, and the default topic that is associated with the message. v If the incoming message has an MQRFH2 header, you do not need to set values for the Default properties because the values can be derived from the <mcd> folder in the MQRFH2 header; for example: <mcd><Msd>MRM<Set>DHM4UO906S001receiptmsg1 XML
If you set values, and those values differ from those in the MQRFH2 header, the MQRFH2 header values take precedence. v In Message domain, select the name of the parser that you are using from the list. Choose from the following options: – MRM – XMLNSC – XMLNS – JMSMap – JMSStream – MIME – BLOB – XML (this domain is deprecated; use XMLNSC) – IDOC (this domain is deprecated; use MRM) You can also specify a user-defined parser, if appropriate.
980
Message Flows
v If you are using the MRM or IDOC parser, or the XMLNSC parser in validating mode, select the correct message set from the list in Message set. This list is populated with available message sets when you select MRM, XMLNSC, or IDOC as the domain. v If you are using the MRM parser, select the correct message from the list in Message type. This list is populated with messages that are defined in the message set that you have selected. v If you are using the MRM or IDOC parser, select the format of the message from the list in Message format. This list includes all the physical formats that you have defined for this message set. v Enter the message topic in Topic. You can enter any characters as the topic name. When messages pass through the MQeInput node, they assume whatever topic name you have entered. (If you are using publish/subscribe, you can subscribe to a topic and see any messages that passed through the MQeInput node under that topic name.) 3. On the General tab, set the following properties: a. Enter the Queue name of the WebSphere MQ Everyplace bridge queue from which this input node retrieves messages. If the queue does not exist, it is created for you when the message flow is deployed to the broker. b. Set the level of Trace that you want for this node. If trace is active, the trace information is recorded in the file identified by Trace filename (described later in this section). Choose a level of trace: v None (the default). No trace output is produced, unless an unrecoverable error occurs. v Standard. Minimal trace output is generated to reflect the overall operations of the node. v Debug. Trace information is recorded at a level that helps you to debug WebSphere MQ Everyplace programs. v Full. All available debug information is recorded to provide a full record of the node activities. If you set the trace level to Debug or Full, you will impact the performance of WebSphere MQ Everyplace, and significant trace files can be generated. Use these options for short periods only. c. In Trace filename, specify the name of the file to which the trace information is written. The directory structure in which the file is specified must already exist; it cannot be created during operation. d. Select the Transaction mode to define the transactional characteristics of how this message is handled: v If you select Automatic, the incoming message is received under sync point if it is marked persistent; otherwise it is not. The transactionality of any derived messages that are sent subsequently by an output node is determined by the incoming persistence property, unless the output node has overridden transactionality explicitly. v If you select Yes, the incoming message is received under sync point. Any derived messages that are sent subsequently by an output node in the same instance of the message flow are sent transactionally, unless the output node has overridden transactionality explicitly. v If you select No, the incoming message is not received under sync point. Any derived messages that are sent subsequently by an output node in the message flow are sent non-transactionally, unless the output node has specified that the message must be put under sync point.
Message flows
981
e. The Use config file check box is not selected by default; values for all properties for the MQeInput node are taken from the Properties view. If you select the check box, the definition of all properties is extracted from the file that is identified by Config filename (described later in this section) with the exception of the following properties: v The Queue name and Config filename General properties v All Default properties Use a configuration file only to specify additional properties for the node. If the properties in the Properties view are sufficient for your needs, do not select the Use config file check box. f. If you have selected the Use config file check box, enter the full path and name of the configuration file for WebSphere MQ Everyplace in Config filename. This file must be installed on the system that supports every broker to which this message flow is deployed. If the file does not exist, an error is detected when you deploy the message flow. The default file name is MQeConfig.ini. g. In Queue manager name, specify the name of the WebSphere MQ Everyplace queue manager. This queue manager is not related to the queue manager of the broker to which you deploy the message flow that contains this node. Only one WebSphere MQ Everyplace queue manager can be supported. Only one execution group can contain MQeInput or MQeOutput nodes. This property must therefore be set to the same value in every MQeInput node that is included in every message flow that you deploy to the same broker. 4. On the Channel tab, set the maximum number of channels that are supported by WebSphere MQ Everyplace in Max channels. The default value is zero, which means that there is no limit. 5. On the Registry tab, set the following properties: a. Select the type of registry from the Registry type list: v FileRegistry. Registry and security information is provided in the Directory specified later in this section. v PrivateRegistry. You create the queue manager manually within WebSphere MQ Everyplace, specifying the security parameters that you need. b. In Directory, specify the directory in which the registry file is located. This property is valid only if you have selected a Registry type of FileRegistry. c. If you have selected a Registry type of PrivateRegistry, complete the following properties (for further details of these properties, see the WebSphere MQ Everyplace documentation): v Specify a PIN for the associated queue manager. v Specify a Certificate request PIN for authentication requests. v Provide a Keyring password to be used as a seed for the generation of crypto keys. v In Certificate host, specify the name of the certificate server that WebSphere MQ Everyplace uses for authentication. v In Certificate port, specify the number of the port for the certificate server that WebSphere MQ Everyplace uses for authentication. 6. On the Listener tab, set the following properties that define the connection type for WebSphere MQ Everyplace:
982
Message Flows
a. In Listener type, select the adapter type to use from the list. The default value is Http; you can also select Length or History. For further details, see the WebSphere MQ Everyplace documentation. b. In Hostname, specify the hostname of the server. Set this property to the special value localhost or to the TCP/IP address 127.0.0.1 (the default value), both of which resolve correctly to the hostname of the server to which the message flow is deployed. You can also use any valid hostname or TCP/IP address in your network, but you must use a different message flow for each broker to which you deploy it, or configure this property at deploy time. c. In Port, specify the port number on which WebSphere MQ Everyplace is listening. If more than one MQeInput node is included in a message flow that is deployed to a single broker, each MQeInput node must specify a different number for this property. You must also ensure that the number that you specify does not conflict with other listeners on the broker system; for example, with WebSphere MQ. The default value is 8081. d. In Time interval (sec), specify the timeout value, in seconds, before idle channels are timed out. The default value is 300 seconds. Channels are persistent logical entities that last longer than a single queue manager request, and can survive network breakages, so it might be necessary to time out channels that have been inactive for a period of time. Connecting the terminals: The MQeInput node routes each message that it retrieves successfully to the Out terminal; if this fails, the message is retried. If the retry timeout expires (as defined by the BackoutThreshold attribute of the input queue), the message is routed to the Failure terminal; you can connect nodes to this terminal to handle this condition. If you have not connected the Failure terminal, the message is written to the backout queue. If the message is caught by this node after an exception has been thrown further on in the message flow, the message is routed to the Catch terminal. If you have not connected the Catch terminal, the message loops continually through the node until the problem is resolved. You must define a backout queue or a dead-letter queue (DLQ) to prevent the message looping continuously through the node. Configuring for coordinated transactions: When you include an MQeInput node in a message flow, the value that you set for the Transaction mode property defines whether messages are received under sync point: v If you set the property to Yes (the default), the message is received under sync point (that is, within a WebSphere MQ unit of work). Any messages that are sent subsequently by an output node in the same instance of the message flow are put under sync point, unless the output node has overridden this explicitly. v If you set the property to Automatic, the message is received under sync point if the incoming message is marked persistent. Otherwise, it is not. Any message that is sent subsequently by an output node is put under sync point, as determined by the incoming persistence property, unless the output node has overridden this explicitly.
Message flows
983
v If you set the property to No, the message is not received under sync point. Any messages that are sent subsequently by an output node in the flow are not put under sync point, unless an individual output node has specified that the message must be put under sync point. The MQeOutput node is the only output node that you can configure to override this option.
Terminals and properties The MQeInput node terminals are described in the following table. Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs.
Out
The output terminal to which the message is routed if it is successfully retrieved from the WebSphere MQ Everyplace queue.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by this 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 MQeInput node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
MQeInput
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 MQeInput node Default properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
The domain that is used to parse the incoming message.
Message set
No
No
The name or identifier of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message.
Message format
No
No
The name of the physical format of the incoming message.
Topic
No
Yes
The default topic for the input message.
The MQeInput node General properties are described in the following table.
984
Message Flows
Property
M
C
Default
Description
Queue name
Yes
Yes
Trace
Yes
No
None
The level of trace required for this node. Valid values are None, Standard, Debug, and Full.
Trace filename
Yes
Yes
\MQeTraceFile.trc
The name of the file to which trace records are written.
Transaction mode
Yes
No
Yes
This property controls whether the incoming message is received under sync point. Valid values are Automatic, Yes, and No.
Use config file
Yes
No
Cleared
If you select the check box, a configuration file is used for this node.
Config filename
Yes
Yes
\MQeconfig.ini
The name of the configuration file to be used if the Use config file check box is selected.
Queue manager name
Yes
Yes
ServerQM1
The name of the WebSphere MQ Everyplace queue manager.
The name of the WebSphere MQ Everyplace bridge queue from which this node retrieves messages for processing by this message flow.
The MQeInput node Channel properties are described in the following table. Property
M
C
Default
Description
Max channels
Yes
No
0
The maximum number of channels that are supported by the WebSphere MQ Everyplace queue manager.
The MQeInput node Registry properties are described in the following table. Property
M
C
Default
Description
Registry type
Yes
Yes
FileRegistry
The type of registry information to be used. Valid values are FileRegistry and PrivateRegistry.
Directory
Yes
Yes
\ServerQM1\registry
The directory in which the registry file exists (valid only if FileRegistry is selected).
PIN
Yes
Yes
The PIN that is associated with the WebSphere MQ Everyplace queue manager (valid only if PrivateRegistry is selected).
Certificate request Yes PIN
Yes
The PIN that is used to request authentication (valid only if PrivateRegistry is selected).
Keyring password Yes
Yes
The password that is used to see crypto keys (valid only if PrivateRegistry is selected).
Certificate host
Yes
Yes
The name of the certificate server (valid only if PrivateRegistry is selected).
Certificate port
Yes
Yes
The port of the certificate server (valid only if PrivateRegistry is selected).
The MQeInput node Listener properties are described in the following table. Property
M
C
Default
Description
Listener type
Yes
Yes
Http
The adapter type for the listener. Valid values are Http, Length, and History.
Message flows
985
Property
M
C
Default
Description
Hostname
Yes
Yes
127.0.0.1
The hostname of the server.
Port
Yes
Yes
8081
The port on which WebSphere MQ Everyplace listens.
Time interval (sec) Yes
Yes
300
The WebSphere MQ Everyplace polling interval, specified in seconds.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
MQeOutput node
|
Use the MQeOutput node to send messages to clients that connect to the broker using the WebSphere MQ Mobile Transport protocol. Attention: Using message flows that contain MQeInput and MQeOutput nodes in Version 6.1 is deprecated. The behavior that is described here is intended only for when you are deploying from Version 6.1 to a previous version, and to provide a route for migration. Redesign your flows to remove the MQe nodes and replace them with MQ nodes that are configured to your own specifications and coordinated with your MQe gateway configuration. For more details see Migrating a message flow that contains WebSphere MQ Everyplace nodes. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 987 v “WebSphere MQ Everyplace documentation” on page 987 v “Connecting the terminals” on page 987 v “Terminals and properties” on page 988
Purpose The MQeOutput node forwards messages to WebSphere MQ Everyplace queue managers. If you specify a non-local destination queue manager, ensure that there is either a route to the queue manager, or store-and-forward queue servicing for the queue manager, if it exists. You cannot use the MQeOutput node to change the transactional characteristics of the message flow. The transactional characteristics that are set by the message flow’s input node determine the transactional behavior of the flow. z/OS You cannot use MQeOutput nodes in message flows that you deploy to z/OS systems.
986
Message Flows
If you create a message flow to use as a subflow, you cannot use a standard output node; you must use an instance of the Output node to create an out terminal for the subflow through which to propagate the message. If you do not want your message flow to send messages to a WebSphere MQ Everyplace queue, choose another supported output node. The MQeOutput node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow For an example of how this node can be used, consider a farmer who checks his fields to see how well they are irrigated. He is carrying a PDA device with WebSphere MQ Everyplace installed. He sees that his fields are not being irrigated, and uses his PDA and a Global Satellite Navigation link to check the water flow valve, and finds that it is faulty. This information is available because the remote SCADA device that is responsible for controlling the valve has published a diagnostic message, which was retrieved by the broker and forwarded to an MQeOutput node and on to the WebSphere MQ Everyplace client on his PDA.
WebSphere MQ Everyplace documentation You can find further information about WebSphere MQ Everyplace, and the properties of the node, in the WebSphere MQ Everyplace documentation on the WebSphere MQ Web page.
Connecting the terminals Connect the In terminal to the node from which outbound messages bound are routed. Connect the Out or Failure terminal of this node to another node in this message flow if you want to process the message further, process errors, or send the message to an additional destination. If you propagate the message, the LocalEnvironment that is associated with the message is enhanced with the following information for each destination to which the message has been put by this node: v Queue name v Queue manager name v Message reply identifier (this is set to the same value as message ID) v Message ID (from the MQMD) v Correlation ID (from the MQMD) These values are written in WrittenDestination within the LocalEnvironment tree structure. If you do not connect either terminal, the LocalEnvironment tree is unchanged. If you use aggregation in your message flows, you must use these terminals.
Message flows
987
Terminals and properties When you have put an instance of the MQeOutput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 MQeOutput node terminals 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 message is routed if a failure is detected when the message is put to the output queue.
Out
The output terminal to which the message is routed if it has been successfully put to the output queue, and if further processing is required within this message flow.
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 MQeOutput node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
MQeOutput
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 MQeOutput node Basic properties are described in the following table. Property
M
C
Default
Description
Queue manager name
No
Yes
The name of the WebSphere MQ Everyplace queue manager to which the output queue, which is specified in Queue name, is defined. Enter a value for this property if you select Queue Name in Destination mode (on the Advanced tab). If you select another option for Destination mode, you do not need to set this property.
Queue name
No
Yes
The name of the WebSphere MQ Everyplace output queue to which this node puts messages. Enter a value for this property if you select Queue Name in Destination mode (on the Advanced tab). If you select another option for Destination mode, you do not need to set these properties.
The MQeOutput node Advanced property is described in the following table.
988
Message Flows
Property
M
Destination Yes mode
C
Default
Description
No
Destination List
The queues to which the output message is sent: v Queue Name: the message is sent to the queue that is named in the Queue name property. The properties Queue manager name and Queue name (on the Basic tab) are mandatory if you select this option. v Reply To Queue: the message is sent to the queue that is named in the ReplyToQ field in the MQMD. v Destination List (the default): the message is sent to the list of queues that are named in the LocalEnvironment (also known as DestinationList) that is associated with the message.
The MQeOutput node Request properties are described in the following table. Property M
C
Default
Description
Request
Yes
No
Cleared
Select Request to indicate that each output message is marked in the MQMD as a request message (MQMD_REQUEST), and the message identifier field is cleared (set to MQMI_NONE) to ensure that WebSphere MQ generates a new identifier. Clear the check box to indicate that each output message is not marked as a request message. You cannot select this check box if you have selected a Destination mode of Reply To Queue.
Reply-to No queue manager
Yes
The name of the queue manager to which the output queue, which is specified in Reply-to queue, is defined. This name is inserted into the MQMD of each output message as the reply-to queue manager. This new value overrides the current value in the MQMD.
Reply-to queue
Yes
The name of the reply-to queue to which to put a reply to this request. This name is inserted into the MQMD of each output message as the reply-to queue. This new value overrides the current value in the MQMD.
No
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
MQGet node Use the MQGet node to receive messages from clients that connect to the broker by using the WebSphere MQ Enterprise Transport, and the MQI and AMI application programming interfaces. You can also use the MQGet node to retrieve messages that were previously placed in a WebSphere MQ message queue that is defined to the broker’s queue manager. This topic contains the following sections: v “Purpose” on page 990 v “Using the MQGet node in a message flow” on page 990 v “Configuring the MQGet node” on page 991 v “Overriding node properties during message processing” on page 994 v “Configuring for coordinated transactions” on page 995 Message flows
989
v “Connecting the terminals” on page 995 v “Terminals and properties” on page 996 The topic uses the following terms: input message A message that enters the In terminal of the MQGet node. queue message A message that the MQGet node reads from the queue.
Purpose The MQGet node reads a message from a specified queue, and establishes the processing environment for the message. If appropriate, you can define the input queue as a WebSphere MQ clustered queue or shared queue. You can use an MQGet node anywhere within a message flow, unlike an MQInput node, which you can use only as the first node in a message flow. The output message tree from an MQGet node is constructed by combining the input tree with the result tree from the MQGET call. You can set the properties of the MQGet node to control the way in which messages are received; for example, you can indicate that a message is to be processed under transaction control, or you can request that, when the result tree is being created, data conversion is performed on receipt of every input message. The MQGet node handles messages in the following message domains: v MRM v XMLNSC v DataObject v XMLNS v JMSMap v JMSStream v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) v IDOC (this domain is deprecated; use MRM) The MQGet node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
Using the MQGet node in a message flow Look at the following topics to see how to use the MQGet node in a message flow: v “A request-response scenario using an MQGet node” on page 213 Look at the following sample to see how to browse messages with the MQGet node: v Browsing WebSphere MQ Queues sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
990
Message Flows
Configuring the MQGet node When you have put an instance of the MQGet node into a message flow, you can configure it; for more information, see “Configuring a message flow node” on page 259. 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. Configure the MQGet node. 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, enter in Queue name the name of the queue from which the message is to be obtained. You must predefine this WebSphere MQ queue to the queue manager that hosts the broker on which the message flow is deployed. If this queue is not a valid queue, the node generates an exception, and the input message is propagated to the Failure terminal. 3. On the Input Message Parsing tab, set values for the properties that describe the message domain, message set, message type, and message format that the node uses to determine how to parse the queue message. v If the queue message has an MQRFH2 header, you do not need to set values for the Input Message Parsing properties, because the values can be derived from the <mcd> folder in the MQRFH2 header; for example: <mcd><Msd>MRM<Set>DHM4UO906S001receiptmsg1 XML
If you set values, and those values differ from those in the MQRFH2 header, the values in the MQRFH2 header take precedence. v In Message domain, select the name of the parser that you want from the list. If the MQRFH2 header does not supply the Message domain value, you can select a value from the list. If you do not select a value then the default value is BLOB. You can choose from the following options: – MRM – XMLNSC – DataObject – XMLNS – JMSMap – JMSStream – MIME – BLOB – XML (this domain is deprecated; use XMLNSC) – IDOC (this domain is deprecated; use MRM) You can also specify a user-defined parser, if appropriate. v If you are using the MRM or IDOC parser, or the XMLNSC parser in validating mode, select the Message set that you want to use. v If you are using the MRM parser, select the correct message from the list in Message type. This list is populated with messages that are defined in the Message set that you have selected. v If you are using the MRM or IDOC parser, select the format of the message from the list in Message format. This list includes all of the physical formats that you have defined for this Message set. 4. On the Parser Options sub-tab:
Message flows
991
a. Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. b. Select Use MQRFH2C compact parser for MQRFH2 header if you want the MQRFH2C parser to be used. By default, this check box is cleared, which means that the compact parser is not used. c. If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 5. On the Advanced tab, set values for the advanced properties. v Select a value for Transaction mode from the list to define the transactional characteristics of how this message is handled: – If you select Automatic, the queue message is received under sync point if it is marked as persistent. If the message is not marked as persistent, it is not received under sync point. The persistence or non-persistence of the input message determines the transactionality of any derived messages that are subsequently propagated by an output node, unless the output node, or any other subsequent node in the message flow, overrides the transactionality explicitly. – If you select Yes, the queue message is received under sync point. Any derived messages that are subsequently propagated by an output node in the same instance of the message flow are sent transactionally, unless the output node, or any other subsequent node in the message flow, overrides the transactionality explicitly. – If you select No, the queue message is not received under sync point. Any derived messages that are subsequently propagated by an output node in the same instance of the message flow are sent non-transactionally, unless the output node, or any other subsequent node in the message flow, has specified that the messages must be put under sync point. v Select a value for Generate mode from the list to define which components of the output message are generated within the MQGet node, and which components are taken from the input message. – If you select None, all of the components of the message from the input tree are propagated unchanged. – If you select Message (the default), a new Message component is created by the node, but the LocalEnvironment, Environment, and ExceptionList components from the input tree are propagated unchanged. – If you select LocalEnvironment, a new LocalEnvironment component is created by the node, but the Message, Environment, and ExceptionList components from the input tree are propagated unchanged. – If you select Message and LocalEnvironment, new Message and LocalEnvironment components are created by the node, but the Environment and ExceptionList components from the input tree are propagated unchanged. v If you have chosen Generate mode to be either Message or Message And LocalEnvironment, select a value for Copy message from the list to define which parts of the message are generated within the MQGet node, and which parts are taken from the input message. – If you select None (the default), no part of the input message from the input tree is propagated. – If you select Copy Headers, the headers from the input message in the input tree are copied to the output message.
992
Message Flows
– If you select Copy Entire Message, the entire input message from the input tree is copied to the output message. v If you have chosen Generate mode to be either LocalEnvironment or Message And LocalEnvironment, select a value for Copy Local Environment from the list to define which parts of the local environment are generated within the MQGet node, and which parts are taken from the input message. – If you select Copy Entire LocalEnvironment (the default), at each node in the message flow, a new copy of the local environment is created in the tree, and it is populated with the contents of the local environment from the preceding node. So if a node changes the local environment, the upstream nodes do not see those changes because they have their own copies. This behavior might be an issue if you are using a FlowOrder node, or if you use the propagate command on a Compute node. The entire local environment that is defined in the input message is copied to the output message. – If you select None, each node does not generate its own copy of the local environment, but it uses the local environment that is passed to it by the previous node. So if a node changes the local environment, those changes are seen by the upstream nodes. v Provide a value for the Wait interval (ms) property to specify how many milliseconds to wait for a message to be received from the MQGET call. If you do not provide a value, the default value of 1000 milliseconds is used. v Provide a value for the Minimum message buffer size (KB) property to specify the size, in KB, of the initial buffer for the MQGET call. The buffer expands automatically to accept a message of any size, but if it is expected that messages will all be large, specify a suitable value to reduce the frequency of the buffer being re-sized. If you do not provide a value, the size of the buffer is 4 KB. 6. On the Request tab, set values for the properties that determine how the request parameters are constructed. v If the MQMD that is to be used for the MQGET call is not the default location InputRoot.MQMD, specify in Input MQMD location the location of the MQMD. v If the location of the parameters for the MQGET call (for example, MQGMO overrides), is not the default location InputLocalEnvironment.MQ.GET, specify the location in Input MQ parameters location. v If you select Get by correlation ID, the CorrelId field of the message to be retrieved must match the CorrelId field in the Input MQMD location. By default, this check box is cleared. v If you select Get by message ID, the MsgId field of the message to be retrieved must match the MsgId field in the Input MQMD location. By default, this check box is cleared. v If you select Use all input MQMD fields, all MQMD fields at the Input MQMD location are used to retrieve the message. If an MQMD bit stream is present at the Input MQMD location, all fields in the bit stream are used. Make sure that the MQMD of the message to be retrieved matches these fields. By default, this check box is cleared. v Select Browse only to specify that the message should be retained on the queue when it is read. 7. On the Result tab, set values for the properties that determine how the results of the MQGET call are handled.
Message flows
993
v In Output data location, enter the start location within the output message tree at which the parsed elements from the bit string of the queue message are stored; the default value is OutputRoot. All elements at this location are deleted, and the default behavior is to replace the input tree message with the queue message. You can enter any valid ESQL field reference (this reference can include expressions), including new field references to create a new node within the message tree for inserting the response into the message that is propagated from the input tree. For example, OutputRoot.XMLNS.ABC.DEF and Environment.GotReply are valid field references. For more detailed information, see “A request-response scenario using an MQGet node” on page 213. When the queue message bit string is parsed to create the contents of the message tree, the message properties that you have specified as the Input Message Parsing properties of the node are used. v Set a value in Result data location to control which subtree of the queue message is placed in the output message. The default value is ResultRoot, which means that the whole queue message is placed in the output message. If, for example, you want only the MQMD from the queue message, use ResultRoot.MQMD; this subtree is then placed at the location specified by Output data location. v Set a value in Output MQ parameters location to control where the CC (completion code), the RC (reason code), the Browsed indicator, and any other WebSphere MQ parameters (for example, the MQMD that is used by the MQGET call) are placed in the output tree. The default value is OutputLocalEnvironment.MQ.GET. v Set a value in Warning data location to control where the queue message is placed when the MQGET call returns a warning code. The default value is OutputRoot. You can enter any valid ESQL field reference (see the description of the Output data location property). The data that is placed at this location is always the complete result tree, with the body as a BLOB element. Result data location is not used for warning data. v Clear Include message contents in output message assembly to specify that no result or warning data is required for the output message assembly. This action gets or browses the message on the queue without reading or parsing its contents. If you select Include message contents in output message assembly, it does not guarantee that the message contents are included in the output tree because this inclusion depends on other node properties, such as the Generate mode property. 8. On the Validation tab, set the validation properties if you want the parser to validate the body of each queue message against the Message set. (If a message is propagated to the Failure terminal of the node, it is not validated.) For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385.
Overriding node properties during message processing When you include and configure an MQGet node in a message flow, you might want to override its properties under some conditions. For example, you might want to read from a queue that is identified in another part of the message, or that is retrieved from a database record.
994
Message Flows
To override the values that you set for the MQGet node properties to achieve a more dynamic way to process messages, include a Compute or JavaCompute node in your message flow before the MQGet node. Configure this node to create a new output message, and add fields to the LocalEnvironment tree to define new values for the properties that you want to change. For example, add a Compute node into the flow and define a new queue name for the MQGet node to read for messages, by including the following ESQL statement: SET LocalEnvironment.MQ.GET.QueueName = 'new_queue';
Use LocalEnvironment.MQ.GET. as the correlation name for all fields that relate to the MQGet node.
Configuring for coordinated transactions When you include an MQGet node in a message flow, the value that you set for Transaction mode defines whether messages are received under sync point. v If you set the property to Yes (the default), the queue message is received under sync point (that is, within a WebSphere MQ unit of work). Any messages that an output node in the same instance of the message flow sends subsequently are put under sync point, unless the output node, or any other subsequent node, overrides this setting explicitly. v If you set the property to Automatic, the queue message is received under sync point if the incoming message is marked as persistent. Otherwise, it is not received under sync point. Any message that is sent subsequently by an output node is put under sync point, as determined by the incoming persistence property, unless the output node, or any other subsequent node, overrides this setting explicitly. v If you set the property to No, the queue message is not received under sync point. Any messages that are sent subsequently by an output node in the message flow are not put under sync point, unless an individual output node, or any other subsequent node, specifies that the message must be put under sync point. If you set the Browse only property, the value that you set for the Transaction mode property is ignored because a message cannot be browsed under sync point. However, any derived messages that are propagated subsequently by an output node in the same instance of the message flow follow the behavior that is described previously in accordance with the specified Transaction mode value.
Connecting the terminals Connect the Out, Warning, Failure, and No Message output terminals of this node to another node in the message flow to process the message further, process errors, or send the message to an additional destination. The completion code (CC) that is generated by the MQGET call controls what is propagated to each of the output terminals. v If the MQGET call is successful, the MQGet node routes each parsed output message to the Out terminal. v If the MQGET call fails, but with a CC that indicates a warning, an unparsed output message is propagated to the Warning terminal. v If the MQGET call fails with a CC more severe than a warning, the input message is propagated to the Failure terminal.
Message flows
995
v If the MQGET call fails with a reason code of MQRC_NO_MSG_AVAILABLE, the output message is propagated (without a result body) to the No Message terminal. The output message that is propagated to the No Message terminal is constructed from the input message only, according to the values of the Generate mode, Copy message, and Copy local environment properties. v If you do not connect the Out, Warning, or No Message terminals to another node in the message flow, any message that is propagated to those terminals is discarded. v If you do not connect the Failure terminal to another node in the message flow, the broker generates an exception when a message is propagated to that terminal. For more information, see “Connecting failure terminals” on page 230.
Terminals and properties The terminals of the MQGet node are described in the following table. Terminal
Description
In
The input terminal that accepts the message that is being processed by the message flow.
Warning
The output terminal to which the output tree is propagated if an error (with a CC that indicates a warning) occurs within the node while trying to get a message from the queue. The MQMD part of the message is parsed, but the rest of the message is an unparsed BLOB element. The warning is discarded if the terminal is not connected, and there is no output propagation from the node at all.
Failure
The output terminal to which the input message is routed if an error (with a CC that indicates an error that is more severe than a warning) occurs within the node while trying to get a message from the queue.
Out
The output terminal to which the message is routed if it is retrieved successfully from the WebSphere MQ queue.
No Message
The output terminal to which the input message is routed if no message is available on the queue. The output message that is propagated to the No Message terminal is constructed from the input message only, according to the values of the Generate mode, Copy message, and Copy local environment properties.
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); 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 MQGet node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node The name of the node. type, MQGet
Short description
No
No
Blank
A brief description of the node.
Long description
No
No
Blank
Text that describes the purpose of the node in the message flow.
The Basic properties of the MQGet node are described in the following table.
996
Message Flows
Property
M
C
Default
Description
Queue name
Yes
Yes
None
The name of the WebSphere MQ message queue from which this node retrieves messages.
The Input Message Parsing properties of the MQGet node are described in the following table. Property
M
C
Default
Description
Message domain
No
No
BLOB
The domain that is used to parse the queue message. If the MQRFH2 header does not supply the Message domain value, then you can select a value from the list. If you do not select a value, the default value is BLOB.
Message set
No
No
None
The name or identifier of the message set in which the queue message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
None
The name of the queue message.
Message format
No
No
None
The name of the physical format of the queue message.
The Parser Options properties of the MQGet node are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when the queue message is parsed. Valid values are On Demand, Immediate, and Complete. For a full description of this property, see “Parsing on demand” on page 1389.
Use MQRFH2C compact parser for MQRFH2 header
No
No
Cleared
This property controls whether the MQRFH2C compact parser, instead of the MQRFH2 parser, is used for MQRFH2 headers.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing properties Message domain is XMLNS.
Retain mixed content
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in the queue message message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
No
Message flows
997
Property
M
C
Default
Description
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in the queue message message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in the queue message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the queue message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The Advanced properties of the MQGet node are described in the following table. Property
M
C
Default
Description
Transaction mode
No
No
Yes
This property controls whether the incoming message is received under sync point. Valid values are Automatic, Yes, and No.
Generate mode
No
No
Message
This property controls which parts of the message from the input tree are copied. Valid values are Message, LocalEnvironment, Message And LocalEnvironment, and None.
Copy message
No
No
None
This property controls which parts of the message from the input tree are copied. Valid values are None, Copy Headers, and Copy Entire Message.
Copy local environment
No
No
Copy Entire LocalEnvironment
This property controls how the local environment is copied to the output message. If you set it to Copy Entire LocalEnvironment, at each node in the message flow a new copy of the local environment is created in the tree, and it is populated with the contents of the local environment from the preceding node. So if a node changes the local environment, the upstream nodes do not see those changes because they have their own copies. This behavior might be an issue if you are using a FlowOrder node, or if you use the propagate command on a Compute node. If you set this property to None, each node does not generate its own copy of the local environment, but it uses the local environment that is passed to it by the previous node. So if a node changes the local environment, those changes are seen by the upstream nodes.
Wait interval (ms) Yes
998
Message Flows
No
1000
The maximum time, in milliseconds, to wait for the queue message to be obtained from the message queue.
Property
M
C
Default
Description
Minimum message buffer size (KB)
Yes
No
4
The minimum size, in KB, of the get buffer. The minimum value of this property is 1.
The Request properties of the MQGet node are described in the following table. Property
M
C
Default
Description
Input MQMD location No
No
The location in the input message assembly where the MQMD that is to be used for the MQGET can be found. The default location is InputRoot.MQMD.
Input MQ parameters location
No
No
The location in the input message assembly where the WebSphere MQ parameters (for example, the initial buffer size and the MQGMO overrides) can be found. The default location is InputLocalEnvironment.MQ.GET.
Get by correlation ID
No
No
Cleared
If you select this check box, only messages that have the specified correlation ID are retrieved.
Get by message ID
No
No
Cleared
If you select this check box, only messages that have the specified message ID are retrieved.
Use all input MQMD fields
No
No
Cleared
If you select this check box, all MQMD fields supplied are used; otherwise, only the message ID and correlation ID are used.
Browse only
No
No
Cleared
This property controls whether a message is removed from the queue when it is read. If this check box is selected, the message is not removed from the queue when it is read.
The Result properties of the MQGet node are described in the following table. Property
M
C
Default
Description
Output data location
No
No
OutputRoot
This property specifies where the output data is placed. If you leave the field blank, OutputRoot is used as a default.
Result data location
No
No
ResultRoot
This property specifies which subtree (of the queue message) to use. If you leave this field blank, ResultRoot is used as a default, and the whole queue message is used. If, for example, ResultRoot.MQMD.ReplyToQ is specified, only that subtree is used.
Output MQ parameters location
No
No
Warning data location
No
No
This property specifies where the output WebSphere MQ parameters are located. If you leave this field blank, OutputLocalEnvironment.MQ.GET is used as a default. Set Generate mode to include LocalEnvironment to ensure that the updated values are visible in downstream nodes. The default location is OutputLocalEnvironment.MQ.GET. OutputRoot
This property specifies where the output data is placed if MQGET returns a warning code. If you leave this field blank, OutputRoot is used as a default.
Message flows
999
Property
M
C
Default
Description
Include message contents in output message assembly
No
No
Selected
This property specifies that no result or warning data is required for the output message assembly. If you select this check box, the node gets or browses the message on the queue without completely reading or parsing its contents. If you select Include message contents in output message assembly, it does not guarantee that the message contents are included in the output tree because this inclusion depends on other node properties, such as the Generate mode property.
The Validation properties of the MQGet node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content, Content and Value, and Inherit.
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
MQHeader node
|
Use the MQHeader node to add, modify, or delete MQ Message Descriptor (MQMD) and MQ Dead Letter Header (MQDLH) headers. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1001 v “Terminals and properties” on page 1001
Purpose You can add or remove a whole header, or you can change only certain fields in a header. You can set these fields to a fixed value, or to a value specified by an XPath expression to access a value in one of the message trees. XPath is used to
1000
Message Flows
provide a valid location from which a value for a property can be copied. For example, the location can be the body of the message, the local environment tree, or an exception list. The MQHeader node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following sample for more details about how to use the node: v MQHeader node sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. This node has no mandatory properties. MQHeader node terminals 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 routed if a failure is detected.
Out
The output terminal to which the transformed message is routed if the input message is processed successfully.
The following tables describes 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 MQHeader node Description properties are described in the following table: Property
M
C
Default
Description
Node name
No
No
MQHeader
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 MQ Message Descriptor properties are described in the following table: Refer to WebSphere MQ Application Programming Reference and WebSphere MQ Application Programming Guide for full details of each of the MQ property and its supported values.
Message flows
1001
Property
M
C
Default
Description
MQMD header options
No
No
Carry forward header
Options to control the MQMD as a whole. Select Carry forward header to carry forward any values that are present in an incoming message. Select Add header to add a new header using the specified property values. If a header already exists, the header is modified using the specified property values. If Inherit from header is specified as a property value and the header does not exist, the default value for the property is used. Select Modify header to change an existing header using the specified property values. If a header does not exist, a new header is added first. If Inherit from header is specified as a property value and the header does not exist, the default value for the property is used. Select Delete header to delete the header, if it exists. Note: The Add header and Modify header options both add a header if it does not exist, and change a header if it does exist. However, the default values offered by each option differ, so use the appropriate option.
Coded Character Set Identifer
No
No
MQCCSI_Q_MGR
The character set identifier of character data in the message. A sample set of custom literals for EBCIDIC and other common Unicode values is given here: MQCCSI_INTL_EBCIDIC MQCCSI_US_EBCIDIC MQCCSI_UNICODE_1200 MQCCSI_UNICODE_1208 MQCCSI_UNICODE_13488 MQCCSI_UNICODE_17584
: 500 : 037 : 1200 : 1208 : 13488 : 17584
Refer to the WebSphere MQ Application Programming Reference and WebSphere MQ Application Programming Guide for full details. Format
No
No
MQFMT_NONE
A name that the sender of the message can use to indicate to the receiver the nature of the data in the message.
Version Number
No
No
MQMD_VERSION_1
The version ID of the MQMD message.
Message Type
No
No
MQMT_DATAGRAM
The message type.
Message Expiry
No
No
MQEI_UNLIMITED
A period of time expressed in tenths of a second, set by the application that puts the message. The message becomes eligible to be discarded if it has not been removed from the destination queue before this period of time elapses.
Feedback or Reason Code
No
No
MQFB_NONE
Used with a message of type MQMT_REPORT to indicate the nature of the report, and meaningful only with that type of message.
Message Priority
No
No
MQPRI_PRIORITY_AS_Q_DEF
Message priority. 0 is the lowest value, and 9 is the highest. Custom display literals are as follows: MQPRI_PRIORITY_HIGH MQPRI_PRIORITY_8 : MQPRI_PRIORITY_7 : MQPRI_PRIORITY_6 : MQPRI_PRIORITY_5 : MQPRI_PRIORITY_MEDIUM MQPRI_PRIORITY_3 : MQPRI_PRIORITY_2 : MQPRI_PRIORITY_1 : MQPRI_PRIORITY_LOW
: 9 8 7 6 5 : 4 3 2 1 : 0
Message Persistence
No
No
MQPER_PERSISTENCE_AS_Q_DEF
Indicates whether the message survives system failures and restarts of the queue manager.
Message Identifier
No
No
MQMI_NONE
A string that is used to distinguish one message from another.
1002
Message Flows
Property
M
C
Default
Description
Correlation Identifier
No
No
MQCI_NONE
A string that the application can use to relate one message to another, or to relate the message to other work that the application is performing.
Reply To Queue
No
Yes
The message queue to which the application that issued the get request for the message should send Reply and Report messages.
Reply To Queue Manager
No
Yes
The queue manager to which the reply message or report message should be sent.
The Report properties are described in the following table: Property
M
C
Default
Description
Inherit from header
No
No
Selected
This property is enabled only when the Modify header option is selected. Select this field to inherit any MQMD report property value that is present in an incoming message.
Exception
No
No
No default value
A type of MQ report message. Exception report message is generated.
Expiration
No
No
No default value
A type of MQ report message. Expiration report message is generated.
Confirm on arrival
No
No
No default value
A type of MQ report message. Confirm on arrival report message is generated.
Confirm on delivery
No
No
No default value
A type of MQ report message. Confirm on delivery report message is generated.
Notification
No
No
No default value
A type of MQ report Message. Action notification report message is generated.
The MQDLH header properties are described in the following table:
Message flows
1003
Property
M
C
Default
Description
MQDLH header options
No
No
Carry forward the header
Options to control the MQMD as a whole. Select Carry forward header to carry forward any values that are present in an incoming message. Select Add header to add a new header using the specified property values. If a header already exists, the header is modified using the specified property values. If Inherit from header is specified as a property value and the header does not exist, the default value for the property is used. Select Modify header to change an existing header using the specified property values. If a header does not exist, a new header is added first. If Inherit from header is specified as a property value and the header does not exist, the default value for the property is used. Select Delete header to delete the header, if it exists. Note: The Add header and Modify header options both add a header if it does not exist, and change a header if it does exist. However, the default values offered by each option differ, so use the appropriate option.
Coded Character Set Identifer
No
No
MQCCSI_UNDEFINED
The character set identifier of character data in the message.
Format
No
No
MQFMT_NONE
A name that the sender of the message can use to indicate to the receiver the nature of the data in the message.
Reason
No
No
MQRC_NONE
A code that indicates why the message is sent to the dead letter queue (DLQ).
Destination Queue Name
No
Yes
No default value
The name of the destination queue.
Destination Queue Manager Name
No
Yes
No default value
The name of the destination queue manager.
Save dead letter queue No
No
Selected
If selected, the dead letter queue name is stored in the local environment.
Save source queue
No
Selected
If selected, the original source queue name is stored in the local environment.
No
The Monitoring properties of the node are described in the following table:
|
1004
Message Flows
||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
MQInput node Use the MQInput node to receive messages from clients that connect to the broker by using the WebSphere MQ Enterprise Transport, and that use the MQI and AMI application programming interfaces. This topic contains the following sections: v “Purpose” v “Using the MQInput node in a message flow” on page 1006 v “Configuring the MQInput node” on page 1006 v “Connecting the terminals” on page 1012 v “Configuring for coordinated transactions” on page 1012 v “Terminals and properties” on page 1013
Purpose The MQInput node receives a message from a WebSphere MQ message queue that is defined on the broker’s queue manager. The node uses MQGET to read a message from a specified queue, and establishes the processing environment for the message. If appropriate, you can define the input queue as a WebSphere MQ clustered queue or shared queue. Message flows that handle messages that are received across WebSphere MQ connections must always start with an MQInput node. You can set the properties of the MQInput node to control the way in which messages are received, by causing appropriate MQGET options to be set. For example, you can indicate that a message is to be processed under transaction control. You can also request that data conversion is performed on receipt of every input message. The MQInput node handles messages in the following message domains: v MRM v XMLNSC v DataObject v XMLNS v JMSMap v JMSStream v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) v IDOC (this domain is deprecated; use MRM) If you include an output node in a message flow that starts with an MQInput node, the output node can be any one of the supported output nodes, including user-defined output nodes; you do not need to include an MQOutput node. You can create a message flow that receives messages from WebSphere MQ clients and generates messages for clients that use any of the supported transports to connect Message flows
1005
to the broker, because you can configure the message flow to request that the broker provides any conversion that is necessary. If you create a message flow to use as a subflow, you cannot use a standard input node; you must use an Input node as the first node to create an In terminal for the subflow. If your message flow does not receive messages across WebSphere MQ connections, you can choose one of the supported input nodes. The MQInput node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
Using the MQInput node in a message flow Look at the following samples to see how to use the MQInput node: v Pager samples v Airline Reservations sample v Error Handler sample v Aggregation sample v JMS Nodes sample v v v v v v
Large Messaging sample Message Routing sample Scribble sample Soccer Results sample Timeout Processing sample Video Rental sample
v XSL Transform sample v Browsing WebSphere MQ Queues sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the MQInput node When you have put an MQInput node into a message flow, you can configure the node; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk. Configure the MQInput node: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, enter the Queue name from which the message flow receives messages. You must predefine this WebSphere MQ queue to the queue manager that hosts the broker to which the message flow is deployed. This property is mandatory.
1006
Message Flows
3. On the Input Message Parsing tab, set values for the properties that describe the message domain, message set, message type, and message format that the node uses to determine how to parse the incoming message. If the incoming message has an MQRFH2 header, you do not need to set values for the Input Message Parsing properties because the values are derived from the <mcd> folder in the MQRFH2 header; for example: <mcd><Msd>MRM<Set>DHM4UO906S001receiptmsg1 XML
If you set values, and those values differ from those in the MQRFH2 header, and the <Msd> element is a valid domain, the values in the MQRFH2 header take precedence. v In Message domain, select the name of the parser that you want to use from the list. If no MQRFH2 header exists to supply the value for the Message domain, then you can select the property value from the list. You can either select an option or leave the property blank, in which case the default that is used is BLOB. You can select from the following options: – MRM – XMLNSC – DataObject – XMLNS – JMSMap – JMSStream – MIME – BLOB – XML (this domain is deprecated; use XMLNSC) – IDOC (this domain is deprecated; use MRM) You can also specify a user-defined parser, if appropriate. v If you use the MRM or IDOC parser, or the XMLNSC parser in validating mode, select the Message set that you want to use. The list of message sets consists of those that are available when you select MRM, XMLNSC, or IDOC as the domain. v If you use the MRM parser, select the type of message from the list in Message type. This list is populated with messages that are defined in the Message set that you have selected. v If you are using the MRM or IDOC parser, select the format of the message from the list in Message format. This list includes all the physical formats that you have defined for this Message set. 4. On the Parser Options sub-tab: a. Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. b. Select Use MQRFH2C compact parser for MQRFH2 header if you want the MQRFH2C parser to be used. By default, this check box is cleared, which means that the compact parser is not used. c. If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 5. On the Advanced tab, set the properties that determine how the message is processed, such as its transactional characteristics. Many of these properties map to options on the MQGET call. v Select Transaction mode from the list to define the transactional characteristics of how this message is handled: Message flows
1007
– If you select Automatic, the incoming message is received under syncpoint if it is marked persistent, otherwise it is not received under syncpoint. The transactionality of any derived messages that are sent subsequently by an output node is determined by the incoming persistence property, unless the output node has overridden transactionality explicitly. – If you select Yes, the incoming message is received under syncpoint. Any derived messages that are sent subsequently by an output node in the same instance of the message flow are sent transactionally, unless the output node has overridden transactionality explicitly. – If you select No, the incoming message is not received under syncpoint. Any derived messages that are sent subsequently by an output node in the message flow are sent non-transactionally, unless the output node has specified that the messages must be put under syncpoint. v Select Order mode from the list to determine the order in which messages are retrieved from the input queue. This property has an effect only if the message flow property Additional instances on the Instances tab, is set to greater than zero; that is, if multiple threads read the input queue. Valid values are: – Default. Messages are retrieved in the order that is defined by the queue attributes, but this order is not guaranteed because the messages are processed by the message flow. – By User ID. Messages that have the same UserIdentifier in the MQMD are retrieved and processed in the order that is defined by the queue attributes; this order is guaranteed to be preserved when the messages are processed. A message that is associated with a particular UserIdentifier that is being processed by one thread, is completely processed before the same thread, or another thread, can start to process another message with the same UserIdentifier. No other ordering is guaranteed to be preserved. – By Queue Order. Messages are retrieved and processed by this node in the order that is defined by the queue attributes; this order is guaranteed to be preserved when the messages are processed. This behavior is identical to the behavior that is exhibited if the message flow property Additional instances is set to zero. For more details about using this option, see “Receiving messages in a WebSphere MQ message group” on page 663. v Select Logical order to ensure that messages that are part of a message group are received in the order that has been assigned by the sending application. This option maps to the MQGMO_LOGICAL_ORDER option of the MQGMO of the MQI. If you clear the check box, messages that are sent as part of a group are not received in a predetermined order. If a broker expects to receive messages in groups, and you have not selected this check box, either the order of the input messages is not significant, or you must design the message flow to process them appropriately. You must also select Commit by message group if you want message processing to be committed only after the final message of a group has been received and processed. More information about the options to which this property maps is available in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. For more details about using this option, see “Receiving messages in a WebSphere MQ message group” on page 663.
1008
Message Flows
v Select All messages available if you want message retrieval and processing to be done only when all messages in a single group are available. This property maps to the MQGMO_ALL_MSGS_AVAILABLE option of the MQGMO of the MQI. Clear this check box if message retrieval does not depend on all of the messages in a group being available before processing starts. More information about the options to which this property maps is available in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. v Enter a message identifier in Match message ID if you want the input node to receive only messages that contain a matching message identifier value in the MsgId field of the MQMD. Enter an even number of hexadecimal digits (characters 0 to 9, A to F, and a to f are valid) up to a maximum of 48 digits. If the matching message identifier that you enter is shorter than the size of the MsgId field, Match message ID is padded on the right with X'00' characters. This property maps to the MQMO_MATCH_MSG_ID option of the MQGMO of the MQI. Leave this property blank if you do not want the input node to check that the message ID matches. More information about the options to which this property maps is available in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. v Enter a message identifier in Match correlation ID if you want the input node to receive only messages that contain a matching correlation identifier value in the CorrelId field of the MQMD. Enter an even number of hexadecimal digits (characters 0 to 9, A to F, and a to f are valid) up to a maximum of 48 digits. If the ID that you enter is shorter than the size of the CorrelId field, it is padded on the right with X'00' characters. This property maps to the MQMO_MATCH_CORREL_ID option of the MQGMO of the MQI. Leave this property blank if you do not want the input node to check that the CorrelID matches. More information about the options to which this property maps is available in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. v Select Convert if you want WebSphere MQ to perform data conversion on the message when it is retrieved from the queue. This option is useful if you are handling messages in the BLOB domain, or are using a user-defined parser. Do not select this option if you are parsing messages with the XML or MRM domains, because the parser does the conversion. WebSphere MQ converts the incoming message to the encoding and coded character set that is specified in the MQMD that the input node supplies on the MQGET call to retrieve the message from the input queue. The broker uses the MQGMO_CONVERT option on the MQGET call; typical rules for WebSphere MQ conversion apply. The values that you specify in the Convert encoding and Convert coded character set ID options are used in the MsgDesc Encoding and CCSID fields in the MQGET call. WebSphere MQ can convert the incoming message only if the MQMD Format field is a built-in WebSphere MQ value that identifies character data, or if a data conversion exit exists in WebSphere MQ. Message flows
1009
This property maps to the MQGMO_CONVERT option of the MQGMO of the MQI. Clear the check box if you do not want WebSphere MQ to convert the message. If you select this check box, you can also specify: – Convert encoding. Enter the number that represents the encoding to which you want to convert numeric data in the message body. Valid values include: Windows 546 for DOS and all Windows systems Linux UNIX 273 for all Linux and UNIX systems z/OS 785 for z/OS systems The encoding is used only in the following circumstances: - If a user-defined WebSphere MQ data conversion exit uses the encoding. - If the built-in WebSphere MQ conversion exit uses the encoding to convert messages in any of the predefined WebSphere MQ formats. If you specify an incorrect value, no conversion is done. – Convert coded character set ID. Enter the value that represents the character set identifier to which you want to convert character data in the message body. If you specify an incorrect value, no conversion is done. For more information about WebSphere MQ data conversion, and why you might choose to use this option, see the Application Programming Guide section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. For further information about the values that you can specify for Convert encoding and Convert coded character set ID, see the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. v Select Commit by message group if you want message processing to be committed only after the final message of a group has been received and processed. If you leave this check box cleared, a commit is performed after each message has been propagated completely through the message flow. This property is relevant only if you have selected Logical order. Set the Order mode property to By Queue Order if the messages in a group must be retrieved and processed in the order in which they are displayed on the queue. v
z/OS On z/OS only: Enter a serialization token in z/OS serialization token if you want to use the serialized access to shared resources that is provided by WebSphere MQ.
The value that you provide for the serialization token must conform to the rules described in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. For more information about serialization and queue sharing on z/OS, see the Concepts and Planning Guide section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. v Optional: You can associate a message with a publish/subscribe topic by using the Topic property. You can enter any characters as the topic name.
1010
Message Flows
When messages pass through the MQInput node, they take on whatever topic name you have entered. (If you are using publish/subscribe, you can subscribe to a topic and see any messages that passed through the MQInput node and were published under that topic name.) If the incoming message has an MQRFH2 header, you do not need to set a value for the Topic property because the value can be obtained from the folder in the MQRFH2 header; for example: stockquote
If you set a Topic property value, and that value differs from the value in the MQRFH2 header, the value in the MQRFH2 header takes precedence. v Select Browse Only to specify that the message must be retained on the queue when it is read. If you select this option, OutputLocalEnvironment.MQ.GET.Browsed is set to true when a message is propagated to the output terminal of the MQInput node. v Provide a value for Reset browse timeout (ms) to specify how many milliseconds to wait between the last eligible message being browsed on the input queue and the browse being reset to the beginning of the queue. If you do not provide a value, the default value of -1 is used to indicate that the browse is not reset. 6. On the Validation tab, set the validation properties if you want the parser to validate the body of messages against the Message set. (If a message is propagated to the Failure terminal of the node, it is not validated.) For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. 7. Optional: On the Security tab, set values for the properties that control the extraction of an identity from a message (when a security profile is associated with the node). v Optional: Select an option from the Identity token type list to specify the type of identity in the incoming message. If you leave this option to default, the identity is retrieved from the transport headers, and the type is set to Username. v Optional: In Identity token location, enter the location in the message where the identity is specified. If you leave this option blank, the identity is retrieved from the MQMD.UserIdentifier transport header. v Optional: In Identity password location, enter the location in the message where the password is specified. This option can be set only if the Identity token type is set to Username + Password. If you leave this option blank, the password is not set. v Optional: In Identity issuedBy location, specify the location in the message where information about the issuer of the identity is held. If you leave the Identity issuedBy location field blank, the MQMD.PutApplName value is used. If you leave the Identity issuedBy location field blank and the MQMD.PutApplName is also blank, the string MQ is used. v Optional: Select Treat security exceptions as normal exceptions if you want security exceptions, for example Access Denied, to be treated as typical exceptions and propagated down the failure terminal (if it is wired). For more information, see Message flow security and Setting up message flow security. 8. Optional: On the Instances tab, set values for the properties that control the additional instances that are available for a node. For more details, see “Configurable message flow properties” on page 1398. Message flows
1011
Connecting the terminals: The MQInput node routes each message that it retrieves successfully to the Out terminal. If this action fails, the message is retried. If the backout count is exceeded (as defined by the BackoutThreshold attribute of the input queue), the message is routed to the Failure terminal; you can connect nodes to this terminal to handle this condition. If you have not connected the Failure terminal, the message is written to the backout queue. If the message is caught by this node after an exception has been thrown further on in the message flow, the message is routed to the Catch terminal. If you have not connected the Catch terminal, the message loops continually through the node until the problem is resolved. You must define a backout queue or a dead-letter queue (DLQ) to prevent the message from looping continually through the node. Configuring for coordinated transactions: When you include an MQInput node in a message flow, the value that you set for Transaction mode defines whether messages are received under syncpoint: v If you set the property to Automatic, the message is received under syncpoint if the incoming message is marked as persistent; otherwise, it is not received under syncpoint. Any message that is sent subsequently by an output node is put under syncpoint, as determined by the incoming persistence property, unless the output node has overridden this explicitly. v If you set the property to Yes (the default), the message is received under syncpoint; that is, within a WebSphere MQ unit of work. Any messages that are sent subsequently by an output node in the same instance of the message flow are put under syncpoint, unless the output node has overridden this explicitly. v If you set the property to No, the message is not received under syncpoint. Any messages that are sent subsequently by an output node in the message flow are not put under syncpoint, unless an individual output node has specified that the message must be put under syncpoint. The MQOutput node is the only output node that you can configure to override this option. If you have set the Browse Only property, the value that is set for the Transaction mode property is ignored because a message cannot be browsed under syncpoint. However, any derived messages that are propagated subsequently by an output node in the same instance of the message flow follow the behavior that is described previously in accordance with the specified Transaction mode value.
MQGET buffer size The MQGET buffer size is implemented internally by the broker and you cannot change it. The following description is provided for information only. You must not rely on it when you develop your message flows, because the internal implementation might change. When the MQInput node initializes, it sets the size of the default buffer for the first MQGET to 4 KB. The MQInput node monitors the size of messages and increases or reduces the size of the buffer:
1012
Message Flows
1. If an MQGET fails because the message is larger than the size of the buffer, the node immediately increases the size of the buffer to accommodate the message, issues the MQGET again, and zeros a message count. 2. When 10 messages have been counted since the increase in the size of the buffer, the node compares the size of the largest of the 10 messages with the size of the buffer. If the size of the largest message is less than 75% of the size of the buffer, the buffer is reduced to the size of the largest of the 10 messages. If an MQGET fails during the 10 messages because the message is larger than the size of the buffer, the node takes action 1. For example, if the first message that the node receives is 20 MB, and the next 10 messages are each 14 MB, the size of the buffer is increased from 4 KB to 20 MB and remains at 20 MB for 10 messages. However, after the 10th message the size of the buffer is reduced to 14 MB.
Terminals and properties The terminals of the MQInput node are described in the following table. Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs. Even if the Validation property is set, messages propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is successfully retrieved from the WebSphere MQ queue.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by this 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 Description properties of the MQInput node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, MQInput
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 Basic properties of the MQInput node are described in the following table. Property
M
C
Queue name
Yes
Yes
Default
Description The name of the WebSphere MQ input queue from which this node retrieves messages (using MQGET) for processing by this message flow.
Message flows
1013
The Input Message Parsing properties of the MQInput node are described in the following table. Property
M
C
Default
Description
Message domain
No
No
BLOB
The domain that is used to parse the incoming message. The default value, BLOB, applies only if no preset MQRFH2 header values exist and no option has been selected from the list.
Message set
No
No
The name or identifier of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message.
Message format
No
No
The name of the physical format of the incoming message.
The properties of the Parser Options for the MQInput node are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are On Demand, Immediate, and Complete. For a full description of this property, see “Parsing on demand” on page 1389.
Use MQRFH2C compact parser for MQRFH2 header
No
No
Cleared
This property controls whether the MQRFH2C compact parser, instead of the MQRFH2 parser, is used for MQRFH2 headers.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC compact parser is used for messages in the XMLNS domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or the Input Message Parsing property Message domain is XMLNS.
Retain mixed content
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
1014
Message Flows
No
Property
M
C
Default
Description
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The Advanced properties of the MQInput node are described in the following table. Property
M
C
Default
Description
Transaction mode
Yes
No
Yes
This property controls whether the incoming message is received under syncpoint. Valid values are Automatic, Yes, and No.
Order mode
Yes
No
Default
The order in which messages are retrieved from the input queue and processed. Valid values are Default, By User ID, and By Queue Order.
Logical order
Yes
No
Selected
If you select this check box, messages are received in logical order, as defined by WebSphere MQ.
All messages available Yes
No
Cleared
If you select the check box, all of the messages in a group must be available before retrieval of a message is possible.
Match message ID
No
No
A message ID that must match the message ID in the MQMD of the incoming message.
Match correlation ID
No
No
A correlation ID that must match the correlation ID in the MQMD of the incoming message.
Convert
Yes
No
Convert encoding
No
No
The representation used for numeric values in the message data, expressed as an integer value. This property is valid only if you have selected Convert.
Convert coded character set ID
No
No
The coded character set identifier of character data in the message data, expressed as an integer value. This property is valid only if you have selected Convert.
Cleared
If you select this check box, WebSphere MQ converts data in the message to be received, in conformance with the CodedCharSetId and Encoding values set in the MQMD.
Message flows
1015
Property
M
C
Default
Description
Commit by message group
Yes
No
Cleared
This property controls when a transaction is committed when processing messages that are part of a message group. If you select the check box, the transaction is committed when the message group has been processed.
z/OS serialization token
No
No
A user-defined token for serialized application support. The value that is specified must conform to the rules for a valid ConnTag in the WebSphere MQ MQCNO structure.
Topic
No
Yes
The default topic for the input message.
Browse Only
No
No
Cleared
This property controls whether a message is removed from the queue when it is read. If you select this check box, the message is not removed from the queue when it is read.
Reset browse timeout (ms)
Yes
Yes
-1
The time, in milliseconds, between the last eligible message being browsed on the input queue and the browse being reset to the beginning of the queue. The default value of -1 indicates that the browse is not reset.
The Validation properties of the MQInput node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content, and Content and Value.
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Security properties of the MQInput node are described in the following table. For more information about these properties, see Identity and Configuring identity extraction. Property
M
C
Default
Description
Identity token type
No
No
None
This property specifies the type of identity token present in the incoming message. Valid values are: Transport Default, Username, Username + Password, and X.509 Certificate. If this property is not specified, the identity is retrieved from the transport headers and the type is set to Username.
Identity token location No
No
None
This property specifies where, in the message, the identity can be found. The location is specified as an ESQL field reference or XPath. If this property is not specified, the identity is retrieved from the MQMD.UserIdentifier transport header.
1016
Message Flows
Property
M
C
Default
Description
Identity password location
No
No
None
This property specifies where, in the message, the password can be found. The location is specified as an ESQL field reference or XPath. If it is not specified, the password is not set. This property can be set only if the Identity type is set to Username + Password.
Identity IssuedBy location
No
No
None
This property specifies a string or path expression describing the issuer of the identity. The location is specified as an ESQL field reference or XPath. This is for use in an identity mapper. If this property is not specified, the MQMD.PutApplName value is used.
Treat security exceptions as normal exceptions
No
No
False
This property specifies whether to treat security exceptions (such as Access Denied) as normal exceptions, and propagate them down the failure terminal (if wired). This is turned off by default, which ensures that security exceptions cause the message to be backed out even if the failure terminal is wired.
The Instances properties of the MQInput node are described in the following table. For a full description of these properties, see “Configurable message flow properties” on page 1398. Property
M
C
Default
Description
Additional instances pool
No
Yes
Use Pool Associated with Message Flow
The pool from which additional instances are obtained.
Additional instances
||
Property
M
C
| | | | |
Events
No
No
|
Yes
0
v If you select Use Pool Associated with Node, additional instances are allocated from the node’s additional instances based on the number specified in the Additional instances property. The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node. By default, no additional instances are given to the node.
The Monitoring properties of the node are described in the following table:
|
| | |
No
v If you select Use Pool Associated with Message Flow, additional instances are obtained from the message flow value.
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
MQJMSTransform node Use the MQJMSTransform node to receive messages that have a WebSphere MQ JMS provider message tree format, and transform them into a format that is compatible with messages that are to be sent to JMS destinations.
Message flows
1017
This topic contains the following sections: v “Purpose” v “Using the MQJMSTransform node in a message flow” v “Terminals and properties”
Purpose Use the MQJMSTransform node to send messages to legacy message flows and to interoperate with WebSphere MQ JMS and WebSphere Message Broker publish/subscribe. The JMSMQTransform node handles messages in all supported message domains. The MQJMSTransform node is contained in the JMS drawer of the palette, and is represented in the workbench by the following icon:
Using the MQJMSTransform node in a message flow The following sample contains a message flow in which the MQJMSTransform node is used. Refer to this sample for an example of how to use the MQJMSTransform node. v JMS Nodes sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the MQJMSTransform node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. The terminals of the MQJMSTransform node are described in the following table. Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs. Even if the Validation property is set, messages that are propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is successfully retrieved from the WebSphere MQ queue.
In
The input terminal that accepts a message for processing by the node.
The following table describes 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 MQJMSTransform node Description properties are described in the following table.
1018
Message Flows
Property
M
C
Default
Description
Node name
No
No
The node type, MQJMSTransform
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 Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
MQOptimizedFlow node Use the MQOptimizedFlow node to provide a high-performance publish/subscribe message flow. The node supports publishers and subscribers that use Java Message Service (JMS) application programming interfaces and the WebSphere MQ Enterprise Transport. Restriction:
You cannot use an MQOptimizedFlow node in message flows that you deploy to z/OS systems. z/OS
This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1020 v “Terminals and properties” on page 1020
Purpose Use the MQOptimizedFlow node to replace a publish/subscribe message flow that consists of an MQInput node that is connected to a Publication node and that uses the Java Message Service (JMS) over WebSphere MQ transport. Use the MQOptimizedFlow node to improve performance, particularly where a single publisher produces a persistent publication for a single subscriber. The MQOptimizedFlow node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
Message flows
1019
Using this node in a message flow Use an MQOptimizedFlow node in a message flow to publish a persistent JMS message to a single subscriber. The MQOptimizedFlow node has no terminals, so you cannot connect it to any other message flow node.
Terminals and properties When you have put an instance of the MQOptimizedFlow node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 MQOptimizedFlow node has no terminals. It is a complete message flow and you cannot connect it to other message flow nodes to extend the message processing. The following tables describe the node properties. The column headed M indicates whether the property is mandatory; that is, whether you must enter a value if no default value is defined; an asterisk next to the name of the property denotes this. The column headed C indicates whether the property is configurable; that is, whether you can change the value in the BAR file. The MQOptimizedFlow node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
MQOptimizedFlow
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 MQOptimizedFlow node Basic properties are described in the following table. Property
M
C
Default
Description
Queue name
Yes
Yes
None
The name of the WebSphere MQ input queue from which this node retrieves messages for processing by this message flow.
The MQOptimizedFlow node Advanced properties are described in the following table. Property
M
Transaction Yes mode
1020
C
Default
Description
No
Yes
This property controls whether the incoming message is received under syncpoint. Valid values are Automatic, Yes, and No.
Message Flows
MQOutput node Use the MQOutput node to send messages to clients that connect to the broker using the WebSphere MQ Enterprise Transport and that use the MQI and AMI application programming interfaces.
|
This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1022 v “Configuring the MQOutput node” on page 1022 v “Contents of the WebSphere MQ reply message” on page 1025 v “Terminals and properties” on page 1026
Purpose The MQOutput node delivers an output message from a message flow to a WebSphere MQ queue. The node uses MQPUT to put the message to the destination queue or queues that you specify. If appropriate, define the queue as a WebSphere MQ clustered queue or shared queue. When you use a WebSphere MQ clustered queue, leave the queue manager name empty. You can configure the MQOutput node to put a message to a specific WebSphere MQ queue that is defined on any queue manager that is accessible by the broker’s queue manager, or to the destinations identified in the LocalEnvironment (also known as the DestinationList) that is associated with the message. Set other properties to control the way in which messages are sent, by causing appropriate MQPUT options to be set; for example, you can request that a message is processed under transaction control. You can also specify that WebSphere MQ can, if appropriate, break the message into segments in the queue manager. If you create a message flow to use as a subflow, you cannot use a standard output node; use an instance of the Output node to create an Out terminal for the subflow through which to propagate the message. If you do not want your message flow to send messages to a WebSphere MQ queue, choose another supported output node. The MQOutput node checks for the presence of an MQMD (WebSphere MQ message descriptor) header in the message tree. If no MQMD is present, the MQOutput node creates an MQMD header in the message tree, and populates it with MQMD default properties. If an MQMD header is found, the MQOutput node checks that it is an MQ type header; if it is not, the Message Context property is set to Default. The MQOutput node treats any other transport headers in the message tree as data. The MQOutput node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
Message flows
1021
Using this node in a message flow Look at the following samples to see how to use this node: v Pager samples v Airline Reservations sample v Error Handler sample v Aggregation sample v Large Messaging sample v Message Routing sample v Timeout Processing sample v Video Rental sample v XSL Transform sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. For an example of how to use this node, assume that you have written a publishing application that publishes stock updates on a regular basis. The application sends the messages to the broker on an MQInput node, and the message flow makes the publications available to multiple subscribers through a Publication node. You configure a Compute node to create a new output message whenever one particular stock is changed, and connect this node to an MQOutput node to record each price change for this stock.
Working with WrittenDestination data After the message has been put, the WrittenDestination folder in the LocalEnvironment is updated with the destination information. A WrittenDestination for an MQOutput node has the following format: WrittenDestination = ( MQ = ( DestinationData = ( queueName = 'OUT' queueManagerName = 'MYQUEUEMANAGER' replyIdentifier = X'4d...2e' msgId = X'3c...2c' correlId = X'2a...00' GroupId = X'3a...00' ) ) )
Configuring the MQOutput node When you have put an instance of the MQOutput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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. Configure the MQOutput node. 1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this page. 2. On the Basic tab:
1022
Message Flows
v To send the output message to a single destination queue that is defined by this node, enter the name of the queue to which the message flow sends messages in Queue Name. v Enter the name of the queue manager to which this queue is defined in Queue Manager Name. You must set these properties if you set the Destination Mode property on the Advanced tab (described below) to Queue Name. If you set Destination Mode to another value, these properties are ignored. 3. The properties on the Advanced tab define the transactional control for the message and the way in which the message is put to the queue. Many of these properties map to options on the MQPUT call. v Select the Destination Mode from the list. This property identifies the queues to which the output message is put:
| | | |
– Queue Name (the default). The message is sent to the queue that is named in the Queue Name property. The Queue Manager Name and Queue Name properties on the Basic tab are mandatory if you select this option. – Reply To Queue. The message is sent to the queue that is named in the ReplyToQ field in the MQMD. When you select this option, the MQOutputnode constructs a WebSphere MQ reply message. See “Contents of the WebSphere MQ reply message” on page 1025 for further information on the settings used by the MQOutput node and the Root.MQMD folder in this situation. – Destination List. The message is sent to the list of queues that are named in the LocalEnvironment (also known as DestinationList) that is associated with the message. v Select the Transaction Mode from the list to determine how the message is put: – If you select Automatic (the default), the message transactionality is derived from the way that it was specified at the input node. – If you select Yes, the message is put transactionally. – If you select No, the message is put non-transactionally. For more information, see “Configuring for coordinated transactions” on page 1026. v Select the Persistence Mode from the list to determine whether the message is put persistently: – If you select Automatic (the default), the persistence is as specified in the incoming message. – If you select Yes, the message is put persistently. – If you select No, the message is put non-persistently. – If you select As Defined for Queue, the message persistence is set as defined for the WebSphere MQ queue. v Select New Message ID to generate a new message ID for this message. This property maps to the MQPMO_NEW_MSG_ID option of the MQPMO of the MQI. Clear the check box if you do not want to generate a new ID. A new message ID is still generated if you select Request on the Request tab. More information about the options to which this property maps is available in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. Message flows
1023
v Select New Correlation ID to generate a new correlation ID for this message. This property maps to the MQPMO_NEW_CORREL_ID option of the MQPMO of the MQI. Clear the check box if you do not want to generate a new ID. More information about the options to which this property maps is available in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. v Select Segmentation Allowed if you want WebSphere MQ to segment the message within the queue manager when appropriate. Clear the check box if you do not want segmentation to occur. See “Sending message segments in a WebSphere MQ message” on page 665 for more information about message segmentation. More information about the options to which this property maps is available in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. v Select the Message Context to indicate how origin context is handled. Choose one of the following options: – Pass All maps to the MQPMO_PASS_ALL_CONTEXT option of the MQPMO of the MQI. – Pass Identity maps to the MQPMO_PASS_IDENTITY_CONTEXT option of the MQPMO of the MQI. – Set All maps to the MQPMO_SET_ALL_CONTEXT option of the MQPMO of the MQI. – Set Identity maps to the MQPMO_SET_IDENTITY_CONTEXT option of the MQPMO of the MQI. – Default maps to the MQPMO_DEFAULT_CONTEXT option of the MQPMO of the MQI. – None maps to the MQPMO_NO_CONTEXT option of the MQPMO of the MQI. More information about the options to which these properties map is available in the Application Programming Reference section of the WebSphere MQ Version 7 information center online or WebSphere MQ Version 6 information center online. When a security profile is associated with the node and is configured to perform identity propagation, the chosen context can be overridden to ensure that the outgoing identity is set. v Select Alternate User Authority if you want the MQOO_ALTERNATE_USER_AUTHORITY option to be set in the open options (MQOO) of the MQI. If you select this check box, this option is specified when the queue is opened for output. The alternate user information is retrieved from the context information in the message. Clear the check box if you do not want to specify alternate user authority. If you clear the check box, the broker service user ID is used when the message is put. 4. On the Request tab, set the properties to define the characteristics of each output message generated. v Select Request to mark each output message in the MQMD as a request message (MQMT_REQUEST), and clear the message identifier field (which is set to MQMI_NONE) to ensure that WebSphere MQ generates a new identifier. Clear the check box to indicate that each output message is not
1024
Message Flows
marked as a request message. You cannot select this check box if you have selected a Destination Mode of Reply To Queue. A new message identifier is generated even if the New Message ID check box is not selected on the Advanced tab. v Enter a queue manager name in Reply-to Queue Manager. This name is inserted into the MQMD of each output message as the reply-to queue manager. v Enter a queue name in Reply-to Queue. This name is inserted into the MQMD of each output message as the reply-to queue. 5. On the Validation tab, set the validation properties if you want the parser to validate the body of messages against the message set. (If a message is propagated to the Failure terminal of the node, it is not validated.) For more details, refer to “Validating messages” on page 187 and “Validation properties” on page 1385. Connecting the terminals: Connect the In terminal to the node from which outbound messages bound are routed. Connect the Out or Failure terminal of this node to another node in this message flow to process the message further, process errors, or send the message to an additional destination. |
If you use aggregation in your message flows, you must use the output terminals.
|
Contents of the WebSphere MQ reply message:
|
The: v Values of the following fields in MQMD are set, irrespective of the settings you make:
| | | | | | | | | | | | | | | | | | | | | | | | | | | |
MQMD.Report = 0; MQMD.PutApplType = MQAT_BROKER; MQMD.PutDate = Taken from current Timestamp MQMD.PutTime = Taken from current Timestamp MQMD.PutApplName = MsgTree.MQMD.ReplyToQMgr (first 28 chars)
v Values of the following fields are set from the values in the Root.MQMD folder: MQMD.Version MQMD.Format MQMD.Priority MQMD.Persistence MQMD.Expiry MQMD.Encoding MQMD.CodedCharSetId MQMD.GroupId MQMD.MsgSeqNumber MQMD.Offset MQMD.MsgFlags MQMD.OriginalLength
v Following values in MQMD are set conditionally, based on values in the MQOutput node and the Root.MQMD folder: IF MsgTree.MQMD.MsgType = MQMT_REQUEST THEN MQMD.MsgType = MQMT_REPLY; IF Nodes Message Context is Default, PassAll or PassIdentity THEN MQMD.UserIdentifer = MsgTree.MQMD.UserIdentifier; IF MsgTree.MQMD.Report contains MQRO_PASS_CORREL_ID THEN MQMD.CorrelId = MsgTree.MQMD.CorrelId; Message flows
1025
| | | | | | | |
v Value of the MQMD.Persistence field is set based on the Persistence mode on the MQOutput node.
| |
Once the output MQMD structure has been constructed, the Message Context on the MQOutput node is ignored, and the behavior is as set All.
| |
The values that are overridden, are done so only in the output MQMD structure; no updates are made to the MQMD folder in the message tree.
ELSE MQMD.CorrelId = MsgTree.MQMD.MsgId; IF MsgTree.MQMD.Report contains MQRO_PASS_MSG_ID THEN MQMD.MsgId = MsgTree.MQMD.MsgId; ELSE MQMD.MsgId = MQMI_NONE;
Configuring for coordinated transactions: When you define an MQOutput node, the option that you select for the Transaction Mode property defines whether the message is written under sync point: v If you select Yes, the message is written under sync point (that is, within a WebSphere MQ unit of work). v If you select Automatic (the default), the message is written under sync point if the incoming input message is marked as persistent. v If you select No, the message is not written under sync point. Another property of the MQOutput node, Persistence Mode, defines whether the output message is marked as persistent when it is put to the output queue: v If you select Yes, the message is marked as persistent. v If you select Automatic (the default), the message persistence is determined from the properties of the incoming message, as set in the MQMD. v If you select No, the message is not marked as persistent. v If you select As Defined for Queue, the message persistence is set as defined in the WebSphere MQ queue by the MQOutput node specifying the MQPER_PERSISTENCE_AS_Q_DEF option in the MQMD.
Terminals and properties The MQOutput node terminals 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 message is routed if a failure is detected when the message is put to the output queue.
Out
The output terminal to which the message is routed if it has been successfully put to the output queue, and if further processing is required within this message flow.
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 MQOutput node Description properties are described in the following table.
1026
Message Flows
Property
M
C
Default
Description
Node name
No
No
The node type, MQOutput
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 MQOutput node Basic properties are described in the following table. Property
M
C
Default
Description
Queue Manager Name No
Yes
The name of the WebSphere MQ queue manager to which the output queue, which is specified in Queue Name, is defined.
Queue Name
Yes
The name of the WebSphere MQ output queue to which this node puts messages (using MQPUT).
No
If you set the Destination Mode property to Queue Name, you must specify a value for the Queue Name property.
The MQOutput node Advanced properties are described in the following table. Property
M
C
Default
Description
Destination Mode
Yes
No
Queue Name The queues to which the output message is sent. Valid values are Destination List, Reply To Queue, and Queue Name. If you set the Destination Mode to Queue Name, you must specify a value for the Queue Name property.
Transaction Mode
Yes
No
Automatic
This property controls whether the message is put transactionally. Valid values are Automatic, Yes, and No.
Persistence Mode
Yes
No
Automatic
This property controls whether the message is put persistently. Valid values are Automatic, Yes, No, and As Defined for Queue.
New Message ID
Yes
No
Cleared
If you select this check box, WebSphere MQ generates a new message identifier to replace the contents of the MsgId field in the MQMD.
New Correlation ID
Yes
No
Cleared
If you select this check box, WebSphere MQ generates a new correlation identifier to replace the contents of the CorrelId field in the MQMD.
Segmentation Allowed Yes
No
Cleared
If you select this check box, WebSphere MQ breaks the message into segments in the queue manager.
Message Context
Yes
No
Pass All
This property controls how origin context is handled. Valid values are Pass All, Pass Identity, Set All, Set Identity, and Default.
Alternate User Authority
Yes
No
Cleared
If you select this check box, alternate authority is used when the output message is put.
The MQOutput node Request properties are described in the following table. Message flows
1027
Property
M
C
Default
Description
Request
Yes
No
Cleared
If you select the check box, each output message is generated as a request message.
Reply-to Queue Manager
No
Yes
The name of the WebSphere MQ queue manager to which the output queue, which is specified in Reply-to Queue, is defined.
Reply-to Queue
No
Yes
The name of the WebSphere MQ queue to which to put a reply to this request.
The Validation properties of the MQOutput node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure Action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
MQReply node
|
Use the MQReply node to send a response to the originator of the input message. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1029 v “Configuring the MQReply node” on page 1029 v “Terminals and properties” on page 1031
Purpose The MQReply node is a specialized form of the MQOutput node that puts the output message to the WebSphere MQ queue that is identified by the ReplyToQ field of the input message header. If appropriate, define the queue as a WebSphere MQ clustered queue or shared queue. The MQReply node uses the options that are set in the Report field in the MQMD. By default (if no options are set), the MQReply node generates a new MsgId and
1028
Message Flows
CorrelId in the reply message. If the receiving application expects other values in these fields, ensure that the application that puts the message to the message flow input queue sets the required report options, or that you set the appropriate options within the MQMD during message processing in the message flow; for example, use a Compute node to set the Report options in the message. You can find more information about the Report field in the WebSphere MQ Application Programming Reference. The MQReply node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following sample to see how to use this node: v Airline Reservations sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. You can use this node when you receive an order from a customer. When the order message is processed, a response is sent to the customer acknowledging receipt of the order and providing a possible date for delivery.
Working with WrittenDestination data After the message has been put, the WrittenDestination folder in the LocalEnvironment is updated with the destination information. A WrittenDestination for an MQOutput node has the following format: WrittenDestination = ( MQ = ( DestinationData = ( queueName = 'OUT' queueManagerName = 'MYQUEUEMANAGER' replyIdentifier = X'4d...2e' msgId = X'3c...2c' correlId = X'2a...00' GroupId = X'3a...00' ) ) )
Configuring the MQReply node When you have put an instance of the MQReply node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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. Configure the MQReply node as follows: 1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab. Message flows
1029
2. On the Advanced tab: a. Select Segmentation Allowed if you want WebSphere MQ to break the message into segments in the queue manager, when appropriate. You must also set MQMF_SEGMENTATION_ALLOWED in the MsgFlags field in the MQMD for segmentation to occur. More information about the options to which this property maps is available in the WebSphere MQ Application Programming Reference. b. Select the Persistence Mode that you want for the output message. v If you select Automatic (the default), the persistence is as specified in the incoming message. v If you select Yes, the message is put persistently. v If you select No, the message is put non-persistently. v If you select As Defined for Queue, the message persistence is set as defined in the WebSphere MQ queue. c. Select the Transaction Mode that you want for the output message. v If you select Automatic (the default), the message transactionality is derived from how it was specified at the MQInput node. v If you select Yes, the message is put transactionally. v If you select No, the message is put non-transactionally. 3. On the Validation tab, set the validation properties; see “Validation properties” on page 1385. If a message is propagated to the Failure terminal of the node, it is not validated. For more details, see “Validating messages” on page 187. The reply message is put (using MQPUT) to the queue named in the input message MQMD as the ReplyTo queue. You cannot change this destination. Connecting the output terminals to another node: Connect the Out or Failure terminal of this node to another node in this message flow to process the message further, process errors, or send the message to an additional destination. If you use aggregation in your message flows, you must use these output terminals. Configuring for coordinated transactions: When you define an MQReply node, the option that you select for the Transaction Mode property defines whether the message is written under sync point: v If you select Yes, the message is written under sync point (that is, within a WebSphere MQ unit of work). v If you select Automatic (the default), the message is written under sync point if the incoming input message is marked as persistent. v If you select No, the message is not written under sync point. Another property of the MQReply node, Persistence Mode, defines whether the output message is marked as persistent when it is put to the output queue: v If you select Yes, the message is marked as persistent. v If you select Automatic (the default), the message persistence is determined by the properties of the incoming message, as set in the MQMD (the WebSphere MQ message descriptor).
1030
Message Flows
v If you select No, the message is not marked as persistent. v If you select As Defined for Queue, the message persistence is set as defined in the WebSphere MQ queue; the MQReply node specifies the MQPER_PERSISTENCE_AS_Q_DEF option in the MQMD.
Terminals and properties The MQReply node terminals 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 message is routed if a failure is detected when the message is put to the output queue.
Out
The output terminal to which the message is routed if it has been successfully put to the output queue, and if further processing is required within this message flow.
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 MQReply node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type.
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 MQReply node Advanced properties are described in the following table. Property
M
C
Default
Description
Segmentation Allowed
Yes
No
Cleared
If you select this check box, WebSphere MQ breaks the message into segments in the queue manager.
Persistence Mode
Yes
No
Automatic
This property controls whether the message is put persistently. Valid values are Automatic, Yes, No, and As Defined for Queue.
Transaction Mode
Yes
No
Automatic
This property controls whether the message is put transactionally. Valid values are Automatic, Yes, and No.
The Validation properties of the MQReply node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385.
Message flows
1031
Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure Action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The MQReply node also has the following properties that you cannot access or modify through the workbench interface. However, these values are used by the broker when the message is processed in the message flow. Property
Description
Queue Manager Name
The name of the WebSphere MQ queue manager to which the output queue, identified in Queue Name, is defined. This name is retrieved from the ReplyTo field of the MQMD of the input message.
Queue Name
The name of the WebSphere MQ queue to which the output message is put. This name is retrieved from the ReplyTo field of the MQMD of the input message.
Destination
This property always has the value reply.
Output node Use the Output node as an out terminal for an embedded message flow (a subflow). This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1033 v “Terminals and properties” on page 1033
Purpose You can use a subflow for a common task that can be represented by a sequence of message flow nodes. For example, you can create a subflow to increment or decrement a loop counter, or to provide error processing that is common to a number of message flows. You must use an Output node to provide the Out terminal to a subflow; you cannot use a standard output node (a built-in output node such as MQOutput, or a user-defined output node). You can include one or more Output nodes in a subflow. Each one that you include provides a terminal through which you can propagate messages to subsequent nodes in the message flow in which you include the subflow. The Output node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
1032
Message Flows
When you select and include a subflow in a message flow, it is represented by the following icon:
When you include the subflow in a message flow, this icon exhibits a terminal for each Output node that you included in the subflow, and the name of the terminal (which you can see when you hover over it) matches the name of that instance of the Output node. Give your Output nodes meaningful names, you can easily recognize them when you use their corresponding terminal on the subflow node in your message flow.
Using this node in a message flow Look at the following sample to see how to use this node: v Error Handler sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the Output node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. The Output node terminals are described in the following table. Terminal
Description
In
The output terminal that defines an out terminal for the subflow.
The following table describes 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 Output node Description properties are described in the following table.
|
Property
M
C
Default
Description
Node name
No
No
The node type, Output
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 Monitoring properties of the node are described in the following table:
Message flows
1033
||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Passthrough node
|
Use the Passthrough node to enable version control of a subflow at run time. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties”
Purpose Use the Passthrough node to add a label to your message flow or subflow. By combining this label with keyword replacement from your version control system, you can identify which version of a subflow is included in a deployed message flow. You can use this label for your own purposes. If you have included the correct version keywords in the label, you can see the value of the label: v Stored in the broker archive (BAR) file, using the mqsireadbar command v As last deployed to a particular broker, on the properties of a deployed message flow in the workbench v At run time, if you enable user trace for that message flow The Passthrough node does not process the message in any way. The message that it propagates on its Out terminal is the same message that it received on its In terminal. The Passthrough node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Use this node to identify a subflow; for example, if you develop an error processing subflow to include in several message flows, you might want to modify that subflow. However, you might want to introduce the modified version initially to just a subset of the message flows in which it is included. Set a value for the instance of the Passthrough node that identifies which version of the subflow you have included.
Terminals and properties When you have put an instance of the Passthrough node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All
1034
Message Flows
mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk. The Passthrough node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts a message for processing by the node.
Out
The input terminal that delivers a message to the subflow.
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 Passthrough node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
Passthrough
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 Passthrough node Basic properties are described in the following table. Property
M
C
Label
No
No
||
Property
M
C
| | | | |
Events
No
No
|
Description The label (identifier) of the node. Enter a value that defines a unique characteristic; for example, the version of the subflow in which the node is included.
The Monitoring properties of the node are described in the following table:
|
| | |
Default
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
PeopleSoftInput node Use the PeopleSoftInput node to interact with a PeopleSoft application. This topic contains the following sections: v “Purpose” on page 1036 v “Using this node in a message flow” on page 1036 v “Terminals and properties” on page 1036
Message flows
1035
Purpose Use the PeopleSoftInput node to interact with PeopleSoft applications. For example, a PeopleSoftInput node monitors a PeopleSoft system for a specified event. When that event occurs, the PeopleSoftInput node generates a message tree that represents the business object with the new event details. The message tree is propagated to the Out terminal so that the rest of the message flow can use the data to update other systems, or audit the changes. The PeopleSoftInput node is contained in the WebSphere Adapters drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow To function correctly, the PeopleSoftInput node needs an adapter component, which you set using the Adapter component node property, and business object definitions, which are stored in the message set that you reference from the node. For this reason, you must provide a message set. By default, the message that is propagated from the PeopleSoftInput node is in the DataObject domain, so the Message domain property is set to DataObject. You cannot specify a different domain. The message type is detected automatically by the node. The PeopleSoftInput node populates the route to label destination list with the name of the method binding. If you add a RouteToLabel node to the message flow after the PeopleSoftInput node, the RouteToLabel node can use the name of the method binding to route the message to the correct part of the message flow for processing. You can deploy only one input node that uses a particular adapter component to an execution group, but you can deploy many input nodes that use different adapter components to an execution group. You can use the mqsisetdbparms command in the following format to configure an account name with a user name and password for the Adapter for PeopleSoft Enterprise. mqsisetdbparms broker name -n adapter name -u user name -p password
For example: mqsisetdbparms BRK1 -n PeopleSoftCustomerInbound.inadapter -u peoplesoftuid -p ********
Terminals and properties When you have put an instance of the PeopleSoftInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. If you double-click a PeopleSoftInput node, you open the Adapter Connection wizard. 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 PeopleSoftInput node terminals are described in the following table.
1036
Message Flows
Terminal
Description
Out
Business object events from the adapter are sent to the Out terminal.
Failure
If an error happens in the PeopleSoftInput node, the message is propagated to the Failure terminal. Information about the error, and business object events can also be propagated to the Failure terminal.
Catch
Business object events are sent to the Catch terminal if they cause an uncaught exception in the message flow. If the Catch terminal is not connected, the retry process is activated to handle the business object.
The following table describes 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 PeopleSoftInput node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, PeopleSoftInput.
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 PeopleSoftInput node Basic properties are described in the following table. Property
M
C
Adapter component
Yes
Yes
Default Description The name of the adapter component that contains configuration properties for the adapter. Either enter a name of an adapter file or click Browse to select an adapter file from the list of files that are available in referenced message set projects.
The PeopleSoftInput node Routing properties are described in the following table. Property
M
C
Default
Description
Set No destination list
No
Selected
This property specifies whether to add the method binding name to the route to label destination list. If you select this check box, the method binding name is added so that you can use a RouteToLabel node in the message flow after the PeopleSoftInput node.
Label prefix
No
No
The prefix to add to the method name when routing to label. Add a label prefix to avoid a clash of corresponding label nodes when you include multiple WebSphere Adapters input nodes in the same message flow. By default, there is no label prefix, so the method name and label name are identical.
The PeopleSoftInput node Input Message Parsing properties are described in the following table.
Message flows
1037
Property
M
C
Default
Description
Message domain
No
No
DataObject
The domain that is used to parse the incoming message. By default, the message that is propagated from the PeopleSoftInput node is in the DataObject domain. You cannot specify a different domain.
Message set
Yes
No
Set automatically
The name of the message set in which the incoming message is defined. This field is set automatically from the Adapter component property. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the incoming message. You cannot set this property.
The PeopleSoftInput node Transactionality properties are described in the following table. Property
M
C
Transaction No mode
Default Description Yes
The transaction mode on this input node determines whether the rest of the nodes in the flow are executed under sync point.
The Instances properties of the PeopleSoftInput node are described in the following table. For a full description of these properties, refer to “Configurable message flow properties” on page 1398. Property
M
C
Default
Description
Additional No instances pool
Yes
The pool from which additional instances are obtained. Use Pool Associated v If you select Use Pool Associated with Message Flow, additional instances with are obtained from the message flow value. Message v If you select Use Pool Associated with Node, additional instances are Flow allocated from the node’s additional instances based on the number specified in the Additional instances property.
Additional No instances
Yes
0
The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node. By default, no additional instances are given to the node.
The PeopleSoftInput node Retry properties are described in the following table. Property
C
Default Description
Retry No mechanism
No
Failure
This property specifies how retry processing is handled when a failure is rolled back to the PeopleSoftInput node. v If you select Failure, retry processing is not performed so you cannot set the remaining properties. v If you select Short and long retry, retry processing is performed first at the interval that is specified by the Short retry interval property, and if that is unsuccessful, it is then performed at the interval that is specified by the Long retry interval property.
Retry threshold
Yes
0
The maximum number of times that retry processing is performed for short retry.
1038
M
No
Message Flows
Property
M
C
Default Description
Short retry No interval
Yes
0
The interval between short retry attempts.
Long retry No interval
Yes
0
The interval between long retry attempts.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
PeopleSoftRequest node Use the PeopleSoftRequest node to interact with a PeopleSoft application. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties” on page 1040
Purpose Use the PeopleSoftRequest node to interact with PeopleSoft applications. For example, a PeopleSoftRequest node requests information from a PeopleSoft Enterprise Information System (EIS). A customer business object is sent to PeopleSoft, causing PeopleSoft to retrieve information about a customer, such as an address and account details. The response information that is retrieved by the PeopleSoftRequest node can then be used by the rest of the message flow. The PeopleSoftRequest node can send and receive business data. The PeopleSoftRequest node is contained in the WebSphere Adapters drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow To function correctly, the PeopleSoftRequest node needs an adapter component, which you set using the Adapter component node property, and business object definitions, which are stored in the message set that you reference from the node. For this reason, you must provide a message set. By default, the message that is propagated from the PeopleSoftRequest node is in the DataObject domain, so the Message domain property is set to DataObject. You cannot specify a different domain. The message type is detected automatically by the node.
Message flows
1039
The PeopleSoftRequest node supports local transactions using the broker’s Local Transaction Manager, and global transactions using the broker’s external syncpoint coordinator. You can deploy several WebSphere Adapters request nodes that use the same adapter component to an execution group. You can use the mqsisetdbparms command in the following format to configure an account name with a user name and password for the Adapter for PeopleSoft Enterprise. mqsisetdbparms broker name -n adapter name -u user name -p password
For example: mqsisetdbparms BRK1 -n PeopleSoftCustomerOutbound.outadapter -u peoplesoftuid -p ********
Terminals and properties When you have put an instance of the PeopleSoftRequest node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. If you double-click a PeopleSoftRequest node, you open the Adapter Connection wizard. 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 PeopleSoftRequest node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts the request business object.
Out
The output terminal to which the response business object is sent if it represents successful completion of the request, and if further processing is required within this message flow.
Failure
If an error happens in the PeopleSoftRequest node, the message is propagated to the Failure terminal. Information about the error, and business object events can also be propagated to the Failure terminal.
The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk on the panel 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 PeopleSoftRequest node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type, e.g. PeopleSoftRequest
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 PeopleSoftRequest node Basic properties are described in the following table.
1040
Message Flows
Property
M
C
Default Description
Adapter Yes component
No
The name of the adapter component that contains configuration properties for the adapter. Either enter a name of an adapter file, or click Browse to select an adapter file from the list of files that are available in referenced message set projects.
Default method
Yes
The default method binding to use.
Yes
The PeopleSoftRequest node Response Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
DataObject
The domain that is used to parse the response message. By default, the response message that is propagated from the PeopleSoftRequest node is in the DataObject domain. You cannot specify a different domain.
Message set
Yes
No
Set automatically
The name of the message set in which the response message is defined. This field is set automatically from the Adapter component property. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the response message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the response message. You cannot set this property.
The PeopleSoftRequest node Transactionality properties are described in the following table. Property
M
Transaction No mode
C
Default Description
No
No
This property specifies that updates are performed independently, not as part of a local transaction. You cannot change this property.
The PeopleSoftRequest node Request properties are described in the following table. Property
M
C
Default
Description
Method Location
Yes
No
$LocalEnvironment/Adapter/ MethodName
The business method that is used to trigger the PeopleSoftRequest node to perform an action on the external system. For example: v createPurchaseOrder causes the PeopleSoftRequest node to create a purchase order in the EIS. v deletePurchaseOrder causes the PeopleSoftRequest node to delete a purchase order in the EIS.
Data Location
Yes
No
$Body
The location in the incoming message tree from which data is retrieved to form the request that is sent from the PeopleSoftRequest node to the EIS.
The PeopleSoftRequest node Result properties are described in the following table.
Message flows
1041
Property
M
C
Default
Description
Output data location
No
No
$OutputRoot
The message tree location to which the PeopleSoftRequest node sends output.
Copy local No environment
No
Selected
This property controls how the local environment is copied to the output message. If you select the check box, at each node in the message flow, a new copy of the local environment is created in the tree, and it is populated with the contents of the local environment from the preceding node. So if a node changes the local environment, the upstream nodes do not see those changes because they have their own copies. This behavior might be an issue if you are using a FlowOrder node, or if you use the propagate command on a Compute node. If you clear the check box, each node does not generate its own copy of the local environment, but it uses the local environment that is passed to it by the previous node. So if a node changes the local environment, those changes are seen by the upstream nodes.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
PHPCompute node
| | |
Use the PHPCompute node to route and transform an incoming message, using the PHP scripting language.
|
The PHPCompute node is available on Windows only.
| | | | | |
This topic contains the following sections: v “Purpose” v “Using the PHPCompute node in a message flow” on page 1043 v “Specifying PHP” on page 1043 v “Configuring the PHPCompute node” on page 1043 v “Terminals and properties” on page 1044
|
Purpose
| |
The PHPCompute node can use the PHP scripting language to route and transform incoming messages.
| | | | |
Using this node, you can achieve the following tasks: v Examine an incoming message and, depending on its content, propagate it unchanged to the node’s output terminal. v Change part of an incoming message and propagate the changed message to the output terminal using PHP.
1042
Message Flows
| |
v Create and build a new output message that is independent of the input message using PHP.
| |
The PHPCompute node is contained in the Transformation drawer of the palette, and is represented in the workbench by the following icon:
| | | |
To enable nodes that are available in WebSphere Message Broker Version 6.1.0.3 and later, use the -f parameter on the mqsichangebroker command. For more information, see mqsichangebroker command.
|
Using the PHPCompute node in a message flow
| |
Look at the following sample to see how to use this node: v PHPCompute Node sample
| |
You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
|
Specifying PHP
| | | | |
Code PHP statements to customize the behavior of the PHPCompute node. For example, you can customize the node to create a new output message or messages, using input message or database content (unchanged or modified), or new data. For example, you might want to modify a value in the input message by adding a value from a database, and store the result in a field in the output message.
| |
Code the PHP statements that you want in a PHP script file and ensure that it exists in the workspace before you associate it with the PHPCompute node.
| | |
If the required PHP script file already exists, import it into the workspace before associating it with the PHPCompute node (see Importing file systems into the workbench).
| | |
If a PHP file does not already exist for this node, create it in the project folder with a file extension of php (for example, myfile.php). For more information on creating a PHP script file, see “Creating PHP code for a PHPCompute node” on page 439.
|
Configuring the PHPCompute node
| | | |
When you have put an instance of the PHPCompute node into a message flow, you can configure it. 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 in that view.
| | |
To configure the PHPCompute node: 1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab.
| | |
2. On the Basic tab, use the PHP script property to specify the name of the PHP file. Select the Invoke ’evaluate()’ method in PHP class definition property if the code in your PHP script file includes an evaluate method.
Message flows
1043
| | |
3. On the Parser options tab, select the Use XMLNSC compact parser for the XMLNS domain property to specify that the XMLNSC Compact Parser is used for messages in the XMLNS Domain.
| | | |
4. On the Validation tab, specify the parser validation properties of the node. For more information about validation, see “Validating messages” on page 187. For information on how to fill in this tab, see “Validation tab properties” on page 1386.
|
Terminals and properties
|
The PHPCompute node terminals are described in the following table.
||
Terminal
Type
Description
| |
In
Input data
The input terminal that accepts a message for processing by the node.
|
Out
Output data
The output terminal to which the transformed message is routed.
| | | |
Failure
Output data
The output terminal to which the message is routed if a failure is detected during the computation. Even if the Validate property is set, messages that are propagated to the Failure terminal of the node are not validated.
| | |
* (dynamic)
Dynamic output
Zero or more dynamic output terminals can be created to support message routing.
| | | | | | | |
You can define additional dynamic output terminals on the PHPCompute node. Not all dynamic output terminals that are created on a PHPCompute node need to be mapped to an expression in the filter table. If any of the dynamic output terminals are unmapped, they never have messages propagated to them. Several expressions can map to the same single dynamic output terminal. No static output terminal exists to which the message is passed straight through. For more information about using dynamic terminals, see “Using dynamic terminals” on page 261.
| | | | |
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 PHPCompute node are described in the following table:
||
Property
M
C
Default
Description
|
Node name
No
No
PHPCompute
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 Basic properties of the PHPCompute node are described in the following table:
| ||
Property
M
C
| |
PHP script
Yes
Yes
1044
Message Flows
Default
Description A string containing the name of the PHP script file.
The Parser Options properties of the PHPCompute node are described in the following table.
| | ||
Property
| | | | | | | |
Use XMLNSC compact No parser for XMLNS domain
M
C
Default
Description
No
False
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing property, Message Domain, is XMLNS.
| |
The Validation properties of the PHPCompute node are described in the following table.
|
For a full description of these properties, see “Validation properties” on page 1385.
||
Property
M
C
Default
Description
| | | | | |
Validate
No
No
None
This property controls whether validation takes place. Valid values are:
| | | | | | | |
Failure action
v None v Content and Value v Content v Inherit No
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are: v Local Error Log v Exception v Exception List
The Monitoring properties of the node are described in the following table:
||
Property
M
C
| | | | |
Events
No
No
|
Exception
v User Trace
|
| | |
No
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Publication node Use the Publication node to filter output messages from a message flow and transmit them to subscribers who have registered an interest in a particular set of topics. The Publication node must always be an output node of a message flow and has no output terminals of its own. This topic contains the following sections: v “Purpose” on page 1046 Message flows
1045
v “Using this node in a message flow” v “Terminals and properties” on page 1047
Purpose Use the Publication node (or a user-defined node that provides a similar service) if your message flow supports publish/subscribe applications. Applications that expect to receive publications must register a subscription with a broker, and can optionally qualify the publications that they get by providing restrictive criteria (such as a specific publication topic). If your subscriber applications use the WebSphere MQ Enterprise Transport to connect to the broker, you can define the queues to which messages are published as WebSphere MQ clustered queues or shared queues. Publications can also be sent to subscribers within a WebSphere MQ cluster if a cluster queue is nominated as the subscriber queue. In this case, the subscriber should use the name of an ″imaginary″ queue manager that is associated with the cluster, and should ensure that a corresponding blank queue manager alias definition for this queue manager is made on the broker that satisfies the subscription. The Publication node is contained in the Routing drawer of the palette, and is represented in the workbench by the following icon:
You cannot include this node in a message flow if you have disabled the publish/subscribe engine of the broker or brokers to which you intend to deploy it. If you deploy a BAR file that includes this message flow, the deploy succeeds, but the broker throws a recoverable exception when a message is received by this node.
Using this node in a message flow Look at the following samples to see how to use this node: v Soccer Results sample v Scribble sample v JMS Nodes sample v Pager samples You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. For an example of how to use this node, assume that you have written a publishing application that publishes stock updates on a regular basis. The application sends the messages to the broker on an MQInput node, and the message flow provides a conversion from the input currency to a number of output currencies. Include a Publication node for each currency that is supported, and set the Subscription Point to a value that reflects the currency in which the stock price is published by the node; for example, Sterling, or USD.
1046
Message Flows
Terminals and properties When you have put an instance of the Publication node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 Publication node terminals are 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 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 Publication node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type: Publication
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 Publication node Basic properties are described in the following table. Property
M
C
Default
Description
Implicit Stream Naming
Yes
No
Cleared
Select Implicit Stream Naming to take the name of the WebSphere MQ queue on which the message was received by the message flow as the stream name. This property provides forward compatibility with WebSphere MQ Publish/Subscribe, and applies to messages with an MQRFH header when MQPSStream is not specified. Clear the check box if you do not want this action to be taken.
SubscriptionNo Point
No
The subscription point value for the node. If you do not specify a value for this property, the default subscription point is assumed. This value uniquely identifies the node, and can be used by subscribers to get a specific publication (as described in the example scenario in “Using this node in a message flow” on page 1046). For more information, see Subscription points.
Real-timeInput node Use the Real-timeInput node to receive messages from clients that connect to the broker using the WebSphere MQ Real-time Transport or the WebSphere MQ Multicast Transport, and that use JMS application programming interfaces. This topic contains the following sections: Message flows
1047
v “Purpose” v “Using this node in a message flow” v “Terminals and properties”
Purpose The Real-timeInput node handles messages in the following message domains: v JMSMap v JMSStream An output node in a message flow that starts with a Real-timeInput node can be any of the supported output nodes, including user-defined output nodes. You can create a message flow that receives messages from real-time clients and generates messages for clients that use all supported transports to connect to the broker, because you can configure the message flow to request the broker to provide any conversion that is required. If you create a message flow to use as a subflow, you cannot use a standard input node; you must use an instance of the Input node as the first node to create an In terminal for the subflow. If your message flow does not receive messages from JMS applications, choose one of the supported input nodes. The Real-timeInput node is contained in the Additional Protocols drawer of the palette, and is represented in the workbench by the following icon:
You cannot include this node in a message flow if you have disabled the publish/subscribe engine of the broker or brokers to which you intend to deploy it. If you deploy a BAR file that includes this message flow, the deploy succeeds, but the broker throws a recoverable exception when a message is received by this node.
Using this node in a message flow Look at the following sample to see how you can use this node: v Scribble sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the Real-timeInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 Real-timeInput node terminals are described in the following table.
1048
Message Flows
Terminal
Description
Out
The output terminal to which the message is routed if it is successfully retrieved from JMS. If this routing fails, the message is retried.
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 Real-timeInput node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type: Real-timeInput
The name of the node.
Short No Description
No
A brief description of the node.
Long No Description
No
Text that describes the purpose of the node in the message flow.
The Real-timeInput node Basic properties are described in the following table. Property
M
C
Default
Description
Port
Yes Yes
Authentication
Yes No
Cleared
To authenticate users that send messages on receipt of their messages, select this check box. If you clear the check box (the default setting), users are not authenticated.
Tunnel through HTTP
Yes No
Cleared
Select the check box to indicate that users use HTTP tunneling. If you clear the check box (the default setting), messages do not use HTTP tunneling. If you select the check box, all client applications that connect must use this feature. If they do not use this feature, their connection is rejected. The client application cannot use this option in conjunction with the connect-via proxy setting, which is activated from the client side.
Read Threads
No Yes
10
The number of threads that you want the broker to allocate to read messages. The broker starts as many instances of the message flow as are necessary to process current messages, up to this limit.
Write Threads
No Yes
10
The number of threads that you want the broker to allocate to write messages. The broker starts as many instances of the message flow as are necessary to process current messages, up to this limit.
Authentication Threads
No Yes
10
The number of threads that you want the broker to allocate to user authentication checks. The user authentication check is performed when a message is received. The broker starts as many instances of the message flow as are necessary to process current messages, up to this limit.
The port number on which the input node listens for publish or subscribe requests from JMS applications. Ensure that the port number that you specify does not conflict with any other listener service. No default value is provided for this property; you must enter a value.
The properties of the General Message Options for the Real-timeInput node are described in the following table.
Message flows
1049
Property
M
C
Default
Description
Parse Timing
No
No
On Demand This property controls when an input message is parsed. Valid values are On Demand, Immediate, and Complete. Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Real-timeOptimizedFlow node
|
Use the Real-timeOptimizedFlow node to receive messages from clients that connect to the broker using the WebSphere MQ Real-time Transport or the WebSphere MQ Multicast Transport, and that use JMS application programming interfaces. This topic contains the following sections: v “Purpose” v “Terminals and properties” on page 1051
Purpose The Real-timeOptimizedFlow node is a complete message flow that provides a high performance publish/subscribe message flow. The actions that are taken by this node are all internalized; you cannot influence the node’s operation except by configuring its properties, and you cannot connect it to any other node. This node also supports publication to, or subscription from, standard WebSphere MQ applications, but its performance for these applications is not as good as the performance achieved for JMS applications. You cannot affect the message content in any way when you use the Real-timeOptimizedFlow node. To modify the input message, or to send messages or make publications available to applications that use other communications protocols, use the Real-timeInput node. Include the Real-timeOptimizedFlow node in a message flow when you want to distribute messages through a broker to and from client applications that use JMS. The Real-timeOptimizedFlow node is contained in the Additional Protocols drawer of the palette, and is represented in the workbench by the following icon:
1050
Message Flows
You cannot include this node in a message flow if you have disabled the publish/subscribe engine of the broker or brokers to which you intend to deploy it. If you deploy a BAR file that includes this message flow, the deploy succeeds, but the broker throws a recoverable exception when a message is received by this node.
Terminals and properties When you have put an instance of the Real-timeOptimizedFlow node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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 Real-timeOptimizedFlow node has no terminals. It is a complete message flow and cannot be connected to other nodes to extend the message processing. 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 Real-timeOptimizedFlow node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
RealtimeOptimizedFlow
The name of the node.
Short No description
No
A brief description of the node.
Long No description
No
Text that describes the purpose of the node in the message flow.
The Real-timeOptimizedFlow node Basic properties are described in the following table. Property
M
C
Port
Yes
Yes
Authentication
Yes
No
Default
Description The port number on which the node listens for publish or subscribe requests from JMS applications. Ensure that the port number that you specify does not conflict with any other listener service. No default value is provided for this property; you must enter a value.
Cleared
For users to authenticate that send messages on receipt of their messages, select Authentication. If you clear the check box (the default setting), users are not authenticated.
Message flows
1051
Property
M
C
Default
Description
Tunnel through Yes HTTP
No
Cleared
For clients to use HTTP tunneling, select Tunnel through HTTP. If you clear the check box (the default setting), messages do not use HTTP tunneling. If you select the check box, all client applications that connect must use this feature. If they do not use this feature, their connection is rejected. The client application cannot use this option in conjunction with the connect-via-proxy setting, which is activated from the client side.
Read threads
No
Yes
10
The number of threads that you want the broker to allocate to read messages. The broker starts as many instances of the message flow as are necessary to process current messages, up to this limit.
Write threads
No
Yes
10
The number of threads that you want the broker to allocate to write messages. The broker starts as many instances of the message flow as are necessary to process current messages, up to this limit.
Authentication threads
No
Yes
10
The number of threads that you want the broker to allocate to user authentication checks. The user authentication check is performed when a message is received. The broker starts as many instances of the message flow as are necessary to process current messages, up to this limit.
RegistryLookup node Use the RegistryLookup node to access service metadata that resides in theWebSphere Service Registry and Repository. The RegistryLookup node does not perform additional filtering or selection other than that specified by the property matching. This topic contains the following sections: v “Purpose” v “Terminals and properties” on page 1053 Important: WebSphere Message Broker V6.1.0.2 only supports WebSphere Service Registry and Repository V6.1. Previous versions of the product are not supported.
Purpose You can use two nodes to access service metadata that resides in the WebSphere Service Registry and Repository, the EndpointLookup node and the RegistryLookup node. These nodes are designed to be included in message processing flows that mediate between service consumers and service providers in an SOA installation. These nodes are for generic WebSphere Service Registry and Repository access. The RegistryLookup node is contained in the Web services drawer of the message flow node palette, and is represented in the workbench by the following icon:
RegistryLookup node processing The RegistryLookup node processes messages in the following sequence. 1. The RegistryLookup node receives a message. 2. The RegistryLookup node retrieves the entity metadata information from the WebSphere Service Registry and Repository using the specified query string.
1052
Message Flows
The RegistryLookup node can be used to define a query dynamically within the message. Both the RegistryLookup and the EndpointLookup nodes can accept a query specified within the LocalEnvironment. Accepting a query specified within the LocalEnvironment overrides any property values set on the node, and all values are strings. XPath and ESQL are not supported when specifying the User Properties using the LocalEnvironment. Using the LocalEnvironment to set the properties, you can define the properties at runtime, or message processing time, rather than defining them at development time. You must use the format LocalEnvironment.ServiceRegistryLookupProperties.Name where Name is the property you want to define. It is still mandatory to set values on the properties of the nodes because the nodes cannot deploy without doing so. 3. If one or more matches are found: v If Match Policy is set to One, the RegistryLookup node adds the single matching metadata information to the message instance. If multiple possible matches exist the RegistryLookup node retrieves a random match. v If Match Policy is set to All, the RegistryLookup node adds all matching metadata to the message instance, leaving all other message content unchanged. Metadata information is propagated to the Out terminal, where it is available for further processing either by ESQL or by a JavaCompute node. 4. If no matches are found, the RegistryLookup node propagates the input message to the NoMatch terminal. Example usage. RegistryLookup node can be used to select the current endpoint address from multiple Version properties. When the destination is not a Web service you can use the RegistryLookup node to retrieve entity metadata, which can include the endpoint address. The Match Policy property value must be set to All. You can use a transformation node, such as the JavaCompute, Compute, XSLTransform, or Mapping node, to select the current version, to set endpoint address, and to add appropriate transport header. You must propagate the LocalEnvironment tree with the message.
Terminals and properties When you have put an instance of the RegistryLookup node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 RegistryLookup node terminals 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 message is routed if an error occurs.
Out
The output terminal to which matching registry information is sent.
NoMatch
The terminal to which the message is sent if no matching entity is found based on the specified values.
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
Message flows
1053
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 RegistryLookup node Description properties are described in the following table: Property
M
C
Default
Description
Node name
No
No
The node type: RegistryLookup
The name of the node.
Short description
No
No
None
A brief description of the node.
Long description
No
No
None
Text that describes the purpose of the node in the message flow.
The RegistryLookup node Basic properties are described in the following table: Property
M
C
Default
Description
Name
No
Yes
None
Namespace
No
Yes
None
Version
No
Yes
None
Enter the string values for one or more of Name, Namespace, and Version for the entities or artifacts that you want to retrieve from the WebSphere Service Registry and Repository. At least one of the properties is required. If you leave all three property values blank, you will get an error message when you try to save.
Template
No
Yes
None
The template or artifact type that you want to return from WebSphere Service Registry and Repository. This property only supports Business Model templates in WebSphere Service Registry and Repository.
User Properties
No
No
None
Allows a query to specify user-defined properties. Add User Properties by clicking Add. User Properties refer to the Custom Properties that are used to catalogue the entities in WebSphere Service Registry and Repository. Enter values for Property Name, Property Type, and Property Value. The Property Type can be a String (the default), XPATH expression, or ESQL Expression. The Property Type refers to the type of property provided within the Property Value.
Classification No
No
None
The Web Ontology Language (OWL) classification system property. Each classifier is a class in OWL, and has a Uniform Resource Identifier (URI). Using classifications in the registry can help to make objects easier to find and can also add meaning to custom objects that are unique to a particular system. Add a Classification by clicking Add and typing the complete fully qualified OWL URI for the OWL classification.
Match Policy
Yes
No
One
The policies to be returned. Select One to match one policy, or All to match all policies to the search criteria.
The Monitoring properties of the node are described in the following table:
|
1054
Message Flows
||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
ResetContentDescriptor node Use the ResetContentDescriptor node to request that the message is re-parsed by a different parser. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1056 v “Configuring the ResetContentDescriptor node” on page 1056 v “Terminals and properties” on page 1058
Purpose If you specify MRM as the new parser, you can also specify a different message template (message set, message type, and message format). This node does not re-parse the message, but the properties that you set for this node determine how the message is parsed when it is next re-parsed by the message flow. The node associates the new parser information with the input message bit stream. If the message has been parsed already to create a message tree, and the contents of the tree have been modified (for example, by a Compute node), the ResetContentDescriptor node must re-create the bit stream from the message tree by calling the current parser. If your message flow has updated the message before it is received by the ResetContentDescriptor node, ensure that the changed message contents are still valid for the current parser. If the contents are not valid, the parser generates an error when it attempts to re-create the bit stream from the message tree, and the ResetContentDescriptor node raises an exception. For example, if you have added a new field to a message in the MRM domain, and the field is not present in the model, the re-creation of the bit stream fails. The ResetContentDescriptor node does not: v Change the message content; it changes message properties to specify the way in which the bit stream is parsed next time that the parser is started. v Convert the message from one format to another; for example, if the incoming message has a message format of XML and the outgoing message format is binary, the ResetContentDescriptor node does not do any reformatting. It starts the parser to re-create the bit stream of the incoming XML message, which retains the XML tags in the message. When the message is re-parsed by a subsequent node, the XML tags are not valid and the re-parse fails. The ResetContentDescriptor node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
Message flows
1055
Using this node in a message flow For an example of how to use this node, assume that you want to swap between the BLOB and the MRM domains. The format of an incoming message might be unknown when it enters a message flow, therefore the BLOB parser is started. Later on in the message flow, you might decide that the message is predefined as a message in the MRM domain, and you can use the ResetContentDescriptor node to set the correct values to use when the message is parsed by a subsequent node in the message flow. The following table shows typical ResetContentDescriptor node properties. Property
Value
Message domain
MRM
Reset message domain
Selected
Message set
MyMessageSet
Reset message set
Selected
Message type
m_MESSAGE1
Reset message type
Selected
Message format
Text1
Reset message format
Selected
The Message domain is set to MRM, and the MRM parser is started when the message is next parsed. The Message set, Message type, and Message format are the message template values that define the message model, and all of the reset check boxes are selected because all of the properties need to change. The ResetContentDescriptor node causes the BLOB parser that is associated with the input message to construct the physical bit stream of the message (not the logical tree representation of it), which is later passed to the MRM parser. The MRM parser then parses the bit stream using the message template (Message set, Message type, and Message format) specified in this ResetContentDescriptor node. In Version 6.1, you do not have to include a ResetContentDescriptor node after an XSLTransform node in your message flow to set Message domain, Message set, Message type, and Message format of the message generated by the XSLTransform node. The XSLTransform node performs this function.
Configuring the ResetContentDescriptor node When you have put an instance of the ResetContentDescriptor node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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. 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab.
1056
Message Flows
2. On the Basic tab: a. To use a different parser associated with the message, specify the new domain in the Message domain property: v MRM v XMLNSC v DataObject v XMLNS v JMSMap v JMSStream v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) v IDOC (this domain is deprecated; use MRM) You can also specify a user-defined parser if appropriate. Select Reset message domain. If you leave the Message domain property blank and do not select Reset message domain, the domain is not reset. If you leave the Message domain property blank and select Reset message domain, the default value is BLOB. b. If the MRM, XMLNSC, or IDOC parser is to re-parse the message, specify the other properties of the model that are to be associated with the input message, and select the relevant reset check box beneath each field. If you select a reset check box for a property then, if you have not specified a value for that property, the value of that property is reset to blank. Alternatively, if you have specified a value for that property, the property is not blank. If you do not select the reset check box for a property, the value for that property is inherited from the incoming message. If the parser is associated with the input message already, specify only the properties that are to change. 1) Define the Message set. Choose a value from the list of available message sets (the name and identifier of the message set are shown), and select Reset message set. 2) For MRM only, define the name of the message in Message type. Enter the name and select Reset message type. 3) For MRM and IDOC, define the Message format. This property specifies the physical format for the parser. You can select one of the formats from the list (which lists the names of those formats that you have defined on the Message set specified previously), and select Reset message format. These properties set the message domain, message set, message type, and message format values in the message header of the message that you want to pass through the ResetContentDescriptor node. However, these actions are taken only if suitable headers already exist. If the message does not have an MQRFH2 header, the node does not create one. 3. On the Parser Options sub-tab: a. Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. For more details, see “Parsing on demand” on page 1389. b. Select Use MQRFH2C compact parser for MQRFH2 header if you want the MQRFH2C parser to be used. By default, this check box is cleared, which means that the compact parser is not used.
Message flows
1057
c. If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 4. On the Validation tab, set the validation properties if you want the parser to validate the body of messages against the Message set. (If a message is propagated to the Failure terminal of the node, it is not validated.) For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385.
Terminals and properties The ResetContentDescriptor node terminals 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 message is routed if an error is detected by the node.
Out
The output terminal to which the message is routed if a new parser is identified by the properties.
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 ResetContentDescriptor node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
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 Basic properties of the ResetContentDescriptor node are described in the following table. Property
M
C
Default
Description
Message domain
No
No
BLOB
The message domain that is associated with the message that you want to re-parse.
Reset message domain
Yes
No
Cleared
If you select the reset check box, the Message domain property is reset. In this case, if you do not select a value for the Message domain property, the Message domain property value is BLOB.
1058
Message Flows
Property
M
C
Message set
No
No
Default
Description The message set that is associated with the message that you want to re-parse. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Reset message set
Yes
No
Message type
No
No
Reset message type
Yes
No
Message format
No
No
Reset message format
Yes
No
Cleared
If you select the reset check box, the Message set property is reset. In this case, if you do not select a value for the Message set property, the Message set property value is blank. The message type that is associated with the message that you want to re-parse.
Cleared
If you select the reset check box, the Message type property is reset. In this case, if you do not select a value for the Message type property, the Message type property value is blank. The message format that is associated with the message that you want to re-parse.
Cleared
If you select the reset check box, the Message format property is reset. In this case, if you do not select a value for the Message format property, the Message format property value is blank.
The Parser Options properties of the ResetContentDescriptor node are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when the re-parsed message is parsed. Valid values are On Demand, Immediate, and Complete. For a full description of this property, see “Parsing on demand” on page 1389.
Use MQRFH2C compact parser for MQRFH2 header
No
No
Cleared
This property controls whether the MQRFH2C compact parser, instead of the MQRFH2 parser, is used for MQRFH2 headers.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Domain is XMLNS.
Message flows
1059
Property
M
C
Default
Description
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in the re-parsed message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in the re-parsed message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in the re-parsed message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the re-parsed message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The Validation properties of the ResetContentDescriptor node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content, Content and Value, and Inherit.
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content and Value or Content. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
1060
Message Flows
|
Route node Use the Route node to direct messages that meet certain criteria down different paths of a message flow. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals” on page 1062 v “Properties” on page 1063
Purpose As an example, you can forward a message to different service providers, based on the request details. You can also use the Route node to bypass unnecessary steps. For example, you can check to see if certain data is in a message, and perform a database lookup operation only if the data is missing. If you set the Distribution Mode property to All, you can trigger multiple events that each require different conditions. For example, you could log requests that relate to a particular account identifier, and send requests that relate to a particular product to be audited. You use XPath filter expressions to control processing. A filter expression’s result is cast as Boolean, so the result is guaranteed to be either true or false. For more information about XPath 1.0 query syntax, see W3C XPath 1.0 Specification. The Route node is contained in the Routing drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the Simplified Database Routing sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. The Route node has one input terminal and a minimum of three output terminals: Match, Default, and Failure. The Default and Failure output terminals are static, so they are always present on the node. The dynamic Match terminal is created automatically each time a new Route node is selected and used in the Message Flow editor. This behavior means that you do not always need to create this node’s first dynamic output terminal, which is the minimum number of terminals needed for this node to operate. You can rename this dynamic terminal if ″Match″ is not an appropriate name. A message is copied to the Default terminal if none of the filter expressions are true. If an exception occurs during filtering, the message is propagated to the Failure terminal. The Route node can define one or more dynamic output terminals. For all terminals, the associated filter expression is applied to the input message and, if the result is true, a copy of the message is routed to the given terminal. The Route node determines the order in which the terminals are driven. The node always propagates messages to the terminals in the order in which they appear in the filter table.
Message flows
1061
Each filter expression is applied to the input message in the order that is given in the filter table. If the result is true, a copy of the message is routed to its associated dynamic output terminal. If you set the Distribution Mode property to First, application of all filter expressions might not occur. Consider the following example input message: <EmployeeRecord> <EmployeeNumber>00001 Smith <Wage>20000
and the following XPath filter expressions: $Body/EmployeeRecord/EmployeeNumber="00002"|Match $Body/EmployeeRecord/EmployeeNumber="00001"|out_exp2
In this example, the Distribution Mode property is set to First. The Route node processes the XPath filter expressions, in the order in which they appear, against the input message. Because the Distribution Mode property is set to First, the unmodified input message is propagated only once to the dynamic output terminal that is mapped to the first filter expression that resolves to true. In the example above, the first filter expression, which is associated with the Match terminal, is false because the employee number in the input message is not ″00002″. So no message is propagated to the Match terminal. The second filter expression is true, so a copy of the input message is routed to the ″out_expr2″ dynamic terminal. If the employee number in the input message were ″00003″, and therefore did not match either filter expression, the message would be propagated to the static Default output terminal. If the Distribution Mode property were set to All for this example, the same outcome would be achieved because only one filter expression was true.
Terminals The Route node terminals are described in the following table. Terminal
Description
In
The static input terminal that accepts a message for processing by the node.
Match
A dynamic output terminal to which the original message can be routed when processing completes successfully. You can create additional dynamic terminals; see “Dynamic terminals.”
Default
The static output terminal to which the message is routed if no filter expression resolves to true.
Failure
The static output terminal to which the message is routed if a failure is detected during processing.
Dynamic terminals The Route node can have further dynamic output terminals. Not all dynamic output terminals that are created on a Route node need to be mapped to an expression in the filter table. For unmapped dynamic output terminals, messages are never propagated to them. Several expressions can map to the same single dynamic output terminal. No static output terminal exists to which the message is passed straight through. For more information about using dynamic terminals, see “Using dynamic terminals” on page 261.
1062
Message Flows
Properties When you have put an instance of the Route node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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 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 Route node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, Route
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 Route node Basic properties are described in the following table. Property
M
C
Filter table
Yes
No
Default
Description A table where all rows are expressions and associated terminal names that define the switching that is performed by this node following evaluation of each filter expression. The full expression is in the format XPath filter expression, terminal name All XPath expressions must start with $Root, $Body, $Properties, $LocalEnvironment, $DestinationList, $ExceptionList, or $Environment. Expressions are evaluated in the order in which they appear in the table. To improve performance, specify the expressions that are satisfied most frequently at the top of the filter table. Typically, you specify a unique terminal name for each XPath expression.
Distribution Mode
|
No
Yes
All
This property determines the routing behavior of the node when an inbound message matches multiple filter expressions. If you set the Distribution Mode property to First, the message is propagated to the associated output terminal of the first expression in the table that resolves to true. If you set this property to All, the message is propagated to the associated output terminal for each expression in the table that resolves to true. If no output terminal matches, the message is propagated to the Default terminal.
The Monitoring properties of the node are described in the following table:
Message flows
1063
||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
RouteToLabel node
|
Use the RouteToLabel node in combination with one or more Label nodes to dynamically determine the route that a message takes through the message flow, based on its content. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1065 v “Terminals and properties” on page 1065
Purpose The RouteToLabel node interrogates the LocalEnvironment of the message to determine the identifier of the Label node to which to route the message. You must precede the RouteToLabel node in the message flow with a Compute node that populates the LocalEnvironment of the message with the identifiers of one or more Label nodes that introduce the next sequence of processing for the message. The destinations are set up as a list of label names in the LocalEnvironment tree in a specific location. This excerpt of ESQL from the Airline Reservations sample demonstrates how to set up the LocalEnvironment content in a Compute node: IF InputRoot.XMLNSC.PassengerQuery.ReservationNumber<>'' THEN SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'SinglePassenger'; ELSE SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'AllReservations'; END IF;
The label names can be any string value, and can be specified explicitly in the Compute node, taken or cast from any field in the message, or retrieved from a database. A label name in the LocalEnvironment must match the Label Name property of a corresponding Label node. When you configure the Compute node, you must also select a value for the Compute Mode property from the list that includes LocalEnvironment. Design your message flow so that a RouteToLabel node logically precedes one or more Label nodes within a message flow, but do not physically wire the RouteToLabel node with a Label node. The connection is made by the broker, when required, according to the contents of LocalEnvironment. The RouteToLabel node is contained in the Routing drawer of the palette, and is represented in the workbench by the following icon:
1064
Message Flows
Using this node in a message flow Look at the following sample to see how to use this node: v Airline Reservations sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the RouteToLabel node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties for which you must enter a value are marked with an asterisk. The RouteToLabel node terminals 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 message is routed if a failure is detected during processing.
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 RouteToLabel node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type: RouteToLabel
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 RouteToLabel node Basic properties are described in the following table. Property
M
C
Default
Description
Mode
Yes
No
Route To Last
This property controls how the RouteToLabel node processes the items within the LocalEnvironment that is associated with the current message . Valid values are: v Route To First: removes the first item from LocalEnvironment. The current message is routed to the Label node that is identified by labelName in that list item. v Route To Last (the default): removes the last item from LocalEnvironment. The current message is routed to the Label node that is identified by labelName in that list item.
Message flows
1065
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SAPInput node
|
Use the SAPInput node to accept input from an SAP application. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties” on page 1067
Purpose Use the SAPInput node to accept input from SAP applications. For example, the SAPInput node might monitor an SAP system for new purchase orders. When a new purchase order is raised, the SAPInput node generates a message tree that represents the business object with the new purchase order details. The message tree is propagated to the Out terminal so that the rest of the message flow can use the data to update other systems, or to audit the changes. The SAPInput node is contained in the WebSphere Adapters drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow The SAPInput node needs an adapter component to function correctly. You set the component by using the Adapter component node property and business object definitions, which are stored in the message set that you reference from the node. For this reason, you must provide a message set. By default, the message that is propagated from the SAPInput node is in the DataObject domain, so the Message domain property is set to DataObject. You cannot specify a different domain. The message type is detected automatically by the node. The SAPInput node populates the route-to-label destination list with the name of the method binding. If you add a RouteToLabel node to the message flow after the SAPInput node, the RouteToLabel node can use the name of the method binding to route the message to the correct part of the message flow for processing. You can deploy only one input node that uses a particular adapter component to an execution group, but you can deploy many input nodes that use different adapter components to an execution group.
1066
Message Flows
You can use the mqsisetdbparms command in the following format to configure an account name with a user name and password for the Adapter for SAP Software. mqsisetdbparms broker name -n adapter name -u user name -p password
For example: mqsisetdbparms BRK1 -n SAPCustomerInbound.inadapter -u sapuid -p ********
The SAP inbound adapter has a property called Number of listeners, which configures the adapter to have a particular number of threads listening to the SAP program ID. These threads are not used directly to process messages in a message flow. When a message listener has an event to deliver to the message flow, it requests one of the instances of the flow. In general, it is sensible to keep the number of listeners equal to the number of instances (where instances equals 1 plus additional instances set on the flow or node). For example: v If the number of listeners is 1, and additional instances is 0, you get a single-threaded message flow that processes one message at a time. v If the number of listeners is 2, and additional instances is 1, you get two threads that process messages at the same time. v If the number of listeners is 2, and additional instances is 0, you get two threads that receive data from the EIS, but only one message flow thread will ever run. The listeners block processing until a message flow instance is available; the listeners do not queue multiple pieces of work. If you leave the number of listeners set to 1 (the default value), the broker ensures that the number of listeners is equal to the number of additional instances plus one. Additional threads can increase the throughput of a message flow but you should consider the potential impact on message order. Look at the SAP Connectivity sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. |
Using configurable services for SAP nodes
| | | | | |
SAP nodes can get SAP connection details from either the adapter component or a configurable service. By using a configurable service, several adapters can share the same connection details, and you can change the connection details for all adapters without the need to redeploy the adapters. For more details about creating, changing, reporting, and deleting the configurable services for SAP, see “Changing connection details for SAP adapters” on page 281.
Terminals and properties When you have put an instance of the SAPInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. If you double-click a SAPInput node, you open the Adapter Connection wizard. 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 SAPInput node terminals are described in the following table. Terminal
Description
Out
Business object events from the adapter are sent to the Out terminal.
Message flows
1067
Terminal
Description
Failure
If an error occurs in the SAPInput node, the message is propagated to the Failure terminal. Information about the error, and business object events can also be propagated to the Failure terminal.
Catch
Business object events are sent to the Catch terminal if they cause an uncaught exception in the message flow. If the Catch terminal is not connected, the retry process is activated to handle the business object.
The following tables describe the node properties. The columns headed M indicate whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined); the columns headed C indicate whether the property is configurable (you can change the value when you add the message flow to the bar file to deploy it). The SAPInput node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type, SAPInput
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 SAPInput node Basic properties are described in the following table. Property
M
C
Adapter Yes component
Default
Yes
Description The name of the adapter component that contains configuration properties for the adapter. Either enter a name of an adapter file, or click Browse to select an adapter file from the list of files that are available in referenced message set projects.
The SAPInput node Routing properties are described in the following table. Property
M
C
Default Description
Set No destination list
No
Selected Specifies whether to add the method binding name to the route-to-label destination list. If you select this check box, the method binding name is added so that you can use a RouteToLabel node in the message flow after the SAPInput node.
Label prefix
No
No
The prefix to add to the method name when routing to a label. Add a label prefix to avoid a clash of corresponding label nodes when you include multiple WebSphere Adapters input nodes in the same message flow. By default, there is no label prefix, so the method name and label name are identical.
The SAPInput node Input Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
DataObject
The domain that is used to parse the incoming message. By default, the message that is propagated from the SAPInput node is in the DataObject domain. You cannot specify a different domain.
1068
Message Flows
Property
M
Message set Yes
C
Default
Description
No
Set The name of the message set in which the incoming message is defined. automatically This field is set automatically from the Adapter component property. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the incoming message. You cannot set this property.
The SAPInput node Transactionality properties are described in the following table. Property
M
Transaction No mode
C
Default
Description
No
Yes
The transaction mode on this input node determines whether the rest of the nodes in the message flow are executed under sync point.
The Instances properties of the SAPInput node are described in the following table. For a full description of these properties, refer to “Configurable message flow properties” on page 1398. Property
M
C
Default
Description
Additional instances pool
No
Yes
Use Pool Associated with Message Flow
The pool from which additional instances are obtained. v If you select Use Pool Associated with Message Flow, additional instances are obtained from the message flow value. v If you select Use Pool Associated with Node, additional instances are allocated from the node’s additional instances based on the number specified in the Additional instances property.
Additional instances
No
Yes
0
The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node. By default, no additional instances are given to the node.
The SAPInput node Retry properties are described in the following table. Property
|
M
C
Default
Description
Retry No mechanism
No
Failure
Specifies how retry processing is handled when a failure is rolled back to the SAPInput node. v If you select Failure, retry processing is not performed so you cannot set the remaining properties. v If you select Short and long retry, retry processing is performed first at the interval that is specified by the Short retry interval property, and if that is unsuccessful, it is then performed at the interval that is specified by the Long retry interval property.
Retry threshold
No
Yes
0
The maximum number of times that retry processing is performed for short retry.
Short retry No interval
Yes
0
The interval between short retry attempts.
Long retry No interval
Yes
0
The interval between long retry attempts.
The Monitoring properties of the node are described in the following table: Message flows
1069
||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SAPRequest node
|
Use the SAPRequest node to send requests to an SAP application. This topic contains the following sections: v “Purpose” v “Using the SAPRequest node in a message flow” v “Terminals and properties” on page 1071
Purpose Use the SAPRequest node to send requests to an SAP applications. For example, the SAPRequest node might request information from an SAP Enterprise Information System (EIS). A customer business object is sent to SAP, causing SAP to retrieve information about a customer, such as an address and account details. The response information that is retrieved by the SAPRequest node can then be used by the rest of the message flow. The SAPRequest node can send and receive business data. The SAPRequest node is contained in the WebSphere Adapters drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using the SAPRequest node in a message flow The SAPRequest node needs an adapter component to function correctly. You set the component by using the Adapter component node property and business object definitions, which are stored in the message set that you reference from the node. For this reason, you must provide a message set. By default, the message that is propagated from the SAPRequest node is in the DataObject domain, so that the Message domain property is set to DataObject. You cannot specify a different domain. The node automatically detects the message type. The SAPRequest node supports local transactions using the broker’s Local Transaction Manager. You can deploy several WebSphere Adapters request nodes that use the same adapter component to an execution group. You can use the mqsisetdbparms command in the following format to configure an account name with a user name and password for the Adapter for SAP Software. The mqsisetdbparms command stores the password in case-sensitive form.
1070
Message Flows
However, when the SAP GUI sets a password, it automatically converts the password to upper case. Therefore, specify an upper case password to connect to the SAP system. mqsisetdbparms broker name -n adapter name -u user name -p PASSWORD
For example: mqsisetdbparms BRK1 -n SAPCustomerOutbound.outadapter -u sapuid -p ********
Look at the SAP Connectivity sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. |
Using configurable services for SAP nodes
| | | | | |
SAP nodes can get SAP connection details from either the adapter component or a configurable service. By using a configurable service, several adapters can share the same connection details, and you can change the connection details for all adapters without the need to redeploy the adapters. For more details about creating, changing, reporting, and deleting the configurable services for SAP, see “Changing connection details for SAP adapters” on page 281.
Terminals and properties When you have put an instance of the SAPRequest node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. If you double-click a SAPRequest node, you open the Adapter Connection wizard. 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 SAPRequest node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts the request business object.
Out
The output terminal to which the response business object is sent if it represents successful completion of the request, and if further processing is required within this message flow.
Failure
If an error occurs in the SAPRequest node, the message is propagated to the Failure terminal. Information about the error, and business object events can also be propagated to the Failure terminal.
The following tables describe the node properties. The columns headed M indicate whether the property is mandatory (marked with an asterisk on the panel if you must enter a value when no default is defined); the columns headed C indicate whether the property is configurable (you can change the value when you add the message flow to the bar file to deploy it). The SAPRequest node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type, e.g. SAPRequest
The name of the node.
Short description
No
No
A brief description of the node.
Message flows
1071
Property
M
C
Long description
No
No
Default
Description Text that describes the purpose of the node in the message flow.
The SAPRequest node Basic properties are described in the following table. Property
M
C
Default Description
Adapter component
Yes
No
The name of the adapter component that contains configuration properties for the adapter. Either enter a name of an adapter file, or click Browse to select an adapter file from the list of files that are available in referenced message set projects.
Default method
Yes
Yes
The default method binding to use.
The SAPRequest node Response Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
DataObject
The domain that is used to parse the response message. By default, the message that is propagated from the SAPRequest node is in the DataObject domain. You cannot specify a different domain.
Message set
Yes No
Set automatically
The name of the message set in which the incoming message is defined. This field is set automatically from the Adapter component property. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the response message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the response message. You cannot set this property.
The SAPRequest node Transactionality properties are described in the following table. Property
M
C
Default
Description
Transaction mode
No
No
Automatic
Specifies how updates are handled. v If you select Yes, the SAPRequest node takes part in the local transaction that is started by the message flow’s input node. v If you select No, the SAPRequest node does not take part in the local transaction that is started by the message flow’s input node. v If you select Automatic, the SAPRequest node uses the value that is set on the input node that drives the message flow. For example, if the message flow is driven by a SAPInput node, the SAPRequest assumes the Transaction mode that is set on the SAPInput node.
The SAPRequest node Request properties are described in the following table.
1072
Message Flows
Property
M
C
Method Location
Yes No
Default
Description
$LocalEnvironment/ Adapter/MethodName
The business method that is used to trigger the SAPRequest node to perform an action on the external system. For example: v createPurchaseOrder causes the SAPRequest node to create a purchase order in the EIS. v deletePurchaseOrder causes the SAPRequest node to delete a purchase order in the EIS.
Data Location
Yes No
$Body
The location in the incoming message tree from which data is retrieved to form the request that is sent from the SAPRequest node to the EIS.
The SAPRequest node Result properties are described in the following table. Property
M
C
Default
Description
Output data No location
No
$OutputRoot
The message tree location to which the SAPRequest node sends output.
Copy local No environment
No
Selected
This property controls how the local environment is copied to the output message. If you select this check box, a new copy of the local environment is created in the tree (at each node in the message flow), and it is populated with the contents of the local environment from the preceding node. Therefore, if a node changes the local environment, the previous nodes in the flow do not see those changes because they have their own copies. This behavior might be an issue if you are using a FlowOrder node, or if you use the propagate command on a Compute node. If you clear the check box, each node does not generate its own copy of the local environment, but it uses the local environment that is passed to it by the previous node. Therefore, if a node changes the local environment, those changes are seen by the upstream nodes.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SCADAInput node Use the SCADAInput node to receive messages from clients that connect to the broker across the WebSphere MQ Telemetry Transport. This topic contains the following sections: v “Purpose” on page 1074 v “Using this node in a message flow” on page 1075 v “Configuring the SCADAInput node” on page 1075 v “Terminals and properties” on page 1078
Message flows
1073
Purpose SCADA device clients use the MQIsdp protocol to send messages that are converted by the SCADAInput node into a format that is recognized by WebSphere Message Broker. The node also establishes the processing environment for these messages. Message flows that handle messages received from SCADA devices must always start with a SCADAInput node. Set the SCADAInput node properties to control the way in which messages are received; for example, you can indicate that a message is to be processed under transaction control. When you deploy message flows that contain SCADA nodes to a broker, deploy them to a single execution group, regardless of the number of message flows. The execution group to which the SCADA flows are deployed must be the default execution group. The default execution group can be identified by inspecting the defaultExecutionGroup field in the BIP2201 message at the execution group startup. A value of true denotes the default execution group. SCADA is primarily a publish/subscribe protocol; therefore, you typically include a Publication node to end the flow. In scenarios where you do not want to use a Publication node, include a SCADAOutput node. If you include a SCADAOutput node, you must also include a SCADAInput node, regardless of the source of the messages, because the SCADAInput node provides the connectivity information that is required by the SCADAOutput node. If you include an output node in a message flow that starts with a SCADAInput node, it can be any of the supported output nodes, including user-defined output nodes. You can create a message flow that receives messages from SCADA devices, and generates messages for clients that use all supported transports to connect to the broker, because you can configure the message flow to request the broker to provide any necessary conversion. You can request that the broker starts or stops a SCADA listener by publishing messages with a specific topic. This request can apply to all ports or to a single port that is identified in the message. The SCADAInput node handles messages in the following message domains: v MRM v XMLNSC v XMLNS v JMSMap v JMSStream v MIME v BLOB v XML (this domain is deprecated; use XMLNSC) You also specify that a user-defined parser is to be used, if appropriate. z/OS You cannot use SCADAInput nodes in message flows that are to be deployed on z/OS systems.
To process the data in an incoming SCADA message, include a node such as the ResetContentDescriptor node, and set its properties to force the bit stream to be re-parsed by a subsequent node.
1074
Message Flows
If you create a message flow to use as a subflow, you cannot use a standard input node; you must use an instance of the Input node as the first node to create an In terminal for the subflow. If your message flow does not receive messages across SCADA connections, choose one of the supported input nodes. The SCADAInput node is contained in the Additional Protocols drawer of the palette, and is represented in the workbench by the following icon:
You cannot include this node in a message flow if you have disabled the publish/subscribe engine of the broker or brokers to which you intend to deploy it. If you deploy a BAR file that includes this message flow, the deploy succeeds, but the broker throws a recoverable exception when a message is received by this node.
Using this node in a message flow For an example of how to use this node, assume that you create a message flow with a SCADAInput node that receives messages from a remote sensor when it detects a change in its operating environment (for example, a drop in outside temperature). You connect the node to an MQOutput node, which makes these messages available on a queue that is serviced by a WebSphere MQ application that analyses and responds to the information that is received. In another example, you create a message flow with a SCADAInput node that receives messages every minute from a remote system. The messages contain details of the system’s switch settings. The data that is received is fed into a ResetContentDescriptor node to cast the data from binary (BLOB) to MRM message format. The information about the system is stored in a database using the Database node, and enriched using a Compute node to create an XML message, which is published using a Publication node. XML messages are expensive to send (because satellite transmission has a high cost for each byte); therefore, it is advantageous to use this method because data is enriched by the broker.
Configuring the SCADAInput node When you have put an instance of the SCADAInput node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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. 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, set the following properties: v Update the status of the listener by publishing on the control topic $SYS/SCADA/MQIsdpListener/<port_number> with the Payload part of the
Message flows
1075
message set to ON or OFF. Enable listener on startup is initially selected, which means that the listener for MQIsdp clients is initialized when the message flow is deployed. v Specify the Port number on which the MQIsdp server listens. This value must be a unique port number, and must not conflict with other listeners (for example, those set up for WebSphere MQ or WebSphere MQ Everyplace). The default number is 1883. v Set the Max threads value to indicate the maximum number of threads available to the MQIsdp server to support clients. The default value is 500. If you are using DB2 as your broker database, specify a value that is less than or equal to the value that you have set for the DB2 configuration parameters maxappls and maxagents. For further information, see Enabling ODBC connections to the databases. v Select Use thread pooling if you want the node to use a pool of threads to service clients. If you select this option, the number of threads that are available to the MQIsdp server is limited by Max threads, which is most effective when set to a value between 20 and 40. If you do not select this option, a new thread is created for each client that connects. The check box is cleared initially. Use this option only if you expect a large number of clients (greater than 200) to connect. 3. On the Input Message Parsing tab, set values for the properties that describe the message domain, message set, message type, and message format that the node uses to determine how to parse the incoming message. v In Message domain, select the name of the parser that you are using from the list. The default value is BLOB. You can choose from the following options: – MRM – XMLNSC – XMLNS – JMSMap – JMSStream – MIME – BLOB – XML (this domain is deprecated; use XMLNSC) You can also specify a user-defined parser, if appropriate. v If you are using the MRM parser or XMLNSC parser in validating mode, select the Message set that you want to use. This list is populated with available message sets when you select MRM or XMLNSC as the domain. v If you are using the MRM parser, select the correct message from the list in Message type. This list is populated with messages that are defined in the Message set that you have selected. v If you are using the MRM parser, select the format of the message from the list in Message format. This list includes all the physical formats that you have defined for this Message set. 4. On the Parser Options sub-tab: v Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. v If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391.
1076
Message Flows
5. On the Advanced tab, set the required value for Transaction mode to define the transactional characteristics of how this message is handled: v If you select Automatic, the incoming message is received under sync point if it is marked as persistent; otherwise, it is not received under sync point. The transactionality of any derived messages that are sent subsequently by an output node is determined by the incoming persistence property, unless the output node has overridden transactionality explicitly. v If you select Yes, the incoming message is received under sync point. Any derived messages that are sent subsequently by an output node in the same instance of the message flow are sent transactionally, unless the output node has overridden transactionality explicitly. v If you select No, the incoming message is not received under sync point. Any derived messages that are sent subsequently by an output node in the flow are sent non-transactionally, unless the output node has specified that the message must be put under sync point. 6. On the Validation tab, set the validation properties if you want the parser to validate the body of messages from the Message set. If a message is propagated to the Failure terminal of the node, it is not validated. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. Connecting the terminals: The SCADAInput node routes each message that it retrieves successfully to the Out terminal. If this action fails, the message is propagated to the Failure terminal; you can connect nodes to this terminal to handle this condition. If you have not connected the Failure terminal, the message loops continually through the node until the problem is resolved. If the message is caught by this node after an exception has been thrown further on in the message flow, the message is routed to the Catch terminal. If you have not connected the Catch terminal, the message loops continually through the node until the problem is resolved. Ensure that a node is always connected to this terminal if there is the possibility of the message rolling back within a message flow. Configuring for coordinated transactions: When you include a SCADAInput node in a message flow, the value that you set for Transaction mode defines whether messages are received under sync point: v If you set this property to Yes (the default), the message is received under sync point; that is, within a WebSphere MQ unit of work. Any messages that are sent subsequently by an output node in the same instance of the message flow are put under sync point, unless the output node has overridden this explicitly. v If you set this property to Automatic, the message is received under sync point if the incoming message is marked as persistent; otherwise, it is not received under sync point. Any message that is sent subsequently by an output node is put under sync point, as determined by the incoming persistence property, unless the output node has overridden this explicitly. v If you set this property to No, the message is not received under sync point. Any messages that are sent subsequently by an output node in the message flow are not put under sync point, unless an individual output node has specified that the message must be put under sync point.
Message flows
1077
The MQOutput node is the only output node that you can configure to override this option.
Terminals and properties The SCADAInput node terminals are described in the following table. Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs.
Out
The output terminal to which the message is routed if it is successfully retrieved from the queue.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by this 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 SCADAInput node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node The name of the node. type, SCADAInput
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 SCADAInput node Basic properties are described in the following table. Property
M
C
Default
Description
Enable listener on startup
Yes
No
Selected
This property controls when the listener is started. If you select the check box, the listener starts when the message flow is started by the broker. If you clear the check box, the listener starts on the arrival of a message on the specified port.
Port
Yes
Yes
1883
The port on which the SCADA protocol is listening.
Max threads
Yes
Yes
500
The maximum number of threads to be started to support SCADA devices.
Use thread pooling
Yes
Yes
Cleared
If you select the check box, thread pooling is used.
The SCADAInput node Input Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
BLOB
The domain that is used to parse the incoming message.
1078
Message Flows
Property
M
C
Message set
No
No
Default
Description The name or identifier of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message.
Message format
No
No
The name of the physical format of the incoming message.
The SCADAInput node Parser Options properties are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are On Demand, Immediate, and Complete. For a full description of this property, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the Input Message Parsing properties Message domain is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Message flows
1079
Property
M
C
Default
Description
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The SCADAInput node Advanced property is described in the following table. Property
M
C
Default
Description
Transaction mode
Yes
No
Yes
This property controls whether the incoming message is received under sync point. Valid values are Automatic, Yes, and No.
The SCADAInput node Validation properties are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content and Value, and Content.
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SCADAOutput node
|
Use the SCADAOutput node to send a message to a client that connects to the broker using the MQIsdp protocol across the WebSphere MQ Telemetry Transport. This topic contains the following sections: v “Purpose” v “Connecting the terminals” on page 1081 v “Terminals and properties” on page 1082
Purpose You use the Publication node to send output to a SCADA client. The SCADAOutput node lets you write your own Publication node.
1080
Message Flows
If you include a SCADAOutput node in a message flow, also include a SCADAInput node, regardless of the source of the messages, because the SCADAInput node provides the connectivity information that is required by the SCADAOutput node. When you deploy message flows that contain SCADA nodes to a broker, deploy them to a single execution group, regardless of the number of message flows. The execution group to which the SCADA flows are deployed must be the default execution group. The default execution group can be identified by inspecting the defaultExecutionGroup field in the BIP2201 message at the execution group startup. A value of true denotes the default execution group. You cannot use the SCADAOutput node to change the transactional characteristics of the message flow. The transactional characteristics that are set by the message flow’s input node determine the transactional behavior of the flow. You cannot use SCADAOutput nodes in message flows that you deploy to z/OS systems. z/OS
If you create a message flow to use as a subflow, you cannot use a standard output node; use an instance of the Output node to create an out terminal for the subflow through which the message can be propagated. If you do not want your message flow to send messages to a SCADA device, choose another supported output node. The SCADAOutput node is contained in the Additional Protocols drawer of the message flow node palette, and is represented in the workbench by the following icon:
You cannot include this node in a message flow if you have disabled the publish/subscribe engine of the broker or brokers to which you intend to deploy it. If you deploy a BAR file that includes this message flow, the deploy succeeds, but the broker throws a recoverable exception when a message is received by this node.
Connecting the terminals Connect the In terminal to the node from which messages that are bound for SCADA destinations are routed. Connect the Out or Failure terminal of this node to another node in this message flow to process the message further, process errors, or send the message to an additional destination. If you connect the Out or Failure terminal, the LocalEnvironment that is associated with the message is enhanced with the following information for each destination to which the message has been put by this node: v Queue name v Queue manager name v Message reply identifier (this is set to the same value as message ID) Message flows
1081
v Message ID (from the MQMD) v Correlation ID (from the MQMD) These values are written in WrittenDestination within the LocalEnvironment tree structure. If you do not connect either terminal, the LocalEnvironment tree is unchanged.
Terminals and properties When you have put an instance of the SCADAOutput node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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 SCADAOutput node terminals 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 message is routed if a failure is detected when the message is put to the output queue.
Out
The output terminal to which the message is routed if it has been successfully put to the output queue, and if further processing is required within this message flow.
The following table describes 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 SCADAOutput node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, SCADAOutput
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 Validation properties of the SCADAOutput node are described in the following table. If a message is propagated to the Failure terminal of the node, it is not validated. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property M
C
Default
Description
Validate No
Yes
Inherit
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
1082
Message Flows
Property M
C
Default
Failure action
No
Exception This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
No
Description
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SiebelInput node Use the SiebelInput node to interact with a Siebel application. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties” on page 1084
Purpose Use the SiebelInput node to interact with Siebel applications. For example, a SiebelInput node monitors a Siebel system for a specified event. When that event occurs, the SiebelInput node generates a message tree that represents the business object with the new event details. The message tree is propagated to the Out terminal so that the rest of the message flow can use the data to update other systems, or audit the changes. The SiebelInput node is contained in the WebSphere Adapters drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow To use the SiebelInput node, you must first create the Siebel event table. For instructions, see “Creating the event store manually” on page 276. To function correctly, the SiebelInput node needs an adapter component, which you set using the Adapter component node property, and business object definitions, which are stored in the message set that you reference from the node. For this reason, you must provide a message set. By default, the message that is propagated from the SiebelInput node is in the DataObject domain, so the Message domain property is set to DataObject. You cannot specify a different domain. The message type is detected automatically by the node. Message flows
1083
The SiebelInput node populates the route to label destination list with the name of the method binding. If you add a RouteToLabel node to the message flow after the SiebelInput node, the RouteToLabel node can use the name of the method binding to route the message to the correct part of the message flow for processing. You can deploy only one input node that uses a particular adapter component to an execution group, but you can deploy many input nodes that use different adapter components to an execution group. You can use the mqsisetdbparms command in the following format to configure an account name with a user name and password for the Adapter for Siebel Business Applications. mqsisetdbparms broker name -n adapter name -u user name -p password
For example: mqsisetdbparms BRK1 -n SiebelCustomerInbound.inadapter -u siebeluid -p ********
Terminals and properties When you have put an instance of the SiebelInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. If you double-click a SiebelInput node, you open the Adapter Connection wizard. 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 SiebelInput node terminals are described in the following table. Terminal
Description
Out
Business object events from the adapter are sent to the Out terminal.
Failure
If an error happens in the SiebelInput node, the message is propagated to the Failure terminal. Information about the error, and business object events can also be propagated to the Failure terminal.
Catch
Business object events are sent to the Catch terminal if they cause an uncaught exception in the message flow. If the Catch terminal is not connected, the retry process is activated to handle the business object.
The following table describes 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 SiebelInput node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, SiebelInput.
The name of the node.
Short No Description
No
A brief description of the node.
Long No Description
No
Text that describes the purpose of the node in the message flow.
The SiebelInput node Basic properties are described in the following table.
1084
Message Flows
Property
M
Adapter Yes component
C
Default
Yes
Description The name of the adapter component that contains configuration properties for the adapter. Either enter a name of an adapter file or click Browse to select an adapter file from the list of files that are available in referenced message set projects.
The SiebelInput node Routing properties are described in the following table. Property
M
C
Default Description
Set No destination list
No
Selected This property specifies whether to add the method binding name to the route to label destination list. If you select this check box, the method binding name is added so that you can use a RouteToLabel node in the message flow after the SiebelInput node.
Label prefix
No
The prefix to add to the method name when routing to label. Add a label prefix to avoid a clash of corresponding label nodes when you include multiple WebSphere Adapters input nodes in the same message flow. By default, there is no label prefix, so the method name and label name are identical.
No
The SiebelInput node Input Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
DataObject
The domain that is used to parse the incoming message. By default, the message that is propagated from the SiebelInput node is in the DataObject domain. You cannot specify a different domain.
Message set
Yes
No
Set automatically The name of the message set in which the incoming message is defined. This field is set automatically from the Adapter component property. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the incoming message. You cannot set this property.
The SiebelInput node Transactionality properties are described in the following table. Property
M
Transaction No mode
C
Default
Description
No
Yes
The transaction mode on this input node determines whether the rest of the nodes in the flow are executed under sync point.
The Instances properties of the SiebelInput node are described in the following table. For a full description of these properties, see “Configurable message flow properties” on page 1398.
Message flows
1085
Property
M
C
Default
Description
Additional No instances pool
Yes
Use Pool The pool from which additional instances are obtained. Associated v If you select Use Pool Associated with Message Flow, additional instances are with obtained from the message flow value. Message v If you select Use Pool Associated with Node, additional instances are Flow allocated from the node’s additional instances based on the number specified in the Additional instances property.
Additional No instances
Yes
0
The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node. By default, no additional instances are given to the node.
The SiebelInput node Retry properties are described in the following table. Property
M
C
Default Description
Retry No mechanism
No
Failure
This property specifies how retry processing is handled when a failure is rolled back to the SiebelInput node. v If you select Failure, retry processing is not performed so you cannot set the remaining properties. v If you select Short and long retry, retry processing is performed first at the interval that is specified by the Short retry interval property, and if that is unsuccessful, it is then performed at the interval that is specified by the Long retry interval property.
Retry threshold
No
Yes
0
The maximum number of times that retry processing is performed for short retry.
Short retry interval
No
Yes
0
The interval between short retry attempts.
Long retry interval
No
Yes
0
The interval between long retry attempts.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SiebelRequest node
|
Use the SiebelRequest node to interact with a Siebel application. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1087 v “Terminals and properties” on page 1087
Purpose Use the SiebelRequest node to interact with Siebel applications. For example, a SiebelRequest node requests information from a Siebel Enterprise Information
1086
Message Flows
System (EIS). A customer business object is sent to Siebel, causing Siebel to retrieve information about a customer, such as an address and account details. The response information that is retrieved by the SiebelRequest node can then be used by the rest of the message flow. The SiebelRequest node can send and receive business data. The SiebelRequest node is contained in the WebSphere Adapters drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow To function correctly, the SiebelRequest node needs an adapter component, which you set using the Adapter component node property, and business object definitions, which are stored in the message set that you reference from the node. For this reason, you must provide a message set. By default, the message that is propagated from the SiebelRequest node is in the DataObject domain, so the Message domain property is set to DataObject. You cannot specify a different domain. The message type is detected automatically by the node. The SiebelRequest node supports local transactions using the broker’s Local Transaction Manager, and global transactions using the broker’s external syncpoint coordinator. You can deploy several WebSphere Adapters request nodes that use the same adapter component to an execution group. You can use the mqsisetdbparms command in the following format to configure an account name with a user name and password for the Adapter for Siebel Business Applications. mqsisetdbparms broker name -n adapter name -u user name -p password
For example: mqsisetdbparms BRK1 -n SiebelCustomerOutbound.outadapter -u siebeluid -p ********
Terminals and properties When you have put an instance of the SiebelRequest node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. If you double-click a SiebelRequest node, you open the Adapter Connection wizard. 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 SiebelRequest node terminals are described in the following table. Terminal Description In
The input terminal that accepts the request business object.
Out
The output terminal to which the response business object is sent if it represents successful completion of the request, and if further processing is required within this message flow.
Message flows
1087
Terminal Description Failure
If an error happens in the SiebelRequest node, the message is propagated to the Failure terminal. Information about the error, and business object events can also be propagated to the Failure terminal.
The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk on the panel 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 SiebelRequest node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, for example, SiebelRequest
The name of the node.
Short No description
No
A brief description of the node.
Long No description
No
Text that describes the purpose of the node in the message flow.
The SiebelRequest node Basic properties are described in the following table. Property
M
C
Default Description
Adapter Yes component
No
The name of the adapter component that contains configuration properties for the adapter. Either enter a name of an adapter file, or click Browse to select an adapter file from the list of files that are available in referenced message set projects.
Default method
Yes
The default method binding to use.
Yes
The SiebelRequest node Response Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
DataObject
The domain that is used to parse the response message. By default, the response message that is propagated from the SiebelRequest node is in the DataObject domain. You cannot specify a different domain.
Message set
Yes No
Set automatically
The name of the message set in which the incoming message is defined. This field is set automatically from the Adapter component property. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the response message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the response message. You cannot set this property.
The SiebelRequest node Transactionality properties are described in the following table.
1088
Message Flows
Property
M
Transaction No mode
C
Default Description
No
No
This property specifies that updates are performed independently, not as part of a local transaction. You cannot change this property.
The SiebelRequest node Request properties are described in the following table. Property
M
C
Default
Description
Method Location
Yes
No
$LocalEnvironment/ Adapter/MethodName
The business method that is used to trigger the SiebelRequest node to perform an action on the external system. For example: v createPurchaseOrder causes the SiebelRequest node to create a purchase order in the EIS. v deletePurchaseOrder causes the SiebelRequest node to delete a purchase order in the EIS.
Data Location
Yes
No
$Body
The location in the incoming message tree from which data is retrieved to form the request that is sent from the SiebelRequest node to the EIS.
The SiebelRequest node Result properties are described in the following table. Property
M
C
Default
Description
Output data location
No
No
$OutputRoot The message tree location to which the SiebelRequest node sends output.
Copy local No environment
No
Selected
This property controls how the local environment is copied to the output message. If you select the check box, at each node in the message flow, a new copy of the local environment is created in the tree, and it is populated with the contents of the local environment from the preceding node. So if a node changes the local environment, the upstream nodes do not see those changes because they have their own copies. This behavior might be an issue if you are using a FlowOrder node, or if you use the propagate command on a Compute node. If you clear the check box, each node does not generate its own copy of the local environment, but it uses the local environment that is passed to it by the previous node. So if a node changes the local environment, those changes are seen by the upstream nodes.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SOAPAsyncRequest node Use the SOAPAsyncRequest node in conjunction with the SOAPAsyncResponse node to construct a pair of message flows that call a Web service asynchronously.
Message flows
1089
This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1091 v “Configuring the SOAPAsyncRequest node” on page 1091 v “LocalEnvironment overrides” on page 1095 v “Working with WrittenDestination data” on page 1095 v “Terminals and properties” on page 1096
Purpose The SOAPAsyncRequest node sends a Web service request, but the node does not wait for the associated Web service response to be received. However, the SOAPAsyncRequest node does wait for the HTTP 202 acknowledgement before continuing with the message flow, and the SOAPAsyncRequest node blocks if the acknowledgement is not received. The Web service response is received by the SOAPAsyncResponse node, which can be in a separate message flow. The nodes are used as a pair, and correlate responses against the original requests.
some message
Input
SOAP Async Request
WSDL
External Web service
some response
Output
SOAP Async Response
The SOAPAsyncRequest node is the first half of the asynchronous request and response node pair. The SOAPAsyncRequest node calls a remote SOAP-based Web service. The request is sent by the SOAPAsyncRequest node, but the SOAPAsyncRequest node does not receive the response. The response is received by a SOAPAsyncResponse node that is running on a different thread. The SOAPAsyncResponse node is typically at the beginning of a different message flow; however, it must be in the same execution group as the SOAPAsyncRequest node. The SOAPAsyncRequest node is WSDL-driven, in a similar manner to the SOAPRequest node. The SOAPAsyncRequest node is contained in the Web Services drawer of the palette, and is represented in the workbench by the following icon:
1090
Message Flows
Using this node in a message flow The following sample demonstrates how to use the asynchronous SOAP nodes when you call a Web service. The Web service simulates an order service, and the client shows how existing WebSphere MQ interfaces can be extended to make Web service requests. v Asynchronous Consumer sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the SOAPAsyncRequest node When you have put an instance of the SOAPAsyncRequest node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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. 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, you must set the following properties: v Unique identifier. You must specify the unique URL fragment that is common to your pair of SOAPAsyncRequest and SOAPAsyncResponse nodes. This property is mandatory. v You must associate a WSDL file with this node, and configure a number of WSDL-related properties. Before configuring the WSDL file on this node you must have a message set with a Deployable WSDL resource. – WSDL file name. This property is mandatory and is of type String. If the node was created by dropping a WSDL file from a message set onto the message flow editor, this property will be preset to the name of the WSDL file. If the name of the WSDL file is not preset, you can set this property in one of the following ways. - If you have Deployable WSDL, you can select from the Deployable WSDL files by clicking Browse. - If you have WSDL definitions, but no message set, then you can create a message set: a. Click Browse to open the WSDL Selection window. b. Click Import/Create New to open the Import WSDL file wizard. c. Enter the message set name and message set project name. Click Next. d. Choose the relevant option: v If your WSDL file already exists in your workspace, select Use resources from the workspace, and select the WSDL file. v If your WSDL file is in the file system, select Use external resources. Select the WSDL file. Click Next. e. Select the WSDL bindings to import. Any warnings or errors are displayed in the wizard banner. Message flows
1091
f. Click Finish. Result: Creates a new message set project and message set, with message definitions. The WSDL definitions are added to the Deployable WSDL folder. g. You can now select the WSDL file from the WSDL Selection window. Click OK. - If you have a message set but no WSDL definition, you must generate a WSDL definition. See Generating a WSDL definition from a message set. - Drag a WSDL file from a message set onto the node. - Type in a file name that is relative to the message set project in which the deployable WSDL file exists. When you select a WSDL file for the WSDL file name field, the WSDL is validated to ensure that it is WS-I compliant. The other properties on the Basic tab are automatically completed with values based on the WSDL definition. Only Deployable WSDL can be used to configure the SOAP nodes. After a valid WSDL file is selected, the message set project to which WSDL file belongs is added as a referenced project to the corresponding flow project, if the reference does not already exist. If the WSDL file is not valid, or an incorrect file name is entered, an error message is displayed in the Properties view and all WSDL properties are blank. The following situations lead to error conditions on this property: - The WSDL file does not come from a message set project, or the WSDL file was not imported correctly; see Importing from WSDL and Importing WSDL definitions from the command line. - The WSDL file contains no HTTP bindings. - The WSDL file contains no port type. - The WSDL file entered in the text box does not exist. – Port type. This property is mandatory and is of type String. This field lists all of the port types defined by the specified WSDL file. By default, the first port type found in the WSDL file that has an associated HTTP binding, is selected. Error Conditions: - Selected Port type does not contain at least one operation. – Imported binding. This property is mandatory and is of type String. The Imported binding box lists all of the SOAP bindings associated with the selected port type. Only HTTP transport is supported. Bindings are listed in the order that they are displayed in the WSDL file. By default, the first binding that implements the operation and has an associated service port, is selected. This property is updated every time the Port type value changes. Error Conditions: - No SOAP bindings (with HTTP transport) in the WSDL file are associated with the Port type. - Selected binding does not have any operations. – Binding operation. This property is mandatory and is of type String. The Binding operation box lists all of the operations defined by the selected binding. The first operation in the list is selected by default. This property is updated every time the selected binding value changes.
1092
Message Flows
– Service port. This property is mandatory and is of type String. The Service port box lists all of the service ports that point to the selected binding. The first service port for the binding is selected by default. This property is updated every time the selected binding value changes. Error Conditions: - No ports point to the selected binding. – Target namespace. This property type is String. Target namespace displays the namespace of the selected WSDL file. When you save the flow file, validation of some of the WSDL-related properties occur: v It is validated that the WSDL file exists in the message set. v It is validated that the selected Port type, Binding operation, and Service port are all valid within the content of the selected WSDL file. If any of these conditions are not met, an error is generated, and you will not be able to add a flow that contains this SOAPAsyncRequest node to the broker archive (bar) file. 3. On the HTTP Transport tab, you can set the HTTP transport related properties: v Web service URL. This property is mandatory and is of type String. This is automatically derived from the <soap:address> element of the selected Service port. Whenever the selected port is updated, the Web service URL is updated accordingly. However, if you override the value then your value persists and the URL is no longer updated from the service port. If you choose to override this property you must specify it in the form http://[:<port>]/[<path>] where: – http:// must be specified. – <port> has a default of 80. If you specify a value, you must include the : before the port number. – <path> has a default of /. If you specify a value, you must include the / before the path. For more details of how to override this property, see Changing the default URL for a SOAPRequest node or a SOAPAsyncRequest node request. v Request timeout (in seconds). This property type is Integer. This property has the value of the wait time for the remote server to respond with an acknowledgement that the message has been received. The time in seconds that the node waits for a response from the Web service. The valid range is 1 to (231)-1. You cannot enter a value that represents an unlimited wait. The default is 120. v HTTP(S) Proxy Location. This property type is String. In the HTTP(S) Proxy Location field, set the location of the proxy server to which requests are sent. This value must be in the form hostname:port. v SSL Protocol (if using SSL). This property type is Enumerate. Specify the SSL Protocol that you want to use to make the request. The following options are available: SSL
The default. This option attempts to connect using the SSLv3 protocol first, but the handshake can fall back to the SSLv2 protocol where the SSLv2 protocol is supported by the underlying JSSE provider.
SSLv3 This option attempts to connect with the SSLv3 protocol only. The handshake cannot fallback to SSLv2. TLS
This option attempts to connect with the TLS protocol only. The handshake cannot fallback to SSLv3 or SSLv2. Message flows
1093
Both ends of an SSL connection must use the same protocol. The protocol must be one that the remote server can accept. v Allowed SSL Ciphers (if using SSL). This property type is String. This setting enables you to specify a single cipher (such as SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA), or a list of ciphers that are the only ones used by the connection. This list of ciphers must include one or more that are accepted by the remote server. A comma (,) is used as a separator between the ciphers. The default value is an empty string, which allows the node to use any, or all, of the available ciphers during the SSL connection handshake. This method enables the greatest scope for making a successful SSL connection. 4. Use the Advanced tab to define your headers. SOAP headers that are part of the must understand headers list are incorporated into the flow rather than causing a SOAP fault. Adding headers to the must understand headers list stops SOAP faults being generated by SOAP headers. v The WSDL-defined SOAP headers table is read-only, and is populated based on the SOAP headers defined in the output part of the selected operations. By default, the check boxes, in the second column of the table, are cleared for all entries in the WSDL-defined SOAP headers table. You must select the relevant check box to add the header to the must understand headers list. v You can add custom headers (headers that are not defined in the WSDL file) in the User-defined SOAP headers table. Use Add, Edit, and Delete for this table. You must select the check box, in the second column of the table, to ensure that the newly added custom header is added to the must understand headers list. You do not need to add must understand headers for WS-Addressing and WS-Security as these are understood if you configure WS Extensions. The must understand headers list that is configured on this node is applied to the corresponding SOAPAsyncResponse node when the SOAPAsyncResponse node receives the reply from the remote server. 5. Use the WS Extensions tab to configure WS extensions. The tab features two configurations: v Use WS-Addressing. This property indicates that WS-Addressing is always engaged on the SOAPAsyncRequest node. v WS-Security. The WS-Security table features two columns: – Alias – XPath Expression You can add XPath expressions with an associated Alias value to the WS-Security table. The Alias is resolved in a Policy Set that is created by the administrator. The Policy Set resolves the Alias to either encrypt or sign the part of the message referred to by the XPath Expression. You can Add, Edit, and Delete in this table. For more details about WS-Addressing with the SOAPAsyncRequest node, see “WS-Addressing with the SOAPAsyncRequest and SOAPAsyncResponse nodes” on page 694. 6. Use the Request Parser Options tab to configure request parser options. The tab features a property that controls whether MTOM is enabled for the parser. Valid values are Yes, No, and Inherit. For more information about MTOM, see “SOAP MTOM” on page 737.
1094
Message Flows
LocalEnvironment overrides You can dynamically override set values in the LocalEnvironment in the same way as setting values in other elements of a message. You can be set the following properties under LocalEnvironment.Destination.SOAP.Request.Transport.HTTP. Setting
Description
WebServiceURL
Overrides the Web service URL property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.WebServiceURL = 'http://ibm.com/abc/';
RequestURI
Overrides the RequestURI, which is the path after the URL and port. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.RequestURI = '/abc/def?x=y&g=h';
Timeout
Overrides the Request timeout (in seconds) property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.Timeout = 42;
ProxyURL
Overrides the HTTP(S) proxy location property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.ProxyURL = 'my.proxy';
SSLProtocol
Overrides the SSLProtocol property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.SSLProtocol = 'TLS'; Valid values are: SSL, SSLv3, and TLS.
SSLCiphers
Overrides the Allowed SSL Ciphers (if using SSL) property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.SSLCiphers = 'SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA';
HTTPVersion
Overrides the HTTPVersion. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.HTTPVersion = 'HTTP/1.1';
Method
Overrides the Method. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.Method = 'GET';
ProxyConnectHeaders
Specifies additional headers that are used if the outbound request is an SSL connection through a proxy. These additional headers are sent with the initial CONNECT request to the proxy. For example, you can send proxy authentication information to a proxy server when you are using SSL. You can send multiple headers but each one must be separated by a carriage return and a line feed (ASCII 0x0D 0x0A), in accordance with RFC2616; for example: DECLARE CRLF CHAR CAST(X'0D0A' AS CHAR CCSID 1208); SET OutputLocalEnvironment.Destination.HTTP.ProxyConnectHeaders = 'Proxy-Authorization: Basic Zm5lcmJsZTpwYXNzd29yZA==' || CRLF || 'Proxy-Connection: Keep-Alive' || CRLF; This setting is used only if the request is an SSL request through a proxy server. To send proxy authentication information for a non-SSL request, specify the individual headers in the HTTPRequestHeader folder, as shown in the following example: SET OutputRoot.HTTPRequestHeader."Proxy-Authorization" = 'Basic Zm5lcmJsZTpwYXNzd29yZA=='; SET OutputRoot.HTTPRequestHeader."Proxy-Connection" = 'Keep-Alive';
Working with WrittenDestination data After the request has been made, the WrittenDestination folder in LocalEnvironment is updated with the WS-Addressing (if in use) and transport Message flows
1095
details. A WrittenDestination for a SOAPAsyncRequest node has the following format, with WS-Addressing present only if it is used: WrittenDestination = ( SOAP = ( Request = ( WSA = ( To = 'URI' MessageID = 'id' Action = 'doAllTheStuff' ) Transport = ( HTTP = ( WebServiceURL = 'http://server:8080/thing' ) ) ) ) )
Terminals and properties The SOAPAsyncRequest node terminals are described in the following table. ||
Terminal
Description
| |
In
The input terminal that accepts a SOAP request message for dispatch to the target by the node.
| | |
Failure
The output terminal to which the message is routed if a failure is detected when the SOAP request message is dispatched to the target (such as a message validation failure).
| | | | |
Out
The output terminal to which the message is routed if it has been successfully dispatched to the target, and if further processing is required within this message flow. The message that leaves the Out terminal is the same as the message that arrived at the In terminal.
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 SOAPAsyncRequest node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
The name of the node.
Short description
No
No
None
A brief description of the node.
Long description
No
No
None
Text that describes the purpose of the node in the message flow.
The SOAPAsyncRequest node Basic properties are described in the following table.
1096
Message Flows
Property
M
C
Unique identifier
Yes
No
Specify the unique URL fragment that is common to your pair of SOAPAsyncRequest and SOAPAsyncResponse nodes.
WSDL file name
Yes
No
This property type is String. When you select a WSDL file for the WSDL file name field, the WSDL is validated to ensure that it is WS-I compliant. Only Deployable WSDL can be used to configure the SOAP nodes. After a valid WSDL file is selected, the message set project to which WSDL file belongs is added as a referenced project to the corresponding flow project, if the reference does not already exist.
Port type
Yes
No
Imported binding
Yes
No
Default
By default, the first Port type found in the WSDL file, that has an associated HTTP binding with it, is selected.
Description
This property type is String. This field lists all of the port types defined by the specified WSDL file. By default, the first port type found in the WSDL file that has an associated HTTP binding, is selected. Error Conditions: v Selected Port type does not contain at least one operation.
This property type is String. The Imported binding box lists all of the SOAP bindings associated with the selected port type. Only HTTP transport is supported. Bindings are listed in the order that they are displayed in the WSDL file. By default, the first binding that implements the operation and has an associated service port, is selected. This property is updated every time the Port type value changes. Error Conditions: v No SOAP bindings (with HTTP transport) in the WSDL file are associated with the Port type. v Selected binding does not have any operations.
Binding operation
Yes
No
This property type is String. The Binding operation box contains all of the operations defined by the selected binding. The first operation in the list is selected by default.
Service port
Yes
No
This property type is String. The Service port box lists all of the service ports that point to the selected binding. The first service port for the binding is selected by default. This property is updated every time the selected binding value changes. Error Conditions: v No ports point to the selected binding.
Target namespace
No
No
This property type is String. Target namespace displays the namespace of the selected WSDL file.
The SOAPAsyncRequest node HTTP Transport properties are described in the following table.
Message flows
1097
Property
M
C
Web service URL
Yes
No
Default
Description This property type is String. This property is automatically derived from the <soap:address> element of the selected Service port. Whenever the selected port is updated, the Web service URL is updated accordingly. However, if you override the value then your value persists and the URL is no longer updated from the service port. If you choose to override this property you must specify it in the form http://[:<port>]/ [<path>] where: v http:// must be specified. v <port> has a default of 80. If you specify a value, you must include the : before the port number. v <path> has a default of /. If you specify a value, you must include the / before the path.
Request timeout (in seconds)
No
No
120
This property type is Integer. This property has the value of the wait time for the remote server to respond with an acknowledgement that the message has been received. The time in seconds that the node waits for a response from the Web service. The valid range is 1 to (231)-1. You cannot enter a value that represents an unlimited wait.
HTTP(S) proxy location No
No
SSL Protocol (if using SSL)
No
No
This property type is String. The proxy server to which requests are sent. This value must be in the form hostname:port. SSL
This property type is Enumerate. The SSL protocol to use when making an HTTPS request. Valid values are: v SSL v SSLv3 v TLS
Allowed SSL ciphers (if No using SSL)
No
Empty
This property type is String. A comma-separated list of ciphers to use when making an SSL request. The default value of an empty string means use all available ciphers.
The SOAPAsyncRequest node Advanced properties are described in the following table. Property
M
C
WSDL-defined SOAP headers
No
No
1098
Message Flows
Default
Description The WSDL-defined SOAP headers table is read-only, and is populated based on the SOAP headers defined in the output part of the selected operations. By default, the check boxes, in the second column of the table, are cleared for all entries in the WSDL-defined SOAP headers table. You must select the relevant check box to add the header to the ’must understand headers’ list.
Property
M
C
User-defined SOAP headers
No
No
Default
Description You can add custom headers (headers that are not defined in the WSDL file) in the User-defined SOAP headers table. Use Add, Edit, and Delete for this table. You must select the relevant check box, in the second column of the table, to ensure that the newly added custom header is added to the ’must understand headers’ list.
The SOAPAsyncRequest node WS Extensions properties are described in the following table. Property
M
C
Default
Description
Use WS-Addressing
No
No
Selected
You cannot edit this property. This property indicates that WS-Addressing is always engaged on the SOAPAsyncRequest node.
WS-Security
No
No
This table and features two columns: v Alias v XPath Expression You can add XPath expressions with an associated Alias value to the WS-Security table. The Alias is resolved in a Policy Set that is created by the administrator. The Policy Set resolves the Alias to either encrypt or sign the part of the message referred to by the XPath Expression. You can Add, Edit and Delete in this table.
The SOAPAsyncRequest node Request Parser Options property is described in the following table. Property
M
C
Default
Description
Allow MTOM
No
Yes
No
This property controls whether MTOM is enabled for the parser. Valid values are Yes, No, and Inherit. For more information about using SOAP MTOM with the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes, see “Using SOAP MTOM with the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes” on page 688.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SOAPAsyncResponse node Use the SOAPAsyncResponse node in conjunction with the SOAPAsyncRequest node to construct a pair of message flows that call a Web service asynchronously. Message flows
1099
This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties” on page 1101
Purpose The SOAPAsyncRequest node sends a Web service request, but the node does not wait for the associated Web service response to be received. However, the SOAPAsyncRequest node does wait for the HTTP 202 acknowledgment before continuing with the message flow, and the SOAPAsyncRequest node blocks if the acknowledgment is not received. The Web service response is received by the SOAPAsyncResponse node, which can be in a separate message flow. The nodes are used as a pair, and correlate responses against the original requests.
some message
Input
SOAP Async Request
WSDL
External Web service
some response
Output
SOAP Async Response
The SOAP parser invokes the XMLNSC parser to parse the XML content of the SOAP Web service, and to validate the XML body of the SOAP Web service. The SOAP parser options are passed through to the XMLNSC parser. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. The SOAPAsyncResponse node is contained in the Web Services drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Configuration of the SOAPAsyncResponse node is not WSDL-driven, although the ’must understand headers’ list configured on the corresponding SOAPAsyncRequest node is applicable to the SOAPAsyncResponse node.
1100
Message Flows
The following sample demonstrates how to use the asynchronous SOAP nodes when you call a Web service. The Web service simulates an order service, and the client shows how existing WebSphere MQ interfaces can be extended to make Web service requests. v Asynchronous Consumer sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the SOAPAsyncResponse node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 SOAPAsyncResponse node terminals are described in the following table. ||
Terminal
Description
| |
Failure
The output terminal to which an asynchronous SOAP response message is routed if a failure is detected when the message received is propagated to the Out flow (such as a message validation failure).
| | | |
Out
The output terminal to which the asynchronous SOAP response message is routed if it has been successfully received, and if further processing is required within this message flow. If no errors occur within the node, a valid none fault SOAP response message received from an external resource is always sent to the Out terminal first.
| |
Fault
The output terminal to which an asynchronous SOAP fault response is routed if it has been successfully received, and if further processing of the fault is required within this message flow.
| | |
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by this 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 SOAPAsyncResponse node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type: The name of the node. SOAPAsyncResponse
Short description
No
No
None
A brief description of the node.
Long description
No
No
None
Text that describes the purpose of the node in the message flow.
The SOAPAsyncResponse node Basic properties are described in the following table:
Message flows
1101
Property
M
C
Unique Yes identifier
Default Description
No
Specify the unique URL fragment that is common to your pair of SOAPAsyncRequest and SOAPAsyncResponse nodes.
The SOAPAsyncResponse node Advanced property is described in the following table. Property
M
C
Default Description
Set destination list
No
No
Selected This property indicates whether to add the incoming SOAP operation to the route to label destination list.
Label prefix
No
No
Use this property to add a prefix to the SOAP Operation name in the destination list. You must add a Label prefix if you want to use multiple SOAPAsyncResponse nodes in the same message flow without causing their corresponding Label nodes to clash. By default, the prefix is an empty string so that the operation name and the label name are identical. This property is not available if the Set destination list property is cleared.
Place No WS-Addressing headers into LocalEnvironment
No
Cleared This property specifies whether the node puts WS-Addressing headers from the response message into the LocalEnvironment tree. WS-Addressing headers are not accessible to the flow if this check box is cleared because by default, all headers are processed and removed.
The SOAPAsyncResponse node Instances properties are described in the following table. Property
M
C
Default
Description
Additional No instances pool
Yes
Use Pool Associated with Message Flow
The pool from which additional instances are obtained. v If you select Use Pool Associated with Message Flow, additional instances are obtained from the message flow value. v If you select Use Pool Associated with Node, additional instances are allocated from the node’s additional instances based on the number specified in the Additional instances property.
Additional No instances
Yes
0
The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node. By default, no additional instances are given to the node.
The SOAPAsyncResponse node Response Message Parsing properties are described in the following table. The SOAPAsyncResponse node sets these properties automatically; you cannot set them yourself. Property M
C
Default
Description
Message No domain
No
SOAP
The domain that is used to parse the response message. By default, the message that is propagated from the SOAPAsyncResponse node is in the SOAP domain. You cannot specify a different domain. For more information, see “SOAP parser and domain” on page 87.
1102
Message Flows
Property M
C
Default
Description
Message Yes set
No
Set automatically from the WSDL file name property that is provided by the SOAPAsyncRequest node.
The name of the message set in which the response message is defined. Message set is set automatically to the message set that contains the WSDL file that is configured on the corresponding SOAPAsyncRequest node. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message No type
No
The name of the response message. The node detects the message type automatically. You cannot set this property.
Message No format
No
The name of the physical format of the response message. You cannot set this property.
The SOAPAsyncResponse node Parser Options properties are described in the following table. The properties are passed through to the XMLNSC parser. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when a response message is parsed. Valid values are On Demand, Immediate, and Complete. By default, parse timing is set to On demand, which causes parsing of the input message to be delayed. For a full description of this property, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Selected
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema.
Retain mixed No content
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in a response message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an response message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in a response message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the response message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The SOAPAsyncResponse node Validation properties are described in the following table. By default, validation is enabled.
Message flows
1103
If a message is propagated to the failure terminal of the node, it is not validated. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
Content and value
This property controls whether validation takes place. Valid values are None, Content and value, and Content.
Failure action
No
Yes
Exception This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and value. Valid values are User trace, Exception list, Local error log, and Exception.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SOAPEnvelope node
|
Use the SOAPEnvelope node to add a SOAP envelope onto an existing message. This node is designed to be used with the SOAPExtract node. This topic contains the following sections: v “Purpose” v “Using the SOAPEnvelope node in a message flow” on page 1105 v “Configuring the SOAPEnvelope node” on page 1105 v Supported parsers v “Terminals and properties” on page 1105 v “Example SOAP messages” on page 1106
Purpose The default behavior of the SOAPEnvelope node is to attach the SOAP envelope from a standard location ($LocalEnvironment/SOAP/Envelope) in the LocalEnvironment tree; you can specify an explicit location by using an XPath expression. You can also use the node in a flow without a corresponding SOAPExtract node; the node has an option to create a default SOAP envelope. The SOAPEnvelope node is contained in the Web Services drawer of the palette, and is represented in the workbench by the following icon:
1104
Message Flows
Using the SOAPEnvelope node in a message flow This node is designed to be used in conjunction with the SOAPExtract node; see “SOAPExtract node” on page 1107.
Configuring the SOAPEnvelope node When you have put an instance of the SOAPEnvelope node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab: a. In Create new envelope, specify whether the node must create a SOAP envelope, or use an existing one. The default value is to use an existing one. b. In Existing Envelope Location, specify an XPath expression that represents the location from which the node will copy the SOAP envelope. By default the node copies the envelope from the LocalEnvironment ($LocalEnvironment/SOAP/Envelope).
Supported parsers This node is designed to work with SOAP messages. Use one of the following parsers: v SOAP v XMLNSC v MRM v XMLNS Other XML parsers are not supported because they do not support namespaces. An exception is thrown if a message is received which is not using the correct parser or does not conform to the basic structure of a SOAP message. Full validation is not done on the SOAP message, which just needs to contain a body element.
Terminals and properties The terminals of the SOAPEnvelope node are described in the following table: Terminal
Description
In
The input terminal that accepts a SOAP message for processing by the node.
Out
The output terminal that outputs the SOAP message that was constructed from the SOAP message body and a SOAP envelope.
Failure
The output terminal to which the message is routed if a failure is detected during processing.
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).
Message flows
1105
The Description properties of the SOAPEnvelope node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
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 Basic properties of the SOAPEnvelope node are described in the following table. Property
M
C
Default
Description
Create new envelope
No
No
Cleared
This property controls whether the node creates a SOAP envelope, or gets an existing one from the message tree. If you select the check box, the node creates a new envelope. If you clear the check box, the node copies the envelope from the value entered in the Existing Envelope Location property.
Existing Envelope Location
No
No
$LocalEnvironment/ SOAP/Envelope
An XPath expression that represents the location from which the node will copy the SOAP envelope. The following correlation names are available: $Root The root of the message tree. $Body The last child of the root of the message tree (equivalent to /). $LocalEnvironment The root of the LocalEnvironment tree. $Environment The root of the Global Environment tree.
Example SOAP messages Incoming SOAP envelope <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://ws3.st.mqsi.ibm.com/App/DocLiteral1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> header1
Incoming SOAP message body
1106
Message Flows
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> body1 body2 body3 body4
Outgoing SOAP message <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://ws3.st.mqsi.ibm.com/App/DocLiteral1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> header1 <soapenv:Body> body1 body2 body3 body4
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SOAPExtract node Use the SOAPExtract node to remove SOAP envelopes, allowing just the body of a SOAP message to be processed. It can also route a SOAP message based on its operation name. Both functions are optional; they are contained within one node because they are often used together. This topic contains the following sections: v “Purpose” v “Using the SOAPExtract node in a message flow” on page 1108 v “Configuring the SOAPExtract node” on page 1108 v “Supported parsers” on page 1109 v “Terminals and properties” on page 1109 v “Example SOAP messages” on page 1111
Purpose The SOAPExtract node can perform two functions: Message flows
1107
Extract function The default behavior is to detach the SOAP envelope to a standard location ($LocalEnvironment/SOAP/Envelope) in the LocalEnvironment tree. Alternatively, you can specify an explicit location using an XPath expression. Any existing SOAP envelope at the chosen location is replaced. Routing function The SOAP message is routed to a Label node within the message flow as identified by the SOAP operation within the message. The SOAP Operation is identified within the SOAP body tag. Ensure that the message parser options in the properties folder of the outgoing message are correctly set up to parse the message, by copying the message set and message format from the incoming message. The message type is derived from the SOAP envelope message body first child. Only a single child of the SOAP message body is supported. The SOAPExtract node is contained in the Web Services drawer of the palette, and is represented in the workbench by the following icon:
Using the SOAPExtract node in a message flow Look at the following sample to see how to use this node: v SOAP Nodes sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the SOAPExtract node When you have put an instance of the SOAPExtract node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab: a. Specify in Remove envelope whether the node must remove the soap envelope and place it in the location given in Envelope Destination, or leave it on the message. The default value is that the node removes the envelope. b. In Envelope Destination, enter an XPath expression that represents the destination to which the node will copy the envelope. By default, the node copies the envelope to the LocalEnvironment ($LocalEnvironment/SOAP/ Envelope). c. In Destination path mode, specify the behavior of the Envelope Destination property. v Create path: The node creates the tree if the path specifies a location that does not already exist. Only simple expressions of the form aaa/bbb/ccc in Envelope Destination are supported. The default.
1108
Message Flows
v XPath location of existing element: If you know that the destination element exists, you can use any valid XPath 1.0 expression in Envelope Destination. d. In Route to ’operation’ label, specify whether the node must route the message to the SOAP operation given in the message. The default setting is for the node to send the message to the Out terminal. e. In Label Prefix, enter the value to prefix to the label used for routing by the node. Entering a prefix allows for name spacing between subflows. By default, no value is prefixed to the label name used for routing the message.
Supported parsers This node is designed to work with SOAP messages. Use one of the following parsers: v SOAP v XMLNSC v MRM v XMLNS Other XML parsers are not supported because they do not support namespaces. An exception is thrown if a message is received which is not using the correct parser or does not conform to the basic structure of a SOAP message. Full validation is not done on the SOAP message, which just needs to contain a body element.
Terminals and properties The terminals of the SOAPExtract node are described in the following table: Terminal
Description
In
The input terminal that accepts a SOAP message for processing by the node.
Out
The output terminal that outputs the SOAP message body (without the envelope if the Remove envelope check box is selected on the node properties).
Failure
The output terminal to which the message is routed if a failure is detected during processing.
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 SOAPExtract node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
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.
Message flows
1109
The Basic properties of the SOAPExtract node are described in the following table. Property
M
C
Default
Description
Remove envelope
No
No
Selected
If you select the check box, the node removes the SOAP header from the message. For a SOAP tree, the node outputs to the Out terminal the first child of SOAP.body from the SOAP tree. It outputs to Envelope Destination the full SOAP tree minus the first child of SOAP.body. If you clear the check box, the node leaves the envelope on the message. In the case of a SOAP tree, the full tree is propagated to the Out terminal.
Envelope Destination
No
No
$LocalEnvironment/ SOAP/Envelope
An XPath expression that represents the destination to which the node will copy the SOAP envelope. The following correlation names are available: $Root The root of the message tree. $Body The last child of the root of the message tree (equivalent to /). $LocalEnvironment The root of the LocalEnvironment tree. $Environment The root of the Global Environment tree.
Destination path mode
No
No
Create path
This determines the behavior of the Envelope Destination property. Set this property: Create path The default. The tree is created if the path specifies a location that does not exist. Only simple expressions of the form aaa/bbb/ccc are supported. XPath location of existing element If you know that the destination element exists, you can enter any valid XPath 1.0 expression.
Route to ’operation’ label
No
No
Cleared
This property determines whether the node must route the message to the SOAP operation given in the message. If you select the check box, the message is routed to a Label node that matches the SOAP operation. An exception is thrown if no Label node matches. The name of the first child element of the SOAP body is used to determine the RouteToLabel name. For the ‘RPC literal’ and ‘wrapped doc literal’ WSDL types, this is the ‘operation’ name. For a SOAP tree, the first child of SOAP.Body supplies the operation name. If you clear the check box, the node sends the message to the Out terminal.
Label Prefix
1110
No
Message Flows
No
The value to prefix to the label that the node uses for routing. Entering a prefix allows for name spacing between subflows.
Example SOAP messages Incoming SOAP message <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://ws3.st.mqsi.ibm.com/App/DocLiteral1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> header1 <soapenv:Body> body1 body2 body3 body4
De-enveloped message The operation name is requestAvailability. Note that the namespacing is removed from the operation. body1 body2 body3 body4
Removed envelope <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://ws3.st.mqsi.ibm.com/App/DocLiteral1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> header1
|
The Monitoring properties of the node are described in the following table:
Message flows
1111
||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SOAPInput node
|
Use the SOAPInput node to process client SOAP messages, thereby enabling the broker to be a SOAP Web services provider. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Configuring the SOAPInput node” v “Terminals and properties” on page 1117
Purpose The SOAPInput node is typically used in conjunction with the SOAPReply node. The SOAPInput node is contained in the Web Services drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow The SOAPInput node can be used in any message flow that needs to accept SOAP messages. Look at the SOAP Nodes sample sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the SOAPInput node When you have put an instance of the SOAPInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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. 1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab. 2. On the Basic tab, you must configure the following WSDL Properties. Before configuring the WSDL file on this node you must have a message set with a Deployable WSDL resource. v WSDL file name. This property is mandatory and is of type String. If the node was created by dropping a WSDL file from a message set onto the
1112
Message Flows
Message Flow editor, this property is preset to the name of the WSDL file. If the name of the WSDL file is not preset, you can set this property in one of the following ways. – –
–
– –
If you have Deployable WSDL, you can select from the Deployable WSDL files by clicking Browse. If you have WSDL definitions, but no message set, you can create a message set: a. Click Browse to open the WSDL Selection window. b. Click Import/Create New to open the Import WSDL file wizard. c. Enter the message set name and message set project name. Click Next. d. Choose the relevant option: - If your WSDL file already exists in your workspace, select Use resources from the workspace, and select the WSDL file. - If your WSDL file is in the file system, select Use external resources. Select the WSDL file. Click Next. e. Select the WSDL bindings to import. Any warnings or errors are displayed in the wizard banner. f. Click Finish. A new message set project and message set are created with message definitions. The WSDL definitions are added to the Deployable WSDL folder. g. You can now select the WSDL file from the WSDL Selection window. Click OK. If you have a message set but no WSDL definition, generate a WSDL definition by following the instructions in Generating a WSDL definition from a message set. Drag a WSDL file from a message set onto the node. Type a file name that is relative to the message set project in which the deployable WSDL file exists.
When you select a WSDL file for the WSDL file name field, the WSDL is validated to ensure that it is WS-I compliant. The other properties on the Basic tab are completed automatically with values based on the WSDL definition. Only Deployable WSDL can be used to configure the SOAP nodes. After a valid WSDL file is selected, the message set project to which the WSDL file belongs is added as a referenced project to the corresponding flow project, if the reference does not already exist. If the WSDL file is not valid, or an incorrect file name is entered, an error message is displayed in the Properties view and all WSDL properties are blank. The following situations lead to error conditions on this property: – The WSDL file does not come from a message set project, or the WSDL file was not imported correctly; see Importing from WSDL and Importing WSDL definitions from the command line. – The WSDL file contains no HTTP bindings. – The WSDL file contains no port type. – The WSDL file specified in the field does not exist. v Port type. This property is mandatory and is of type String. This field lists all the port types defined by the specified WSDL file. By default, the first port type found in the WSDL file that has an associated HTTP binding is selected. Message flows
1113
Error Conditions: – Selected Port type does not contain at least one operation. v Imported binding. This property is mandatory and is of type String. The Imported binding property lists all the SOAP bindings associated with the selected port type. Only HTTP transport is supported. Bindings are listed in the order in which they are displayed in the WSDL file. By default, the first binding that implements the operation and has an associated service port is selected. This property is updated every time the Port type value changes. Error Conditions: – No SOAP bindings (with HTTP transport) in the WSDL file are associated with the Port type. – The selected binding does not have any operations. v Service port. This property is mandatory and is of type String. The Service port property lists all the service ports that point to the selected binding. By default, the first service port for the binding is selected. This property is updated every time the selected binding value changes. Error Conditions: – No ports point to the selected binding. v Target namespace. This property type is String. Target namespace displays the namespace of the selected WSDL file. When you save the flow file, validation of some of the WSDL-related properties occur to ensure that: v The WSDL file exists in the message set. v The selected Port type, Binding operation, and Service port are all valid in the content of the selected WSDL file. If any of these conditions are not met, an error is generated, and you cannot add a flow that contains this SOAPInput node to the broker archive (BAR) file. 3. On the HTTP Transport tab, set the following HTTP transport related properties. You can use the mqsichangeproperties command to change port ranges and keyStores using the BrokerRegistry component; see mqsichangeproperties command. v URL Selector. This property type is String. This property is set automatically from the <soap:address> element of the selected Service port. Whenever the selected port is updated, URL Selector is updated accordingly. However, if you override the value your value persists, and the URL is no longer updated from the service port. If you choose to override this property, you must specify the [<path>]. v Use HTTPS. This property type is Boolean and is configured automatically from the <soap:address> element of the selected Service port. If the address contains an HTTPS URL, the check box is selected; otherwise it is not selected. However, if you manually override this property value, it is no longer updated from the corresponding service port. v Maximum client wait time (sec). Enter the Maximum client wait timeout interval in seconds. The SOAPInput node is typically used in conjunction with the SOAPReply node. This property specifies the length of time that the TCP/IP listener that received the input message from the Web service client waits for a response from the SOAPReply node. If a response is received within this time, the listener propagates the response to the client. If a response is not received in this time, the listener sends a SOAP fault message to the client indicating that its timeout has expired.
1114
Message Flows
4. Use the Advanced tab to define your headers: v SOAP 1.1 actor (SOAP 1.2 role). This property type is String. Use this property to configure the SOAP actor (SOAP 1.1 protocol) or SOAP role (SOAP 1.2 protocol) as which the SOAPInput node acts. The default value is Ultimate Destination (Ultimate Receiver). (Ultimate Destination relates to SOAP 1.1 and Ultimate Receiver relates to SOAP 1.2). You can enter any predefined or user-defined value. Predefined roles are specified in the respective SOAP 1.1 or SOAP 1.2 specifications, and are used to process SOAP headers that are targeted at the specific role. Error Conditions: – If you select empty, an error occurs on flow validation. v Set destination list. This property type is Boolean. The property indicates whether to add the incoming SOAP operation to the route-to-label in the destination list. v Label prefix. This property is of type String and is a prefix to add to the operation name in the destination list. You must add a Label prefix to use multiple SOAPInput nodes in the same flow without their corresponding label nodes clashing. The default prefix is an empty string so that the operation name and the label name are identical, but the field displays the user instruction: <enter a prefix if required>. This property is not enabled if the setDestinationList property is not enabled. v SOAP headers that are part of the must understand headers list are incorporated into the flow rather than causing a SOAP fault. Adding headers to the must understand headers list stops SOAP faults being generated by SOAP headers. – The WSDL-defined headers table is read-only, and is populated based on the SOAP headers that are defined in the input part of all operations of the selected binding. By default, the check boxes in the second column of the table are cleared for all entries in the WSDL-defined table. You must select the check boxes for those headers that you want to add to the must understand headers list. – You can add custom headers (that is, headers that are not defined in the WSDL) in the User-defined SOAP headers table. You can use the Add, Edit, and Delete controls to manipulate rows in this table. You must ensure that the check box for the newly-added custom header (in the second column of the table) is selected so that the header is added to the must understand headers list. You do not need to add must understand headers for WS-Addressing and WS-Security because these elements are understood if you configure WS Extensions. 5. Use the WS Extensions tab to configure WS extensions. v Use WS-Addressing. This property indicates whether to engage WS-Addressing on the SOAPInput node. By default, this check box is selected. v Place WS-Addressing Headers into LocalEnvironment. This property specifies whether the node puts WS-Addressing headers that are received in the message into the LocalEnvironment tree. WS-Addressing headers are not accessible to the flow if this check box is cleared because, by default, all headers are processed and removed. v The WS-Security table features two columns: Message flows
1115
– Alias – XPath Expression You can add XPath expressions with an associated Alias value to the WS-Security table. The Alias is resolved in a policy set that is created by the administrator. The policy set resolves the Alias to either encrypt or sign the part of the message referred to by the XPath Expression. You can use the Add, Edit, and Delete controls in this table. 6. On the Input Message Parsing tab, the properties are set automatically when the WSDL file property is configured; you cannot set them manually. v Message domain. This value is always set to SOAP. For more information, see “SOAP parser and domain” on page 87. v Message set. This property is set automatically to the message set that contains the WSDL file when the WSDL is associated with the node. v Message type. This property is not used for this node. v Message format. This property is not used for this node. 7. On the Parser Options sub tab, set properties that are associated with the parser. v Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. v Soap Parser Options. Set values for the properties that determine how the SOAP parser operates. The SOAP parser options are passed through to the XMLNSC parser. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 8. On the Error Handling tab, set the properties that are associated with fault processing: v Send failures during inbound SOAP processing to failure terminal. This property type is Boolean. If this property is selected, in a situation during inbound SOAP processing that results in a SOAP fault, instead of immediately sending the SOAP fault back to the client, the fault is sent to the Failure terminal instead, to allow logging and recovery processing. In this situation, an exception list is sent to the Failure terminal with the inbound message as a BLOB. By default, this check box is cleared. 9. On the Validation tab, set the validation properties if you want the SOAP parser to validate the body of each input message against XML schema generated from the message set. By default, validation is enabled. The SOAP parser invokes the XMLNSC parser to validate the XML body of the SOAP Web service. If a message is propagated to the Failure terminal of the node, it is not validated. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. 10. Use the Instances tab to specify how additional threads are handled for the message flow. v The Additional instances pool property specifies whether additional instance threads are allocated from a thread pool for the whole message flow, or from a thread pool for use by that node only. By default, this property is set to Use Pool Associated with Message Flow. v The Additional instances property specifies the number of additional threads that the broker can use to service the message flow and has the default value 0. 11. Use the Retry tab to define how retry processing is carried out when a failure gets rolled back to the input node. v The Retry mechanism defines the format of the mechanism, and its type is Enumerate. Set the property to either Failure or Short and long retry.
1116
Message Flows
v The Retry threshold property defines the number of retries to correct the failure, and its type is Integer. v The Short retry interval property defines the time the client waits in seconds before attempting to correct the failure, and its type is Integer. v The Long retry interval property defines the time the client waits in seconds before attempting to correct the failure, and its type is Integer.
Terminals and properties The SOAPInput node terminals are described in the following table. ||
Terminal
Description
| |
Failure
The output terminal to which a SOAP message is routed if a failure is detected when the message received is propagated to the output flow (such as a message validation failure).
| | | |
Out
The output terminal to which the SOAP message is routed when it is received successfully and if further processing is required in this message flow. If no errors occur in the input node, a valid SOAP message that is received from an external resource is always sent to the Out terminal first.
| | |
Catch
The output terminal to which the message is routed if an exception is thrown downstream and is caught by this 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 SOAPInput node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type; SOAPInput
The name of the node.
Short description
No
No
None
A brief description of the node.
Long description
No
No
None
Text that describes the purpose of the node in the message flow.
The SOAPInput node Basic properties are described in the following table. Property
M
C
Default
Description
WSDL file name
Yes
No
None
When you select a WSDL file for the WSDL file name property, the WSDL is validated to ensure that it is WS-I compliant. Only Deployable WSDL can be used to configure the SOAP nodes. After a valid WSDL file is selected, the message set project to which the WSDL file belongs is added as a referenced project to the corresponding flow project, if the reference does not already exist. This property type is String.
Message flows
1117
Property
M
C
Default
Description
Port type
Yes
No
By default, the first Port type found in the WSDL file that has an associated HTTP binding with it is selected.
This property lists all the port types that are defined by the specified WSDL file. By default, the first port type found in the WSDL file that has an associated HTTP binding, is selected. This property type is String.
Imported binding
Yes
No
Error Conditions: v The selected Port type does not contain at least one operation. The Imported binding property lists all the SOAP bindings that are associated with the selected port type. Only HTTP transport is supported. Bindings are listed in the order in which they are displayed in the WSDL file. By default, the first binding that implements the operation, and has an associated service port, is selected. This property is updated every time the Port type value changes. This property type is String. Error Conditions: v No SOAP bindings (with HTTP transport) in the WSDL file are associated with the Port type. v The selected binding does not have any operations.
Service port
Yes
No
The Service port property lists all the service ports that point to the selected binding. By default, the first service port for the binding is selected. This property is updated every time the selected binding value changes. This property type is String. Error Conditions: v No ports point to the selected binding.
Target namespace
Yes
No
This property displays the namespace of the selected WSDL file. This property type is String.
The SOAPInput node HTTP Transport properties are described in the following table. Property
M
C
Default
Description
URL selector
Yes
Yes
None
This property is the HTTP path selector on which the node accepts inbound messages
Use HTTPS
No
Yes
Cleared
If the address contains an HTTPS URL, the check box is selected; otherwise it is cleared.
Maximum client wait time (sec)
Yes
Yes
180
The time that the client waits for a remote server to respond with a ″message received″ acknowledgment.
The SOAPInput node Advanced properties are described in the following table. Property
M
C
Default
Description
SOAP 1.1 actor (SOAP 1.2 role)
Yes
No
Ultimate Destination (Ultimate Receiver)
The SOAP role in which the receiver is acting.
1118
Message Flows
Property
M
C
Default
Description
Set destination list
No
No
Selected
This property specifies whether to add the method binding name to the route-to-label destination list. If you select this check box, the method binding name is added so that you can use a RouteToLabel node in the message flow after the SOAPInput node.
Label prefix
No
No
None
The prefix to add to the method name when routing to label. Add a label prefix to avoid a clash of corresponding label nodes when you include multiple input nodes in the same message flow. By default, no label prefix exists; therefore, the method name and label name are identical.
WSDL defined SOAP headers
No
No
User defined SOAP headers
No
Yes
This table is read-only and is populated by the SOAP headers that are defined in the output part of the selected operations. The table is updated automatically when the selected operation is updated. This property is generated in the CMF file. None
You can add custom headers in this table. Use the Add, Edit and Delete controls to manipulate rows in this table. This property is generated in the CMF file.
The SOAPInput node WS Extensions properties are described in the following table. Property
M
C
Default
Description
Use WS-Addressing
No
No
Cleared
This property specifies whether to use WS-Addressing.
Place WS-Addressing headers into LocalEnvironment
No
No
Cleared
This property specifies whether the node puts WS-Addressing headers received in the message into the LocalEnvironment tree. WS-Addressing headers are not accessible to the flow if this check box is cleared.
WS-Security
No
Yes
This complex property is in the form of a table and consists of two columns: v Alias v XPath Expression You can add XPath expressions with an associated Alias value to the WS-Security table. The Alias is resolved in a policy set that is created by the administrator. The policy set resolves the Alias to either encrypt or sign the part of the message that is referenced by the XPath Expression. You can use the Add, Edit and Delete controls in this table.
The SOAPInput node Input Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
SOAP
The domain that is used to parse the incoming message. By default, the message that is propagated from the SOAPInput node is in the SOAP domain. You cannot specify a different domain.
Message flows
1119
Property
M
C
Default
Description
Message set
Yes
No
Set automatically from the WSDL file name property.
The name of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the incoming message. You cannot set this property.
The SOAPInput node Parser Options properties are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On demand
This property controls when an input message is parsed. Valid values are On demand, Immediate, and Complete. For a full description of this property, see “Parsing on demand” on page 1389.
Build tree using XML Schema data types
No
No
Selected
This property controls whether the syntax elements in the message tree have data types taken from the XML Schema.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be parsed opaquely. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The SOAPInput node Error Handling property is described in the following table. Property
M
C
Default
Description
Send failures during inbound SOAP processing to failure terminal
No
Yes
Cleared
Select this check box to send any fault to the Failure terminal during inbound SOAP processing.
1120
Message Flows
The SOAPInput node Validation properties are described in the following table. See “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
Content and value
This property controls whether validation takes place. Valid values are None, Content and value, and Content.
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The SOAPInput node Instances properties are described in the following table. Property
M
C
Default
Description
Additional instances pool
No
Yes
Use Pool Associated with Message Flow
The pool from which additional instances are obtained. v If you select Use Pool Associated with Message Flow, additional instances are obtained from the message flow value. v If you select Use Pool Associated with Node, additional instances are allocated from the node’s additional instances based on the number specified in the Additional instances property.
Additional instances
No
Yes
0
The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node. By default, no additional instances are given to the node.
The SOAPInput node Retry properties are described in the following table.
|
Property
M
C
Default
Description
Retry mechanism
No
No
Failure
This property specifies how retry processing is handled when a failure is rolled back to the SOAPInput node. v If you select Failure, retry processing is not performed; therefore, you cannot set the remaining properties. v If you select Short and long retry, retry processing is performed first at the interval that is specified by the Short retry interval property, and if that is unsuccessful, it is then performed at the interval that is specified by the Long retry interval property.
Retry threshold
No
Yes
0
The maximum number of times that retry processing is performed for short retry.
Short retry interval
No
Yes
0
The interval between short retry attempts.
Long retry interval
No
Yes
0
The interval between long retry attempts.
The Monitoring properties of the node are described in the following table:
Message flows
1121
||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SOAPReply node
|
Use the SOAPReply node to send SOAP messages from the broker to the originating client in response to a message received by a SOAPInput node. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Working with WrittenDestination data” v “Terminals and properties” on page 1123
Purpose The SOAPReply node is contained in the Web Services drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow The SOAPReply node can be used in any message flow that needs to send SOAP messages from the broker to the originating client in response to a message received by a SOAPInput node. Look at the following sample to see how to use this node: v SOAP Nodes sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Working with WrittenDestination data After the reply has been made, the WrittenDestination folder in the LocalEnvironment is updated if WS-Addressing is in use, and with transport details if WS-Addressing is in non-anonymous mode. A WrittenDestination for a SOAPReply node has the following format: WrittenDestination = ( SOAP = ( Reply = ( WSA = ( To = 'URI' MessageID = 'id' Action = 'doAllTheStuff' ) ) ) )
1122
Message Flows
Terminals and properties When you have put an instance of the SOAPReply node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 SOAPReply node terminals 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 message is routed if a failure is detected when the message is propagated.
Out
The output terminal to which the message is routed if it has been propagated successfully, and if further processing is required within this message flow.
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 SOAPReply node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type: SOAPReply
The name of the node.
Short No description
No
None
A brief description of the node.
Long No description
No
None
Text that describes the purpose of the node in the message flow.
The SOAPReply node Validation properties are described in the following table. By default, validation is enabled. If a message is propagated to the Failure terminal of the node, it is not validated. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure action
No
No
User trace
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User trace, Local error log, Exception, and Exception list.
The SOAPReply node Parser Options property is described in the following table.
Message flows
1123
Property
M
C
Default
Description
Allow MTOM
No
Yes
No
This property controls whether MTOM is enabled for the parser. Valid values are Yes, No, and Inherit. For more information about using SOAP MTOM with the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes, see “Using SOAP MTOM with the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes” on page 688.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
SOAPRequest node
|
Use the SOAPRequest node to send a SOAP request to the remote Web service. The node is a synchronous request and response node and blocks after sending the request until the response is received. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Configuring the SOAPRequest node” v “Working with WrittenDestination data” on page 1128 v “LocalEnvironment overrides” on page 1129 v “Terminals and properties” on page 1130
Purpose The SOAPRequest node is contained in the Web Services drawer of the message flow node palette, and is represented in the workbench by the following icon:
Using this node in a message flow The SOAPRequest node can be used in any message flow that needs to call a Web service. Look at the following sample to see how to use this node: v SOAP Nodes sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the SOAPRequest node When you have put an instance of the SOAPRequest node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view.
1124
Message Flows
All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk. 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, you must configure the following WSDL Properties. Before configuring the WSDL file on this node you must have a message set with a Deployable WSDL resource. v WSDL file name. This property is mandatory and is of type String. If the node was created by dropping a WSDL file from a message set onto the message flow editor, this property will be preset to the name of the WSDL file. If the name of the WSDL file is not preset, you can set this property in one of the following ways. – If you have Deployable WSDL, you can select from the Deployable WSDL files by clicking Browse. – If you have WSDL definitions, but no message set, then you can create a message set: a. Click Browse to open the WSDL Selection window. b. Click Import/Create New to open the Import WSDL file wizard. c. Enter the message set name and message set project name. Click Next. d. Choose the relevant option: - If your WSDL file already exists in your workspace, select Use resources from the workspace, and select the WSDL file. - If your WSDL file is in the file system, select Use external resources. Select the WSDL file. Click Next. e. Select the WSDL bindings to import. Any warnings or errors are displayed in the wizard banner. f. Click Finish. Result: Creates a new message set project and message set, with message definitions. The WSDL definitions are added to the Deployable WSDL folder. g. You can now select the WSDL file from the WSDL Selection window. Click OK. – If you have a message set but no WSDL definition, you must generate a WSDL definition. See Generating a WSDL definition from a message set. – Drag a WSDL file from a message set onto the node. – Type in a file name that is relative to the message set project in which the deployable WSDL file exists. When you select a WSDL file for the WSDL file name field, the WSDL is validated to ensure that it is WS-I compliant. The other properties on the Basic tab are automatically completed with values based on the WSDL definition. Only Deployable WSDL can be used to configure the SOAP nodes. After a valid WSDL file is selected, the message set project to which WSDL file belongs is added as a referenced project to the corresponding flow project, if the reference does not already exist. If the WSDL file is not valid, or an incorrect file name is entered, an error message is displayed in the Properties view and all WSDL properties are blank. The following situations lead to error conditions on this property:
Message flows
1125
– The WSDL file does not come from a message set project, or the WSDL file was not imported correctly; see Importing from WSDL and Importing WSDL definitions from the command line. – The WSDL file contains no HTTP bindings. – The WSDL file contains no port type. – The WSDL file entered in the text box does not exist. v Port type. This property is mandatory and is of type String. This field lists all of the port types defined by the specified WSDL file. By default, the first port type found in the WSDL file that has an associated HTTP binding, is selected. Error Conditions: – Selected Port type does not contain at least one operation. v Imported binding. This property is mandatory and is of type String. The Imported binding box lists all of the SOAP bindings associated with the selected port type. Only HTTP transport is supported. Bindings are listed in the order that they are displayed in the WSDL file. By default, the first binding that implements the operation and has an associated service port, is selected. This property is updated every time the Port type value changes. Error Conditions: – No SOAP bindings (with HTTP transport) in the WSDL file are associated with the Port type. – Selected binding does not have any operations. v Binding operation. This property is mandatory and is of type String. The Binding operation box lists all of the operations defined by the selected binding. The first operation in the list is selected by default. This property is updated every time the selected binding value changes. v Service port. This property is mandatory and is of type String. The Service port box lists all of the service ports that point to the selected binding. The first service port for the binding is selected by default. This property is updated every time the selected binding value changes. Error Conditions: – No ports point to the selected binding. v Target namespace. This hidden property type is String. Target namespace is implemented as a read-only field. This property is updated with the Target namespace of the WSDL file when the WSDL file name is configured. 3. On the HTTP Transport tab, set the HTTP transport related properties: v Web service URL. This property is mandatory and is of type String. This is automatically derived from the <soap:address> element of the selected Service port. Whenever the selected port is updated, the Web service URL is updated accordingly. However, if you override the value then your value persists and the URL is no longer updated from the service port. If you choose to override this property you must specify it in the form http://[:<port>]/[<path>] where: – http:// must be specified. – <port> has a default of 80. If you specify a value, you must include the colon : before the port number. – <path> has a default of /. If you specify a value, you must include the / before the path. For more details of how to override this property, see Changing the default URL for a SOAPRequest node or a SOAPAsyncRequest node request.
1126
Message Flows
v Request timeout (in seconds). This property type is Integer. This is the wait time for a remote server to respond with a ’message received’ acknowledgement. v HTTP(S) proxy location. This property type is String. This is the location of the proxy server to which requests are sent. v Protocol (if using SSL) This property type is Enumerate. The following options are available: SSL
(the default). This option tries to connect using the SSLv3 protocol first, but allows the handshake to fall back to the SSLv2 protocol where the SSLv2 protocol is supported by the underlying JSSE provider.
SSLv3 This option tries to connect with the SSLv3 protocol only. Fallback to SSLv2 is not allowed. TLS
This option tries to connect with the TLS protocol only. Fallback to SSLv3 or SSLv2 is not allowed.
Note that both ends of an SSL connection must agree on the protocol to use, so the chosen protocol must be one that the remote server can accept. v Allowed SSL ciphers (if using SSL) This property type is String. This setting allows you to specify a single cipher (such as SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA) or a list of ciphers that are the only ones used by the connection. This set of ciphers must include one or more that are accepted by the remote server. A comma is used as a separator between the ciphers. The default value is an empty string, which allows the node to use any, or all, of the available ciphers during the SSL connection handshake. This method allows the greatest scope for making a successful SSL connection. 4. Use the Advanced tab to define your headers. SOAP headers that are part of the must understand headers list are incorporated into the flow rather than causing a SOAP fault. Adding headers to the must understand headers list stops SOAP faults being generated by SOAP headers. v The WSDL-defined SOAP headers table is read-only, and is populated based on the SOAP headers defined in the output part of the selected operations. By default, the check boxes, in the second column of the table, are cleared for all entries in the WSDL-defined SOAP headers table. You must select the relevant check box to add the header to the must understand headers list. v You can add custom headers (headers that are not defined in the WSDL file) in the User-defined SOAP headers table. Use Add, Edit, and Delete for this table. You must select the check box, in the second column of the table, to ensure that the newly added custom header is added to the must understand headers list. You do not need to add must understand headers for WS-Addressing and WS-Security as these are understood if you configure WS Extensions. 5. Use the WS Extensions tab to implement WS extensions. v Use WS-Addressing. This property indicates whether to engage WS-Addressing on the SOAPRequest node. v Place WS-Addressing Headers into LocalEnvironment. This property specifies whether the node puts WS-Addressing headers received in the response
Message flows
1127
message into the LocalEnvironment tree. WS-Addressing headers are not accessible to the flow if this check box is cleared because by default, all headers are processed and removed. v The WS-Security table features two columns: – Alias – XPath Expression You can add XPath expressions with an associated Alias value to the WS-Security table. The Alias is resolved in a Policy Set that is created by the administrator. The Policy Set resolves the Alias to either encrypt or sign the part of the message referred to by the XPath expression. You can Add, Edit, and Delete in this table. For more details about WS-Addressing with the SOAPRequest node, see “WS-Addressing with the SOAPRequest node” on page 693. 6. On the Response Message Parsing tab, the properties are automatically set when the WSDL file property is configured, you cannot set them yourself. v Message domain. This value is always set to SOAP. For more information, see “SOAP parser and domain” on page 87. v Message set. This property is automatically set to the message set that contains the WSDL file, when the WSDL is associated with the node. v Message type. This property is not used. v Message format. This property is not used. 7. On the Parser Options sub tab, set properties associated with the parser. The following properties are listed on this tab: v Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. v Soap Parser Options. Set values for the properties that determine how the SOAP parser operates. The SOAP parser options are passed through to the XMLNSC parser. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 8. On the Validation tab, set the validation properties if you want the SOAP parser to validate the body of each input message against XML Schema generated from the message set. By default, validation is enabled. The SOAP parser invokes the XMLNSC parser to validate the XML body of the SOAP Web service. If a message is propagated to the Failure terminal of the node, it is not validated. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385.
Working with WrittenDestination data After the request has been made, the WrittenDestination folder in the LocalEnvironment is updated with the WS-Addressing (if in use) and transport details. A WrittenDestination for a SOAPRequest node has the following format, with WS-Addressing present only if it is used: WrittenDestination = ( SOAP = ( Request = ( WSA = ( To = 'URI' MessageID = 'id' Action = 'doAllTheStuff' )
1128
Message Flows
Transport = ( HTTP = ( WebServiceURL = 'http://server:8080/thing' ) ) ) ) )
LocalEnvironment overrides You can dynamically override set values in LocalEnvironment in the same way as setting values in other elements of a message. You can set the following properties under LocalEnvironment.Destination.SOAP.Request.Transport.HTTP. Setting
Description
WebServiceURL
Overrides the Web service URL property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.WebServiceURL = 'http://ibm.com/abc/';
RequestURI
Overrides the RequestURI, which is the path after the URL and port. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.RequestURI = '/abc/def?x=y&g=h';
Timeout
Overrides the Request timeout (in seconds) property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.Timeout = 42;
ProxyURL
Overrides the HTTP(S) proxy location property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.ProxyURL = 'my.proxy';
SSLProtocol
Overrides the SSLProtocol property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.SSLProtocol = 'TLS'; Valid values are SSL, SSLv3, and TLS.
SSLCiphers
Overrides the Allowed SSL Ciphers (if using SSL) property on the node. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.SSLCiphers = 'SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA';
HTTPVersion
Overrides the HTTPVersion. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.HTTPVersion = 'HTTP/1.1';
Method
Overrides the Method. For example: SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.Method = 'GET';
Message flows
1129
Setting
Description
ProxyConnectHeaders Specifies additional headers that are used if the outbound request is an SSL connection through a proxy. These additional headers are sent with the initial CONNECT request to the proxy. For example, you can send proxy authentication information to a proxy server when you are using SSL. You can send multiple headers but each one must be separated by a carriage return and a line feed (ASCII 0x0D 0x0A), in accordance with RFC2616; for example: DECLARE CRLF CHAR CAST(X'0D0A' AS CHAR CCSID 1208); SET OutputLocalEnvironment.Destination.HTTP.ProxyConnectHeaders = 'Proxy-Authorization: Basic Zm5lcmJsZTpwYXNzd29yZA==' || CRLF || 'Proxy-Connection: Keep-Alive' || CRLF; This setting is used only if the request is an SSL request through a proxy server. To send proxy authentication information for a non-SSL request, specify the individual headers in the HTTPRequestHeader folder, as shown in the following example: SET OutputRoot.HTTPRequestHeader."Proxy-Authorization" = 'Basic Zm5lcmJsZTpwYXNzd29yZA=='; SET OutputRoot.HTTPRequestHeader."Proxy-Connection" = 'Keep-Alive';
Terminals and properties The SOAPRequest node terminals 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 a message is routed if a failure is detected when the message is propagated to the Out flow (such as a message validation failure). Failures routed to this terminal include those caused by the retry processing occurring before the retry propagates the message to the Out flow.
| | | | |
Out
The output terminal to which the message is routed if the SOAP request has been sent and responded to successfully, and if further processing is required within this message flow. If no errors occur within the SOAPRequest node and a none fault SOAP response is received from the external resource it is always sent to the Out terminal first.
| | | |
Fault
SOAP fault messages received in response to the sent request are directed to the Fault terminal. If no connection is provided to the Fault terminal no further processing will occur for a received fault within this message flow.
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 SOAPRequest node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
The name of the node.
Short description
No
No
None
A brief description of the node.
Long description
No
No
None
Text that describes the purpose of the node in the message flow.
The SOAPRequest node Basic properties are described in the following table.
1130
Message Flows
Property
M
C
Default
Description
WSDL file name
Yes
No
This property type is String. When you select a WSDL file for the WSDL file name field, the WSDL is validated to ensure that it is WS-I compliant. Only Deployable WSDL can be used to configure the SOAP nodes. After a valid WSDL file is selected, the message set project to which WSDL file belongs is added as a referenced project to the corresponding flow project, if the reference does not already exist.
Port type
Yes
No
By default, the first Port type found in the WSDL file, that has an associated HTTP binding with it, is selected.
This property type is String. The field lists all of the Port types defined in WSDL file selected in the WSDL file name property.
Imported binding
Yes
No
Error Conditions: v Selected Port type does not contain at least one operation.
This property type is String. This property is updated every time that the Port type value changes. The field lists all of the SOAP bindings with HTTP transport (6.1) associated with the selected Port type. Bindings are listed in the same order in which they appear in the WSDL file. The selected binding is the one that has both ports and operations. If there is no such binding, then binding with ports is selected. If no bindings have ports then the first binding in the list is selected. Error Conditions: v No SOAP bindings (with HTTP transport) in the WSDL file are associated with the Port type. v The selected binding does not have any operations.
Binding operation
Yes
No
This property type is String. The Binding operation box contains all of the operations defined by the selected binding. The first operation in the list is selected by default.
Service port
Yes
No
This property type is String. This field is updated every time that the selected binding is updated. This field lists all of the WSDL ports that point to the selected binding. The first port for the binding is the selected port by default. Error Conditions: v No ports point to the selected binding.
Target namespace
Yes
No
Target namespace is implemented as a read-only field. This hidden property type is String. It is updated with the Target namespace of the WSDL file when the WSDL file name is configured.
The SOAPRequest node HTTP Transport properties are described in the following table. Message flows
1131
Property
M
C
Default
Description
Web service URL
Yes
Yes
SOAP address of the selected port
The URL of the SOAP address selected.
Request timeout (in seconds)
No
Yes
180
The time the client waits for a for a remote server to respond with a ’message received’ acknowledgement.
HTTP(S) proxy location No
Yes
Blank
The location of the proxy server.
Protocol (if using SSL)
No
Yes
SSL
The selected protocol if you use SSL
Allowed SSL ciphers (if No using SSL)
Yes
None
The specific SSL cipher, or ciphers, you are using.
The SOAPRequest node Advanced properties are described in the following table. Property
M
C
WSDL-defined SOAP headers
No
No
User-defined SOAP headers
No
Yes
Default
Description This table is read-only, and is populated by the SOAP headers defined in the output part of the selected operations. The table is updated automatically when the selected operation is updated. This property is generated in the CMF file.
None
You can add custom headers in this table. You can Add, Edit and Delete in this table. This property is generated in the CMF file.
The SOAPRequest node WS Extensions properties are described in the following table. Property
M
C
Use WS-Addressing
No
No
Place WS-Addressing headers into LocalEnvironment
No
No
WS-Security
No
Yes
Default
Description This property specifies whether to use WS-Addressing.
Cleared
This property specifies whether the node puts WS-Addressing headers received in the response message into the LocalEnvironment tree. WS-Addressing headers are not accessible to the flow if this check box is cleared because by default, all headers are processed and removed. This complex property is in the form of a table and consists of two columns: v Alias v XPath Expression You can add XPath expressions with an associated Alias value to the WS-Security table. The Alias is resolved in a Policy Set that is created by the administrator. The Policy Set resolves the Alias to either encrypt or sign the part of the message referred to by the XPath Expression. You can Add, Edit and Delete in this table.
The SOAPRequest node Response Message Parsing properties are described in the following table.
1132
Message Flows
Property
M
C
Default
Description
Message domain
No
No
SOAP
The domain that is used to parse the response message. By default, the message that is propagated from the SOAPInput node is in the SOAP domain. You cannot specify a different domain.
Message set
Yes
No
Set automatically from the WSDL file name property.
The name of the message set in which the response message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the response message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the response message. You cannot set this property.
The SOAPRequest node Parser Options properties are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On demand
This property controls when a response message is parsed. Valid values are On demand, Immediate, and Complete. For a full description of this property, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Set
This property controls whether the syntax elements in the message tree has data types taken from the XML Schema.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in a response message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in a response message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in a response message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Message flows
1133
Property
M
C
Default
Description
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The SOAPRequest node Validation properties are described in the following table. Property
M
C
Default
Description
Validate
No
Yes
Content and This property controls whether validation takes place. value Valid values are None, Content and value, and Content.
Failure action
No
Yes
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and value. Valid values are User trace, Local error log, Exception, and Exception list.
The SOAPRequest node Request Parser Options property is described in the following table. Property
M
C
Default
Description
Allow MTOM
No
Yes
No
This property controls whether MTOM is enabled for the parser. Valid values are Yes, No, and Inherit. For more information about using SOAP MTOM with the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes, see “Using SOAP MTOM with the SOAPReply, SOAPRequest, and SOAPAsyncRequest nodes” on page 688.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TCPIPClientInput node
|
Use the TCPIPClientInput node to create a client connection to a raw TCPIP socket, and to receive data over that connection. This topic contains the following sections: v “Purpose” on page 1135 v “Using the TCPIPClientInput node in a message flow” on page 1137 v “Configuring the TCPIPClientInput node” on page 1137 v “Terminals and properties” on page 1141
1134
Message Flows
Purpose The TCPIPClientInput node opens connections to a remote server application that is listening on a TCPIP port. The connections are not made directly by the node but are obtained from a connection pool managed by the WebSphere Message Broker execution group. The execution group uses the default TCPIPClient configurable service to determine which attributes are used for the socket connection. However, if the configurable service is set on the node, the configurable service is used for all the properties, including the host and port number. The node requests a client connection that contains data ready for reading. Until such a connection is available, the node is paused, waiting for data (in a similar way to the MQInput node). Therefore, two criteria must be met before the node becomes available: v A client connection has been made v At least 1 byte of data is available to be processed By default (as set in the configurable service), no client connections are made by the input node. The node relies on the creation of client connections by output or request nodes. In this mode of operation, an input node is never started until an output or request node starts an interaction. You can change the mode on the configurable service to create a pool of client connections ready for processing. To use this function, minimumConnections must be set to a value larger than zero. The execution group then ensures that the specified number of connections are always available by creating them at the start, and continuing to create the connections until the minimum value is reached. This behavior is different from the TCPIPServerInput node, which does not attempt to make a minimum number of connections. For more information, see “TCPIPServerInput node” on page 1166. The client node also has a maximum value, which limits how many connections it can create. More connections than the minimum value can exist as a result of output nodes creating connections. When connections are available, the second criterion is met when there is at least 1 byte of data to be processed; otherwise, the connection closes. In either case, the connection is given to the node and the event is processed. The first record of data is detected in accordance with properties on the node and then sent to the Out terminal. If an error occurs, including a timeout waiting for data or the closure of a connection while waiting for the full record, the data is sent to the Failure terminal. If the connection closes and there is no data, a message is sent to the Close terminal. Although the message has no data, the local environment does have details of the connection that closed. For both data and close events, the following local environment is created: Table 29. Location in local environment Location in local environment
Description
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ Type
The client.
Message flows
1135
Table 29. Location in local environment (continued) Location in local environment
Description
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ Hostname
The host name used to make a connection.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ Port
The port number used to make a connection.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ OpenTimestamp
The time stamp when the connection was first opened.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ CloseTimestamp
The time stamp when the connection was closed (null if not yet closed).
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ SequenceNumber/InputRecord
The sequence number of the message received on this connection. The first record has a sequencing number of 1; the second record has a sequencing number of 2, and so on.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ SequenceNumber/OutputRecord
The sequence number of the message sent on this connection. The first record has a sequencing number of 1; the second record has a sequencing number of 2, and so on.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/Id
The ID of the socket being used. This ID is an internal identifier used by the message broker to uniquely identify a connection.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ ReplyId
The reply ID that has been stored on this connection. The value can be any text string.
When the node has constructed the record from the connection stream it releases the connection back to the connection pool for use by other nodes. Properties on the Advanced tab show how that connection can be used by other nodes in the future. By default, the Advanced properties mark the input stream on the TCPIP connection as being reserved, which means that no other input node can use it, until the message flow’s current use is finished. Alternatively, you can choose to reserve the connection until it is unreserved by another node, or not to reserve it at all and permit any other node (or thread in this node) to use the connection straight away. Similar options are available on the output stream but it is kept unreserved by default. Another node can access a reserved stream only if the ID of the connection is known. This behavior allows all the nodes in a message flow to access the same connection using the same ID while stopping any other flow acquiring the connection. The TCPIPClientInput node is contained in the TCPIP drawer of the palette, and is represented in the workbench by the following icon:
Message structure The TCPIPClientInput node handles messages in the following message domains: v MRM v XMLNSC v DataObject v XMLNS
1136
Message Flows
v v v v v
JMSMap JMSStream MIME BLOB XML (this domain is deprecated; use XMLNSC)
v IDOC (this domain is deprecated; use MRM)
Using the TCPIPClientInput node in a message flow Look at the following samples to see how to use the TCPIPClientInput node: v TCPIP Client Nodes sample v TCPIP Handshake sample. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the TCPIPClientInput node When you have put an instance of the TCPIPClientInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk. Configure the TCPIPClientInput node: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, set the properties that determine how the TCPIP connection is controlled. v Use the Connection details property to specify either the host name and port number to be used, or the name of a configurable service. This property is mandatory. The following formats are supported: – Configurable service name. This value is used to look up the port and host name in configurable services. For example, TCPIPProfile1. – :. This value is the host name followed by the port number (separated by a colon). For example, tcpip.server.com:1111. – . This value is the port number. In this case, the host name is assumed to be localhost. v Use the Timeout waiting for a data record (seconds) property to specify how long the node listens on a connection for more data after the first byte of data has arrived. You can specify any length of time in seconds. A value of -1 specifies that there is no time limit (wait forever). The default is 60 seconds. When the specified time has been exceeded, all available data is sent to the Failure terminal. 3. On the Advanced tab, set the properties that determine how the data stream is controlled. v Use the Close connection property to specify when and how to close the connection. – Select No to leave the connection open. This value is the default. – Select After timeout to close the connection when a timeout occurs.
Message flows
1137
– Select After data has been received to close the connection when the end of the record is found. – Select At end of flow to close the connection after the flow has been run. v Select Close input stream after a record has been received to close the input stream as soon as the data has been retrieved. When the connection input stream is reserved, no other node can use it without specifying the ID. This property is not selected by default. v Use the Input Stream Modification property to specify whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release the input stream at the end of the flow. These options are available only if you have not selected the Close input stream after a record has been received property. – Select Leave unchanged to leave the input stream as it was when it entered the node. This value is selected by default. – Select Reserve input stream (for use by future TCPIP input and receive nodes) to specify that this input stream can be used only by this node and by other receive nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve input stream (for use by future TCPIP input and receive nodes) then release at end of flow to specify that this input stream can be used only by this node and receive nodes that request it by specifying the correct connection ID. After the flow has been run, this input stream is returned to the pool and becomes available for use by any input or receive node. v Use the Output Stream Modification property to specify whether to release the output stream. – Select Leave unchanged to leave the output stream as it was when it entered the node. Thie value is selected by default. – Select Release output stream and reset ReplyID to specify that this output stream is returned to the pool and is available for use by any output node. The ReplyID is passed in the LocalEnvironment when leaving this node, but is reset for the next record on this connection. 4. On the Input Message Parsing tab, set values for the properties that the node uses to determine how to parse the incoming message. If the incoming message has an MQRFH2 header, you do not need to set values for the Input Message Parsing properties because the values are derived from the <mcd> folder in the MQRFH2 header; for example: <mcd><Msd>MRM<Set>DHM4UO906S001receiptmsg1 XML
If you set values, and those values differ from those in the MQRFH2 header, the values in the MQRFH2 header take precedence. v In Message domain, select the name of the parser that you are using from the list. The default is BLOB. You can choose from the following options: – MRM – XMLNSC – DataObject – XMLNS – JMSMap – JMSStream – MIME – BLOB – XML (this domain is deprecated; use XMLNSC)
1138
Message Flows
– IDOC (this domain is deprecated; use MRM) You can also specify a user-defined parser, if appropriate. v If you are using the MRM or IDOC parser, or the XMLNSC parser in validating mode, select the message set that you want to use. The list contains the message sets that are available when you select MRM, XMLNSC, or IDOC as the domain. v If you are using the MRM parser, select the correct message type from the list in Message type. This list is populated with available message types when you select the MRM parser. v If you are using the MRM or IDOC parser, select the correct message format from the list in Message format. This list is populated with available message formats when you select the MRM or IDOC parser. v Specify the message coded character set ID in Message coded character set ID. v Select the message encoding from the list in Message encoding or specify a numeric encoding value. The default is Broker System Determined. You can choose from the following options: – Little Endian, with IEEE Floating Point (546) – Big Endian, with IEEE Floating Point (273) – Big Endian, with S390 Floating Point (785) – Broker System Determined For more information about encoding, see “Converting data with message flows” on page 150. 5. On the Parser Options sub-tab: v Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. v If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 6. Use the Retry tab to define how retry processing is performed when a flow fails. You can set the following retry processing: v Retry mechanism determines the action that occurs if the flow fails. The following choices can be set: – Select Failure for the node to report a failure without any retry attempts. – Select Short retry for the node to retry before reporting a failure if the condition persists. The number of times that it retries is specified in Retry threshold. – Select Short retry and long retry for the node to retry, first using the value in Retry threshold as the number of attempts it should make. If the condition persists after the Retry threshold has been reached, the node uses the Long retry interval between attempts. v Specify the Retry threshold. The number of times the node retries the flow transaction if the Retry mechanism property is set to either Short retry or Short retry and long retry. v Specify the Short retry interval. The length of time, in seconds, to wait between short retry attempts. v Specify the Long retry interval. The length of time to wait between long retry attempts until a message is successful, the message flow is stopped, or the message flow is redeployed. The broker property
Message flows
1139
MinLongRetryInterval defines the minimum value that the Long retry interval can take. If the value is lower than the minimum, the broker value is used. 7.
Use the Records and Elements tab to specify how the data is interpreted as records: v Use the Record detection property to determine how the data is split into records, each of which generates a single message. Choose from the following options: – End of stream specifies that all of the data sent in the data stream is a single record. – Fixed Length specifies that each record is a fixed number of bytes in length. Each record must contain the number of bytes specified in the Length property, except possibly a shorter final record in the file. – Select Delimited if the records you are processing are separated, or terminated, by a DOS or UNIX line end or by a sequence of user-defined delimiter bytes. Specify the delimiter and delimiter type in the Delimiter and Delimiter type properties. – Select Parsed Record Sequence if the data contains a sequence of one or more records that are serially recognized by the parser that is specified in Message domain. The node propagates each recognized record as a separate message. If you select this Record detection option, the parser specified in Message domain must be either XMLNSC or MRM (either CWF or TDS physical format). v If you set Record detection to Fixed Length, use Length to specify the required length of the output record. This value must be between 1 byte and 100 MB. The default is 80 bytes. If you set Record detection to Connection closed, Fixed Length, or Delimited, a limit of 100 MB applies to the length of the records. If you set Record detection to Parsed Record Sequence, the TCPIPClientInput node does not determine or limit the length of a record. Nodes that are downstream in the message flow might try to determine the record length, or process a very long record. If you intend to process large records in this way, ensure that your broker has sufficient memory. You might need to apply flow techniques described in the Large Messaging sample to best use the available memory; see Large Messaging sample. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. v If you set Record detection to Delimited, use Delimiter to specify the delimiter to be used. Choose from: – DOS or UNIX Line End, which, on UNIX systems, specifies the line feed character (, X’0A’), and, on Windows systems, specifies a carriage return character followed by a line feed character (, X’0D0A’). The node treats both of these strings as delimiters, irrespective of the system on which the broker is running. If they are both displayed in the same record, the node recognizes both strings as delimiters. The node does not recognize X’15’, which, on z/OS systems, is the ’newline’ byte; specify a value of Custom Delimiter in this property and a value of 15 in the Custom delimiter property if your input file is coded using EBCDIC new lines, such as EBCDIC files from a z/OS system. – Custom Delimiter, which permits a sequence of bytes to be specified in Custom delimiter. v In Custom delimiter, specify the delimiter byte or bytes to be used when Custom delimiter is set in the Delimiter property. Specify this value as an
1140
Message Flows
even-numbered string of hexadecimal digits. The default is X’0A’ and the maximum length of the string is 16 bytes (represented by 32 hexadecimal digits). v If you specify Delimited in Record detection, use Delimiter type to specify the type of delimiter. Permitted values are: – Infix. If you select this value, each delimiter separates records. If the data ends with a delimiter, the (zero length) data following the final delimiter is still propagated, although it contains no data. – Postfix. If you specify this value, each delimiter terminates records. If the data ends with a delimiter, no empty record is propagated after the delimiter. If the data does not end with a delimiter, it is processed as if a delimiter follows the final bytes of the data. Postfix is the default value. v The TCPIPClientInput node considers each occurrence of the delimiter in the input as either separating (infix) or terminating (postfix) each record. If the data begins with a delimiter, the node treats the (zero length) contents preceding that delimiter as a record and propagates an empty record to the flow. The delimiter is never included in the propagated message. 8. Use the Validation tab to provide validation based on the message set for predefined messages. For more information about validation, see “Validating messages” on page 187. For information about how to complete this tab, see “Validation tab properties” on page 1386. 9. On the Transactions tab, set the transaction mode. Although TCPIP operations are non-transactional, the transaction mode on this input node determines whether the rest of the nodes in the flow are to be executed under point of consistency. Select Yes if you want the flow updates to be treated transactionally (if possible) or No if you do not. The default for this property is No. 10. Optional: On the Instances tab, set values for the properties that show the additional instances (threads) that are available for a node. For more details, see “Configurable message flow properties” on page 1398.
Terminals and properties The terminals of the TCPIPClientInput node are described in the following table. Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs. This value inclues failures caused by retry processing. Even if the Validation property is set, messages propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is successfully retrieved from an external resource. If no errors occur within the input node, a message received from an external resource is always sent to the Out terminal first.
Close
The output terminal to which the message is routed if the connection closes.
Catch
The output terminal to which the message is routed if an exception is issued downstream and caught by this node. Exceptions are caught only if this terminal is attached.
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 for deployment).
Message flows
1141
The Description properties of the TCPIPClientInput node are described in the following table. Property
M
C
Default
Description
Node name
No
No
TCPIPClientInput
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 Basic properties of the TCPIPClientInput node are described in the following table. Property
M
C
Connection details
Yes
Yes
Timeout waiting for a data record (seconds)
Yes
Yes
Default
Description A string containing either the host name and port number to be used, or the name of a configurable service.
60
Specifies how long the node listens on a connection for more data after the first byte of data has arrived. You can specify any length of time in seconds. A value of -1 specifies that there is no time limit (wait forever).
The Advanced properties of the TCPIPClientInput node are described in the following table. Property
M
C
Default
Description
Close connection
Yes
No
No
Controls when the connection is closed, or if it remains open. Valid options are: v No v After Timeout v After Data has been Received v At End of Flow
Close input stream Yes after a record has been received
No
Cleared
Specifies whether to close the input stream as soon as the data has been retrieved. When the connection input stream is reserved, no other node can use it without knowing the ID. This property is not selected by default.
Input Stream Modification
No
Leave unchanged
Specifies whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release it at the end of the flow. Valid options are:
No
v Leave unchanged v Reserve input stream (for use by future TCPIP nodes) v Reserve input stream (for use by future TCPIP nodes) then release at end of flow When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. If the input stream is released at the end of the flow, it is returned to the pool and becomes available for use by any input or receive node.
1142
Message Flows
Property
M
C
Default
Description
Output Stream Modification
No
No
Leave unchanged
Specifies whether this output stream is released and returned to the pool for use by any output node. Valid options are: v Leave unchanged v Release output stream and reset ReplyID If you select Release output stream and reset ReplyID, the ReplyID is passed in the LocalEnvironment when leaving this node, but is reset for the next record on this connection.
The Input Message Parsing properties of the TCPIPClientInput node are described in the following table. Property
M
C
Default
Description
Message domain
No
No
The domain that is used to parse the incoming message.
Message set
No
No
The name or identifier of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message Set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message.
Message format
No
No
The name of the physical format of the incoming message.
Message coded character set ID
Yes
No
Broker System Default
The ID of the coded character set used to interpret the data being read.
Message encoding
Yes
No
Broker System Determined
The encoding scheme for numbers and large characters used to interpret the data being read. Valid values are Broker System Determined or a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150.
The Parser Options properties of the TCPIPClientInput node are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are: v On Demand v Immediate v Complete For a full description of this property, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the syntax elements in the message tree have data types taken from the XML Schema.
Message flows
1143
Property
M
C
Default
Description
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing property, Message Domain, is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed by the XMLNSC parser.
The Records and Elements properties of the TCPIPClientInput node are described in the following table: Property
M
C
Default
Description
Record detection
Yes
No
End of Stream
The mechanism used to identify records in the input data. Valid options are: v End of Stream v Fixed Length v Delimited v Parsed Record Sequence
Length (bytes)
Yes
No
0
The length of each record, in bytes, when Fixed Length record detection is selected.
Delimiter
Yes
No
DOS or UNIX Line End
The type of delimiter bytes that separate, or end, each record when Delimited record detection is selected. Valid options are: v DOS or UNIX Line End v Custom Delimiter (Hexadecimal)
Custom delimiter (hexadecimal)
No
No
1144
Message Flows
The delimiter bytes, expressed in hexadecimal, when Delimited record detection and Custom Delimiter are selected. This property is mandatory only if the Delimiter property is set to Custom Delimiter (Hexadecimal).
Property
M
C
Default
Description
Delimiter type
Yes
No
Postfix
The location of the delimiter when Delimited record detection and Custom Delimiter (Hexadecimal) are selected. Valid options are: v Infix v Postfix This property is ignored unless the Delimiter property is set to Custom Delimiter (Hexadecimal).
The Retry properties of the TCPIPClientInput node are described in the following table: Property
M
C
Default
Description
Retry mechanism
Yes
No
Failure
How the node handles a flow failure. Valid options are: v Failure v Short Retry v Short and Long Retry
Retry threshold
Yes
Yes
0
The number of times to retry the flow transaction when Retry mechanism is Short retry.
Short retry interval
No
Yes
0
The interval, in seconds, between each retry if Retry threshold is not zero.
Long retry interval
No
Yes
300
The interval between retries if Retry mechanism is Short and long retry and the retry threshold has been exhausted.
The Validation properties of the TCPIPClientInput node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are v None v Content and Value v Content
Failure action
No
No
Exception
This property controls what happens if validation fails. Valid values are: v User Trace v Local Error Log v Exception v Exception List
The Transactions properties of the TCPIPClientInput node are described in the following table:
Message flows
1145
Property
M
C
Default
Description
Transaction mode
No
Yes
No
The transaction mode on this input node determines whether the rest of the nodes in the flow are executed under point of consistency. Valid options are: v No v Yes
The Instances properties of the TCPIPClientInput node are described in the following table. For a full description of these properties, see “Configurable message flow properties” on page 1398. Property
M
C
Default
Description
Additional instances pool
No
Yes
Use Pool Associated with Message Flow
The pool from which additional instances are obtained.
Additional instances
No
Yes
0
v If you select Use Pool Associated with Message Flow, additional instances are obtained from the message flow pool. v If you select Use Pool Associated with Node, additional instances are allocated from the node’s additional instances based on the number specified in the Additional instances property. The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TCPIPClientOutput node
|
Use the TCPIPClientOutput node to create a client connection to a raw TCPIP socket, and to send data over that connection to an external application. This topic contains the following sections: v “Purpose” v “Using the TCPIPClientOutput node in a message flow” on page 1148 v “Configuring the TCPIPClientOutput node” on page 1148 v “Terminals and properties” on page 1152
Purpose The TCPIPClientOutput node opens connections to a remote server application that is listening on a TCPIP port. The connections are not made directly by the node but are obtained from a connection pool managed by the WebSphere Message Broker execution group. The execution group uses the default TCPIPClient configurable service to determine which attributes are used for the socket
1146
Message Flows
connection. However, if the configurable service is set on the node, the configurable service is used for all the properties, including the host and port number. The TCPIPClient configurable service is used to create a pool of client connections ready for processing. To use this function, the minimumConnections property must be set to a value larger than zero. The execution group ensures that the specified number of connections are always available by creating them at the start, and continuing to create the connections until the minimum value is reached. The node requests a client connection, and, if no connections are available for sending data, the output node requests that the pool creates a new connection. If the maximumConnections property has not been exceeded, a new connection is created. When the connection has been established, the data is sent. If the data has not be sent successfully within the time limit specified by the node’s Timeout sending a data record property, an exception is thrown. Properties in the local environment can override the TCPIP connection used by the node: Table 30. Input local environment properties Location in local environment
Description
$LocalEnvironment/Destination/TCPIP/Output/ Hostname
The host name used to make a connection.
$LocalEnvironment/Destination/TCPIP/Output/Port
The port number used to make a connection.
$LocalEnvironment/Destination/TCPIP/Output/Id
The ID of the socket being used. This value is an internal identifier used by WebSphere Message Broker to uniquely identify a connection.
$LocalEnvironment/Destination/TCPIP/Output/ReplyId The Reply ID that has been stored on this connection. It can be any text string.
You can dynamically choose the connection details (host name and port number), and the connection used (ID), by using this property. You can also set the Reply ID on the connection. The Reply ID enables a string to be stored in the connection and to be seen in the local environment. You can use this connection to store Reply IDs from other TCPIP nodes or from other transports, such as WebSphere MQ The output of the node contains the same information as the input, plus any fields that were missing from the input are updated with details from the connection used. For example, if the Id property is not provided as input (because you want to create a new connection or reuse a pool connection), the output local environment contains the ID of the connection that is used. Table 31. Output local environment properties Location in local environment
Description
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/Hostname
The host name used to make a connection.
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/Port
The port number used to make a connection.
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/OpenTimestamp
The time stamp when the connection was first opened.
Message flows
1147
Table 31. Output local environment properties (continued) Location in local environment
Description
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/CloseTimestamp
The time stamp when the connection was closed (null if not yet closed).
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/SequenceNumber
The sequence number of the message received on this connection. The first record has a sequencing number of 1; the second record has a sequencing number of 2, and so on.
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/Id
The ID of the socket being used. This ID is an internal identifier used by message broker to uniquely identify a connection.
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/ReplyId
The Reply ID that has been stored on this connection. It can be any text string.
If the connection closes (or any other type of exception occurs) while using the TCPIP transport, an exception is thrown. This exception goes to the Failure terminal if it is connected, otherwise the exception returns back down the flow. The node also has a Close input terminal. If a message is sent to this terminal, the connection is closed using a combination of the details provided in the node and the local environment. The TCPIPClientOutput node is contained in the TCPIP drawer of the palette and is represented in the workbench by the following icon:
Using the TCPIPClientOutput node in a message flow The TCPIPClientOutput node can be used in any message flow that needs to send data to an external application. Look at the following samples to see how to use this node: v TCPIP Client Nodes sample v TCPIP Handshake sample. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the TCPIPClientOutput node When you have put an instance of the TCPIPClientOutput node into a message flow, you can configure it. 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 in that view. To configure the TCPIPClientOutput node: 1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab. 2. On the Basic tab, set the properties that determine how the TCPIP connection is controlled. v Use the Connection details property to specify either the host name and port number to be used, or the name of a configurable service. This property is mandatory. The following formats are supported:
1148
Message Flows
– Configurable service name. This value is used to look up the port and host name in configurable services. For example, TCPIPProfile1. – :. This value is the host name followed by the port number (separated by a colon). For example, tcpip.server.com:1111. – . This value is the port number. In this case, the host name is assumed to be localhost. v Use the Timeout sending a data record (seconds) property to specify how long the node waits when trying to send data. You can specify any length of time in seconds. When the specified time has been exceeded, all available data is sent to the Failure terminal. The default is 60 seconds. 3. On the Advanced tab, set the properties that determine how the data stream is controlled. v Use the Send to property to specify whether the data is to be sent to one connection or to all available connections: – Select One connection to send the message to only one connection, as specified by the node properties and message overrides. This value is the default. – Select All available connections to send the data to all available connections. v Use the Close connection property to specify when and how to close the connection. – Select No to leave the connection open. This value is the default. – Select After timeout to close the connection when a timeout occurs. – Select After data has been sent to close the connection when the end of the record has been sent. v Select Close output stream after a record has been sent to close the output stream as soon as the data has been sent. This property is not selected by default. v Use the Output Stream Modification property to specify whether to reserve or release the output stream. These options are available only if you have not selected the Close output stream after a record has been sent property. – Select Leave unchanged to leave the output stream as it was when it entered the node. This value is selected by default. – Select Release output stream to specify that this output stream is returned to the pool and is available for use by any output node. – Select Reserve output stream (for use by future TCPIP output nodes) to specify that this output stream can be used only by this node and by other output nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve output stream (for use by future TCPIP output nodes) then release after propagate to specify that this output stream can be used only by this node and output nodes that request it by specifying the correct connection ID. After the message has been propagated, this output stream is returned to the pool and becomes available for use by any output node. v Use the Input Stream Modification property to specify whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release it at the end of the flow. – Select Leave unchanged to leave the input stream as it was when it entered the node. This value is selected by default.
Message flows
1149
– Select Release input stream to specify that this input stream is returned to the pool and is available for use by any input or receive node. – Select Reserve input stream (for use by future TCPIP input and receive nodes) to specify that this input stream can be used only by this node and by other input or receive nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve input stream (for use by future TCPIP input and receive nodes) then release after propagate to specify that this input stream can be used only by this node and receive nodes that request it by specifying the correct connection ID. After the message has been propagated, this input stream is returned to the pool and becomes available for use by any input or receive node. 4. On the Request tab, specify the location of the data to be written. You can specify the properties on this tab as XPath or ESQL expressions. Content Assist is available in the properties pane and also in the XPath Expression Builder, which you can invoke by clicking Edit to the right of each property. a. In Data location, specify the input data location. This value is the location in the input message tree that contains the record to be written. The default value is $Body, which is the entire message body ($InputRoot.Body). When you are specifying this property, and the data in the message tree that it identifies is owned by a model-driven parser, such as the MRM parser or XMLNSC parser, be aware of the following considerations: v If you are using MRM CWF format, ensure that the identified message tree exists as a message definition. If this value is defined as a global element only, exceptions BIP5180 and BIP5167 are generated. v If you are using MRM TDS format, the serialization of the identified message is successful if the element is defined as a global element or message. However, if the identified field is not found as a global element or message, note that: – If this value is a leaf field in the message tree, the field is written as self-defining. No validation occurs even if validation is enabled. – If this value is a complex element, an internal exception is generated, BIP5522, indicating that the logical type cannot be converted to a string. v If you are using MRM XML, the events are similar as for the MRM TDS format except that, if the field is a complex element, it is written as self-defining. v If you use the XMLNSC parser, no validation occurs even if validation is enabled. b. In Hostname location, specify the location of the value to override the Hostname set in the Connection details property of the Basic tab. If you do not specify a location, the default value is $LocalEnvironment/Destination/ TCPIP/Output/Hostname. c. In Port location, specify the location of the value to override the Port number set in the Connection details property of the Basic tab. If you do not specify a location, the default value is $LocalEnvironment/Destination/ TCPIP/Output/Port. d. In ID location, specify the location of the Id of the socket being used. This internal identifier is used by WebSphere Message Broker to uniquely identify a connection. If you do not specify a location, the default value is $LocalEnvironment/Destination/TCPIP/Output/Id.
1150
Message Flows
e. In Reply ID location, specify the location of the Reply ID that is stored on the connection being used. The Reply ID can be used when data is returned in an input node. If you do not specify a location, the default value is $LocalEnvironment/Destination/TCPIP/Output/ReplyId. 5. Use the Records and Elements tab to specify how the TCPIPClientOutput node writes the record derived from the message. v In Record definition, choose from: – Record is Unmodified Data to specify that records are left unchanged. This value is the default. – Record is Fixed Length Data to specify that records are padded to a given length if necessary. You specify this length in the Length property. If the record is longer than the value specified in Length, the node generates an exception. Use the Padding byte (hexadecimal) property to specify the byte to be used for padding the message to the required length. – Record is Delimited Data to specify that records are separated by a delimiter and accumulated by concatenation. The delimiter is specified by the Delimiter, Custom delimiter, and Delimiter type properties. The file is finished only when a message is received on the Finish File terminal. v In Length (bytes), specify the length (in bytes) of records when Record is Fixed Length Data is specified in Record definition. Records longer than this value cause an exception to be issued. This value must be between 1 byte and 100 MB. The default is 80 bytes. v When Record is Fixed Length Data is specified in Record definition, use Padding byte (hexadecimal) to specify the byte to be used when padding records to the specified length if they are shorter than this length. Specify this value as 2 hexadecimal digits. The default value is X’20’. v In Delimiter, specify the delimiter to be used if you specify Record is Delimited Data in Record definition. Choose from: – Broker System Line End to specify that a line end sequence of bytes is used as the appropriate delimiter for the file system on which the broker is to run. This value is the default. For example, on Windows systems, this value is a ’carriage-return, line-feed’ pair (X’0D0A’); on UNIX systems, this value is a single ’line-feed’ byte (X’0A’); on z/OS systems, this value is a ’newline’ byte (X’15’). – Custom Delimiter (hexadecimal) to specify that the explicit delimiter sequence defined in the Custom delimiter property is to be used to delimit records. v In Custom delimiter (hexadecimal), specify the delimiter sequence of bytes to be used to delimit records when Custom Delimiter is specified in the Delimiter property. Specify this value as an even-numbered string of hexadecimal digits. The default is X’0A’ and the maximum length of the string is 16 bytes. v If you specify Record is Delimited Data in Record definition, use Delimiter type to specify how the delimiter is to separate records. Choose from: – Postfix to specify that the delimiter is added after each record that is written. This value is the default. – Infix to specify that the delimiter is only inserted between any two adjacent records. 6. On the Validation tab, specify the parser validation properties of the node. For more information about validation, see “Validating messages” on page 187. For information about how to complete this tab, see “Validation tab properties” on page 1386. Message flows
1151
Terminals and properties The TCPIPClientOutput node terminals are described in the following table. Terminal
Type
Description
In
Input data
The input terminal that accepts a message for processing by the node.
Close
Input control
The input terminal to which a message is routed when the connection given in the local environment is closed.
Out
Output data
The output terminal to which the message is routed if it is successfully sent to an external resource. The message received on the In terminal is propagated to the Out terminal and is left unchanged except for the addition of status information.
Close
Output control
The output terminal to which a message propagated from the Close input terminal is routed.
Failure
Output data
The output terminal to which the message is routed if a failure is detected in 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 Description properties of the TCPIPClientOutput node are described in the following table: Property
M
C
Default
Description
Node name
No
No
TCPIPClientOutput
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 Basic properties of the TCPIPClientOutput node are described in the following table: Property
M
C
Connection details
Yes
Yes
Timeout sending a data Yes record (seconds)
Yes
Default
Description A string containing either the host name and port number to be used, or the name of a configurable service.
60
Specifies how long the node waits when trying to send data. You can specify any length of time in seconds.
The Advanced properties of the TCPIPClientOutput node are described in the following table.
1152
Message Flows
Property
M
C
Default
Description
Close connection
Yes
No
No
Controls when the connection is closed, or if it remains open. Valid options are: v No v After Timeout v After Data has been Sent
Close output stream Yes after a record has been sent
No
Cleared
Specifies whether to close the output stream as soon as the data has been sent. This property is not selected by default.
Output Stream Modification
No
Leave unchanged
Specifies whether to reserve this output stream or release it and return it to the pool for use by any output node. Valid options are:
No
v Leave unchanged v Release output stream v Reserve output stream (for use by future TCPIP nodes) v Reserve output stream (for use by future TCPIP nodes) then release at end of flow Input Stream Modification
No
No
Leave unchanged
Specifies whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release it at the end of the flow. Valid options are: v Leave unchanged v Release input stream v Reserve input stream (for use by future TCPIP nodes) v Reserve input stream (for use by future TCPIP nodes) then release at end of flow When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. If the input stream is released after the message has been propagated, it is returned to the pool and becomes available for use by any input or receive node.
Send to:
Yes
No
One Connection
Specifies whether the data is to be sent to one connection or to available connections. Valid options are: v One Connection v All Available Connections
The Request properties of the TCPIPClientOutput node are described in the following table: Property
M
C
Default
Description
Data location
Yes
No
$Body
The location in the input message tree containing the record to be written.
Hostname location
Yes
No
$LocalEnvironment/Destination/TCPIP/Output/ Hostname
The message element location containing the host name.
Message flows
1153
Property
M
C
Default
Description
Port location
Yes
No
$LocalEnvironment/Destination/TCPIP/Output/ Port
The message element location containing the port.
ID location
Yes
No
$LocalEnvironment/Destination/TCPIP/ Output/Id
The message element location containing the ID.
Reply ID location
Yes
No
$LocalEnvironment/Destination/TCPIP/Output/ ReplyId
The message element location containing the reply ID.
The Records and Elements properties of the TCPIPClientOutput node are described in the following table: Property
M
C
Default
Description
Record definition
Yes
No
Record is Unmodified Data
This property controls how the records derived from the message are written. Valid options are: v Record is Unmodified Data v Record is Fixed Length Data v Record is Delimited Data
Length (bytes)
Yes
No
0
The required length of the output record. This property applies only when Record is Fixed Length Data is specified in Record definition.
Padding byte (hexadecimal)
Yes
No
20
The 2-digit hexadecimal byte to be used to pad short messages when Record is Fixed Length Data is specified in Record definition.
Delimiter
Yes
No
Broker System Line End
The delimiter to be used when Record is Delimited Data is specified in Record definition. Valid options are: v Broker System Line End v Custom Delimiter (Hexadecimal)
Custom delimiter (hexadecimal)
No
No
None
The delimiter byte sequence to be used when Record is Delimited Data is specified in the Record definition property and Custom Delimiter (Hexadecimal) is specified in the Delimiter property.
Delimiter type
Yes
No
Postfix
This property specifies the way in which the delimiters are to be inserted between records when Record is Delimited Data is specified in Record definition. Valid options are: v Infix v Postfix
The Validation properties of the TCPIPClientOutput node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385.
1154
Message Flows
Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are: v None v Content and Value v Content v Inherit
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are: v User Trace v Local Error Log v Exception v Exception List
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TCPIPClientReceive node Use the TCPIPClientReceive node to receive data over a client TCPIP connection. This topic contains the following sections: v “Purpose” v “Using the TCPIPClientReceive node in a message flow” on page 1157 v “Configuring the TCPIPClientReceive node” on page 1157 v “Terminals and properties” on page 1161
Purpose The TCPIPClientReceive node waits for data to be received on a TCPIP connection, and retrieves the data. If the connection is closed, an exception is thrown. When a connection is established, the data is sent to the TCPIPClientReceive node. If the TCPIPClientReceive node fails to receive all of the data within the time specified in the Timeout waiting for a data record property, the message is sent to the Timeout terminal; if no Timeout terminal is connected, an exception is thrown. Properties in the local environment can override the TCPIP connection used by the node. Table 32. Input local environment properties Location in local environment for input to node
Description
$LocalEnvironment//TCPIP/Receive/Hostname
The host name used to make a connection.
$LocalEnvironment//TCPIP/Receive/Port
The port number used to make a connection.
Message flows
1155
Table 32. Input local environment properties (continued) Location in local environment for input to node
Description
$LocalEnvironment/TCPIP/Receive/Id
The ID of the socket being used. This ID is an internal identifier used by WebSphere Message Broker to uniquely identify a connection.
$LocalEnvironment/TCPIP/Receive/ReplyId
The Reply ID to be stored on this connection. This ID can then be used when data is returned on an input node. The Reply ID can be any text string.
These properties enable the connection details (host name and port number) and the connection used (ID) to be chosen dynamically. You can also set the Reply ID on the connection, which enables a string to be stored in the connection and to be seen in the local environment of any data that is received back from this connection. You can use this connection to store Reply IDs from other TCPIP nodes or from other transports, such as WebSphere MQ. When a record has been retrieved, the ConnectionDetails field in the local environment is populated with the details of the connection that is being used. Table 33. Output local environment properties Location in local environment for output from node
Description
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ Type
The Client.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ Hostname
The host name used to make a connection.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ Port
The port number used to make a connection.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ OpenTimestamp
The time stamp when the connection was first opened.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ CloseTimestamp
The time stamp when the connection was closed (null if not yet closed).
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ SequenceNumber/InputRecord
The sequence number of the message that is received on this connection. The first record has a sequencing number of 1; the second record is 2; and so on.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ SequenceNumber/OutputRecord
The sequence number of the message sent on this connection. The first record has a sequencing number of 1; the second record is 2; and so on.
$LocalEnvironment/TCPIP/Receive/ ConnectionDetails/Id
The ID of the socket being used. This ID is an internal identifier used by WebSphere Message Broker to uniquely identify a connection.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ ReplyId
The Reply ID that is stored on this connection. This ID can be any text string.
The TCPIPClientReceive node is contained in the TCPIP drawer of the palette, and is represented in the workbench by the following icon:
1156
Message Flows
Message structure The TCPIPClientReceive node handles messages in the following message domains: v MRM v XMLNSC v DataObject v XMLNS v JMSMap v v v v v
JMSStream MIME BLOB XML (this domain is deprecated; use XMLNSC) IDOC (this domain is deprecated; use MRM)
Using the TCPIPClientReceive node in a message flow Look at the following samples to see how to use the TCPIPClientReceive node: v TCPIP Client Nodes sample v TCPIP Handshake sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the TCPIPClientReceive node When you have put an instance of the TCPIPClientReceive node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk. Configure the TCPIPClientReceive node: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, set the properties that determine how the TCPIP connection is controlled. v Use the Connection details property to specify either the host name and port number to be used, or the name of a configurable service. This property is mandatory. The following formats are supported: – Configurable service name. This value is used to look up the port and host name in configurable services. For example, TCPIPProfile1. – :. This value is the host name followed by the port number (separated by a colon); for example, tcpip.server.com:1111 – . This value is the port number. In this case, the host name is assumed to be localhost. v Use the Timeout waiting for a data record (seconds) property to specify how long the node listens on a connection for more data after the first byte of data has arrived. You can specify any length of time in seconds. A value of -1
Message flows
1157
specifies that there is no time limit (wait forever). The default is 60 seconds. When the specified time has been exceeded, all available data is sent to the Failure terminal. 3. On the Advanced tab, set the properties that determine how the data stream is controlled. v Use the Close connection property to specify when and how to close the connection. – Select No to leave the connection open. This value is the default. – Select After timeout to close the connection when a timeout occurs. – Select After data has been received to close the connection when the end of the record is found. v Select Close input stream after a record has been received to close the input stream as soon as the data has been retrieved. By default this property is not selected. When the connection input stream is reserved, no other node can use it without knowing the ID. v Use the Input Stream Modification property to specify whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release the input stream at the end of the flow. – Select Leave unchanged to leave the input stream as it was when it entered the node. This value is selected by default. – Select Release input stream to specify that this input stream is returned to the pool and is available for use by any input or receive node. – Select Reserve input stream (for use by future TCPIP input and receive nodes) to specify that this input stream can be used only by this node and by other input or receive nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve input stream (for use by future TCPIP input and receive nodes) then release after propagate to specify that this input stream can be used only by this node and receive nodes that request it by specifying the correct connection ID. After the message has been propagated, this input stream is returned to the pool and becomes available for use by any input or receive node. v Use the Output Stream Modification property to specify whether to reserve or release the output stream. These options are available only if you have not selected the Close output stream after a record has been sent property. – Select Leave unchanged to leave the output stream as it was when it entered the node. This value is selected by default. – Select Release output stream to specify that this output stream is returned to the pool and is available for use by any output node. – Select Reserve output stream (for use by future TCPIP output nodes) to specify that this output stream can be used only by this node and by other output nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve output stream (for use by future TCPIP output nodes) then release after propagate to specify that this output stream can be used only by this node and output nodes that request it by specifying the correct connection ID. After the message has been propagated, this output stream is returned to the pool and becomes available for use by any output node. 4. On the Request tab, specify the location of the data to be written. You can specify the properties on this tab as XPath or ESQL expressions. Content Assist
1158
Message Flows
is available in the Properties view and also in the XPath Expression Builder, which you can run by clicking Edit to the right of each property. v In Hostname location, specify the location of the value to override the Hostname that is set in the Connection details property of the Basic tab. If you do not specify a location, the default value is $LocalEnvironment/ TCPIP/Receive/Hostname. v In Port location, specify the location of the value to override the Port that is set in the Connection details property of the Basic tab. If you do not specify a location, the default value is $LocalEnvironment/TCPIP/Receive/Port. v In ID location, specify the location of the Id of the socket being used. This internal identifier is used by WebSphere Message Broker to uniquely identify a connection. If you do not specify a location, the default value is $LocalEnvironment/TCPIP/Receive/Id. v In Reply ID location, specify the location of the Reply ID that is stored on the connection that is being used. The Reply ID can be used when data is returned in an input node. If you do not specify a location, the default value is $LocalEnvironment/TCPIP/Receive/ReplyId. 5. On the Result tab, set values for the properties that determine where the reply is stored. v Use the Output data location property to specify the start location in the output message tree where the parsed elements from the bit string of the message are stored. The default value is $OutputRoot. v Use the Copy local environment property to specify whether the local environment is copied to the output message. – If Copy local environment is selected, a new copy of the local environment is created in the tree, and it is populated with the contents of the local environment from the preceding node. Therefore, if a node changes the local environment, the upstream nodes are not affected by those changes because they have their own copies. This value is the default. – If Copy local environment is not selected, the node does not generate its own copy of the local environment, but uses the local environment that is passed to it by the preceding node. Therefore, if a node changes the local environment, the changes are reflected by the upstream nodes. 6. On the Input Message Parsing tab, set values for the properties that the node uses to determine how to parse the incoming message. If the incoming message has an MQRFH2 header, you do not need to set values for the Input Message Parsing properties because the values are derived from the <mcd> folder in the MQRFH2 header; for example: <mcd><Msd>MRM<Set>DHM4UO906S001receiptmsg1 XML
If you set values, and those values differ from those in the MQRFH2 header, the values in the MQRFH2 header take precedence. v In Message domain, select the name of the parser that you are using from the list. The default is BLOB. You can choose from the following options: – MRM – XMLNSC – DataObject – XMLNS – JMSMap – JMSStream – MIME – BLOB Message flows
1159
– XML (this domain is deprecated; use XMLNSC) – IDOC (this domain is deprecated; use MRM) You can also specify a user-defined parser, if appropriate. v If you are using the MRM or IDOC parser, or the XMLNSC parser in validating mode, select the Message set that you want to use. The list contains the message sets that are available when you select MRM, XMLNSC, or IDOC as the domain. v If you are using the MRM parser, select the correct message type from the list in Message type. This list is populated with available message types when you select the MRM parser. v If you are using the MRM or IDOC parser, select the correct message format from the list in Message format. This list is populated with available message formats when you select the MRM or IDOC parser. v Specify the message coded character set ID in Message coded character set ID. v Select the message encoding from the list in Message encoding or specify a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150. 7. On the Parser Options sub-tab: v Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. v If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 8.
Use the Records and Elements tab to specify how the data is interpreted as records. v Use the Record detection property to determine how the data is split into records, each of which generates a single message. Choose from the following options: – Connection closed specifies that all of the data sent during a connection is a single record. – Fixed Length specifies that each record is a fixed number of bytes in length. Each record contains the number of bytes specified in the Length property, except possibly a shorter final record in the file. – Select Delimited if the records that you are processing are separated, or terminated, by a DOS or UNIX line end or by a sequence of user-defined delimiter bytes. Specify the delimiter and delimiter type in the Delimiter and Delimiter type properties. – Select Parsed Record Sequence if the data contains a sequence of one or more records that are serially recognized by the parser specified in Message domain. The node propagates each recognized record as a separate message. If you select this Record detection option, the parser specified in Message domain must be either XMLNSC or MRM (either CWF or TDS physical format). v If you set Record detection to Fixed Length, use Length to specify the required length of the output record. This value must be between 1 byte and 100 MB. The default is 80 bytes. If you set Record detection to Connection closed, Fixed Length, or Delimited, a limit of 100 MB applies to the length of the records. If you set Record detection to Parsed Record Sequence, the TCPIPClientReceive node does not
1160
Message Flows
determine or limit the length of a record. Nodes that are downstream in the message flow might try to determine the record length or process a very long record. If you intend to process large records in this way, ensure that your broker has sufficient memory. You might need to apply flow techniques described in the Large Messaging sample to best use the available memory. v If you set Record detection to Delimited, use Delimiter to specify the delimiter to be used. Choose from the following options: – DOS or UNIX Line End, on UNIX systems, specifies the line feed character (, X’0A’), and, on Windows systems, specifies a carriage return character followed by a line feed character (, X’0D0A’). The node treats both of these strings as delimiters, irrespective of the system on which the broker is running. If both strings can be seen in the same record, the node recognizes both as delimiters. The node does not recognize X’15’ which, on z/OS systems, is the ’newline’ byte; set this property to Custom Delimiter and set Custom delimiter to 15 if your input file is coded using EBCDIC new lines. – Custom Delimiter (hexadecimal), permits a sequence of bytes to be specified in Custom delimiter (hexadecimal) v In Custom delimiter (hexadecimal), specify the delimiter byte or bytes to be used when Delimiter is set to Custom delimiter (hexadecimal). Specify this value as an even-numbered string of hexadecimal digits. The default is X’0A’ and the maximum length of the string is 16 bytes (represented by 32 hexadecimal digits). v If you set Record detection to Delimited, use Delimiter type to specify the type of delimiter. Permitted values are: – Infix. If you select this value, each delimiter separates records. If the data ends with a delimiter, the (zero length) data following the final delimiter is still propagated, although it contains no data. – Postfix. If you specify this value, each delimiter terminates records. If the data ends with a delimiter, no empty record is propagated after the delimiter. If the data does not end with a delimiter, it is processed as if a delimiter follows the final bytes of the data. Postfix is the default value. v The TCPIPClientReceive node considers each occurrence of the delimiter in the input as either separating (infix) or terminating (postfix) each record. If the data begins with a delimiter, the node treats the (zero length) contents preceding that delimiter as a record and propagates an empty record to the flow. The delimiter is never included in the propagated message. 9. Use the Validation tab to provide validation based on the message set for predefined messages. For more information about validation, see “Validating messages” on page 187. For information about how to complete this tab, see “Validation tab properties” on page 1386.
Terminals and properties The terminals of the TCPIPClientReceive node are described in the following table. Terminal
Description
In
The input terminal that accepts a message for processing by the node.
Out
The output terminal to which the message is routed if it is successfully retrieved from an external resource. If no errors occur in the input node, a message received from an external resource is always sent to the Out terminal first.
Message flows
1161
Terminal
Description
Timeout
The terminal to which a message is sent when the time specified in the Timeout waiting for a data record property has been exceeded. The message text is Timeout value is exceeded.
Failure
The output terminal to which the message is routed if an error occurs. These errors include failures caused by retry processing. Even if the Validation property is set, messages propagated to this terminal are not validated.
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 TCPIPClientReceive node are described in the following table. Property
M
C
Default
Description
Node name
No
No
TCPIPClientReceive 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 Basic properties of the TCPIPClientReceive node are described in the following table. Property
M
C
Connection details
Yes
Yes
Timeout waiting for a data record (seconds)
Yes
Yes
Default
Description A string containing either the host name and port number to be used, or the name of a configurable service.
60
Specifies how long the node listens on a connection for more data after the first byte of data has arrived. You can specify any length of time in seconds. A value of -1 specifies that there is no time limit (wait forever).
The Advanced properties of the TCPIPClientReceive node are described in the following table. Property
M
C
Default
Description
Close connection
Yes
No
No
Controls when the connection is closed, or if it remains open. Valid options are: v No v After Timeout v After Data has been Received
Close input stream Yes after a record has been received
No
Cleared
Specifies whether to close the input stream as soon as the data has been retrieved. When the connection input stream is reserved, no other node can use it without knowing the ID. By default, this property is not selected.
1162
Message Flows
Property
M
C
Default
Description
Input Stream Modification
No
No
Leave unchanged
Specifies whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release the input stream at the end of the flow. Valid options are: v Leave unchanged v Release input stream v Reserve input stream (for use by future TCPIP nodes) v Reserve input stream (for use by future TCPIP nodes) then release at end of flow When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. If the input stream is released after the message has been propagated, it is returned to the pool and becomes available for use by any input or receive node.
Output Stream Modification
No
No
Leave unchanged
Specifies whether to reserve this output stream or release it and return it to the pool for use by any output node. Valid options are: v Leave unchanged v Release output stream v Reserve output stream (for use by future TCPIP nodes) v Reserve output stream (for use by future TCPIP nodes) then release at end of flow
The Request properties of the TCPIPClientReceive node are described in the following table: Property
M
C
Default
Description
Hostname location
Yes
No
$LocalEnvironment/TCPIP/Receive/Hostname
The message element location that contains the host name.
Port location
Yes
No
$LocalEnvironment/TCPIP/Receive/Port
The message element location that contains the port.
ID location
Yes
No
$LocalEnvironment//TCPIP/Receive/Id
The message element location that contains the ID.
Reply ID location
Yes
No
$LocalEnvironment/TCPIP/Receive/ReplyId
The message element location that contains the Reply ID.
The Result properties of the TCPIPClientReceive node are described in the following table:
Message flows
1163
Property
M
C
Default
Description
Output data location
No
No
$OutputRoot
The start location in the output message tree where the parsed elements from the bit string of the message are stored.
Copy local environment
No
No
Selected
Specifies if the local environment is copied to the output message.
The Input Message Parsing properties of the TCPIPClientReceive node are described in the following table. Property
M
C
Default
Description
Message domain
No
No
The domain that is used to parse the incoming message.
Message set
No
No
The name or identifier of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message Set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message.
Message format
No
No
The name of the physical format of the incoming message.
Message coded character set ID
Yes
No
Broker System Default
The ID of the coded character set that is used to interpret the data being read.
Message encoding
Yes
No
Broker System Determined
The encoding scheme for numbers and large characters used to interpret the data that is being read. Valid values are Broker System Determined or a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150.
The Parser Options properties of the TCPIPClientReceive node are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are: v On Demand v Immediate v Complete For a full description of this property, see “Parsing on demand” on page 1389.
1164
Message Flows
Property
M
C
Default
Description
Build tree using XML schema data types
No
No
Cleared
This property controls whether the syntax elements in the message tree have data types taken from the XML Schema.
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing property, Message Domain, is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be parsed opaquely by the XMLNSC parser.
The Records and Elements properties of the TCPIPClientReceive node are described in the following table: Property
M
C
Default
Description
Record detection
Yes
No
Connection Closed
The mechanism used to identify records in the input data. Valid options are: v Connection Closed v Fixed Length v Delimited v Parsed Record Sequence
Length (bytes)
Yes
No
0
The length of each record, in bytes, when Fixed Length record detection is selected.
Delimiter
Yes
No
DOS or UNIX Line End
The type of delimiter bytes that separate, or ends, each record when Delimited record detection is selected. Valid options are: v DOS or UNIX Line End v Custom Delimiter (Hexadecimal)
Message flows
1165
Property
M
C
Custom delimiter (hexadecimal)
No
No
Delimiter type
Yes
No
Default
Description The delimiter bytes, expressed in hexadecimal, when Delimited record detection and Custom Delimiter (Hexadecimal) are selected. This property is mandatory only if the Delimiter property is set to Custom Delimiter (Custom Hexadecimal).
Postfix
The location of the delimiter when Delimited record detection and Custom Delimiter (Hexadecimal) are selected. Valid options are: v Infix v Postfix This property is ignored unless the Delimiter property is set to Custom Delimiter (Hexadecimal).
The Validation properties of the TCPIPClientReceive node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are v None v Content and Value v Content v inherit
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are: v User Trace v Local Error Log v Exception v Exception List
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TCPIPServerInput node
|
Use the TCPIPServerInput node to create a server connection to a raw TCPIP socket, and to receive data over that connection. This topic contains the following sections: v “Purpose” on page 1167 v “Using the TCPIPServerInput node in a message flow” on page 1168
1166
Message Flows
v “Configuring the TCPIPServerInput node” on page 1168 v “Terminals and properties” on page 1172
Purpose The TCPIPServerInput node listens on a port and, when a client socket connects to the port, the server socket creates a new connection for the client. Unlike the TCPIPClientInput node, the TCPIPServerInput node does not attempt to make a minimum number of connections, because the server end of the socket cannot initiate new connections, it can only accept them. The TCPIPServerInput node accepts connections up to a maximum value, which is specified in the MaximumConnections property of the TCPIPServer configurable service. By default the broker can accept up to 100 server connections. For more information, see mqsicreateconfigurableservice command and the mqsireportproperties command. The first record of data is detected in accordance with properties on the node and then sent to the Out terminal. If an error occurs, including a timeout waiting for data or the closure of a connection while waiting for the full record, the data is sent to the Failure terminal. If the connection closes and no data exists, a message is sent to the Close terminal. Although the message has no data, the local environment does have details of the connection that closed. For both data and close events, the following local environment is created. Table 34. Location in local environment Location in local environment
Description
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ Type
The server.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ Hostname
The host name used to make a connection.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ Port
The port number used to make a connection.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ OpenTimestamp
The time stamp when the connection was first opened.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ CloseTimestamp
The time stamp when the connection was closed (null if not yet closed).
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ SequenceNumber/InputRecord
The sequence number of the message received on this connection. The first record has a sequencing number of 1; the second record has a sequencing number of 2; and so on.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ SequenceNumber/OutputRecord
The sequence number of the message sent on this connection. The first record has a sequencing number of 1; the second record has a sequencing number of 2; and so on.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/Id
The ID of the socket being used. This ID is an internal identifier used by WebSphere Message Broker to uniquely identify a connection.
$LocalEnvironment/TCPIP/Input/ConnectionDetails/ ReplyId
The Reply ID that is stored on this connection. It can be any text string.
The TCPIPServerInput node is contained in the TCPIP drawer of the palette, and is represented in the workbench by the following icon: Message flows
1167
Message structure The TCPIPServerInput node handles messages in the following message domains: v MRM v XMLNSC v DataObject v v v v v v v
XMLNS JMSMap JMSStream MIME BLOB XML (this domain is deprecated; use XMLNSC) IDOC (this domain is deprecated; use MRM)
Using the TCPIPServerInput node in a message flow Look at the following samples to see how to use the TCPIPServerInput node: v TCPIP Client Nodes sample v TCPIP Handshake sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the TCPIPServerInput node When you have put an instance of the TCPIPServerInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk. Configure the TCPIPServerInput node: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, set the properties that determine how the TCPIP connection is controlled. v Use the Connection details property to specify the port number to be used, or the name of a configurable service. This property is mandatory. The following formats are supported: – Configurable service name. This value is used to look up the port number in configurable services. For example, TCPIPProfile1. – . This value is the port number. For example, 1111 – . This value is the port number. In this case, the host name is assumed to be localhost. v Use the Timeout waiting for a data record (seconds) property to specify how long the node listens on a connection for more data after the first byte of data has arrived. You can specify any length of time in seconds. A value
1168
Message Flows
of -1 specifies that no time limit exists (wait forever). The default is 60 seconds. When the specified time has been exceeded, all available data is sent to the Failure terminal. 3. On the Advanced tab, set the properties that determine how the data stream is controlled. v Use the Close connection property to specify when and how to close the connection. – Select No to leave the connection open. This value is the default. – Select After timeout to close the connection when a timeout occurs. – Select After data has been received to close the connection when the end of the record is found. – Select At end of flow to close the connection after the flow has been run. v Select Close input stream after a record has been received to close the input stream as soon as the data has been retrieved. When the connection input stream is reserved, no other node can use it without specifying the ID. This property is not selected by default. v Use the Input Stream Modification property to specify whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, and, if reserved, whether to release the input stream at the end of the flow. These options are available only if you have not selected the Close input stream after a record has been received property. – Select Leave unchanged to leave the input stream as it was when it entered the node. This value is selected by default. – Select Reserve input stream (for use by future TCPIP input and receive nodes) to specify that this input stream can be used only by this node and by other receive nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve input stream (for use by future TCPIP input and receive nodes) then release at end of flow to specify that this input stream can be used only by this node and receive nodes that request it by specifying the connection ID. After the flow has been run, this input stream is returned to the pool and becomes available for use by any input or receive node. v Use the Output Stream Modification property to specify whether to release the output stream. – Select Leave unchanged to leave the output stream as it was when it entered the node. This value is selected by default. – Select Release output stream and reset ReplyID to specify that this output stream is returned to the pool and is available for use by any output node. The ReplyID is passed in the local environment when leaving this node, but is reset for the next record on this connection. 4. On the Input Message Parsing tab, set values for the properties that the node uses to determine how to parse the incoming message. If the incoming message has an MQRFH2 header, you do not need to set values for the Input Message Parsing properties because the values are derived from the <mcd> folder in the MQRFH2 header; for example: <mcd><Msd>MRM<Set>DHM4UO906S001receiptmsg1 XML
If you set values, and those values differ from those in the MQRFH2 header, the values in the MQRFH2 header take precedence. Message flows
1169
v In Message domain, select the name of the parser that you are using from the list. The default is BLOB. You can choose from the following options: – MRM – XMLNSC – DataObject – XMLNS – JMSMap – JMSStream – MIME – BLOB – XML (this domain is deprecated; use XMLNSC) – IDOC (this domain is deprecated; use MRM) You can also specify a user-defined parser, if appropriate. v If you are using the MRM or IDOC parser, or the XMLNSC parser in validating mode, select the Message set that you want to use. The list contains the message sets that are available when you select MRM, XMLNSC, or IDOC as the domain. v If you are using the MRM parser, select the correct message type from the list in Message type. This list is populated with available message types when you select the MRM parser. v If you are using the MRM or IDOC parser, select the correct message format from the list in Message format. This list is populated with available message formats when you select the MRM or IDOC parser. v Specify the message coded character set ID in Message coded character set ID. v Select the message encoding from the list in Message encoding or specify a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150. 5. On the Parser Options sub-tab: a. Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. b. If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 6. Use the Retry tab to define how retry processing is performed when a flow fails. You can set the following properties: v Retry mechanism determines the action that occurs should the flow fail. Choose from the following values: – Select Failure for the node to report a failure without any retry attempts. – Select Short retry for the node to retry before reporting a failure if the condition persists. The number of times that it retries is specified in Retry threshold. – Select Short retry and long retry for the node to retry, first using the value in Retry threshold as the number of attempts it should make. If the condition persists after the Retry threshold has been reached, the node then uses the Long retry interval between attempts. v Specify the Retry threshold:The number of times the node retries the flow transaction if the Retry mechanism property is set to either Short retry or Short retry and long retry. v Specify the Short retry interval:The length of time, in seconds, to wait between short retry attempts.
1170
Message Flows
v Specify the Long retry interval:The length of time to wait between long retry attempts until a message is successful, the message flow is stopped, or the message flow is redeployed. The broker property MinLongRetryInterval defines the minimum value that the Long retry interval can take. If the value is lower than the minimum, the broker value is used. 7.
Use the Records and Elements tab to specify how the data is interpreted as records. v Use the Record detection property to determine how the data is split into records, each of which generates a single message. Choose from the following options: – End of stream specifies that all of the data sent in the data stream is a single record. – Fixed Length specifies that each record is a fixed number of bytes in length. Each record contains the number of bytes specified in the Length property. – Select Delimited if the records that you are processing are separated, or ended, by a DOS or UNIX line end or by a sequence of user-defined delimiter bytes. Specify the delimiter and delimiter type in the Delimiter and Delimiter type properties. – Select Parsed Record Sequence if the data contains a sequence of one or more records that are serially recognized by the parser specified in Message domain. The node propagates each recognized record as a separate message. If you select the Record detection option, the parser specified in Message domain must be either XMLNSC or MRM (either CWF or TDS physical format). v If you set Record detection to Fixed Length, use Length to specify the required length of the output record. This value must be between 1 byte and 100 MB. The default is 80 bytes. If you set Record detection to End of stream, Fixed Length, or Delimited, a limit of 100 MB applies to the length of the records. If you set Record detection toParsed Record Sequence, the TCPIPServerInput node does not determine or limit the length of a record. Nodes that are downstream in the message flow might try to determine the record length or process a very long record. If you intend to process large records in this way, ensure that your broker has sufficient memory. You might need to apply flow techniques described in the Large Messaging sample to best use the available memory. v If you set Record detection to Delimited, use Delimiter to specify the delimiter to be used. Choose from the following values: – DOS or UNIX Line End, which, on UNIX systems, specifies the line feed character (, X’0A’), and, on Windows systems, specifies a carriage return character followed by a line feed character (, X’0D0A’). The node treats both of these strings as delimiters, irrespective of the system on which the broker is running. If both strings are seen in the same record, the node recognizes both as delimiters. The node does not recognize X’15’, which, on z/OS systems, is the ’newline’ byte; specify a value of Custom Delimiter in this property and a value of 15 in the Custom delimiter property if your input data is coded using EBCDIC new lines. – Custom Delimiter, which permits a sequence of bytes to be specified in Custom delimiter
Message flows
1171
v In Custom delimiter, specify the delimiter byte or bytes to be used when Delimiter is set to Custom delimiter. Specify this value as an even-numbered string of hexadecimal digits. The default is X’0A’ and the maximum length of the string is 16 bytes (represented by 32 hexadecimal digits). v If you set Record detection to Delimited, use Delimiter type to specify the type of delimiter. Permitted values are: – Infix. If you select this value, each delimiter separates records. If the data ends with a delimiter, the (zero length) data that follows the final delimiter is still propagated although it contains no data. – Postfix. If you specify this value, each delimiter ends records. If the data ends with a delimiter, no empty record is propagated after the delimiter. If the data does not end with a delimiter, it is processed as if a delimiter follows the final bytes of the data. Postfix is the default value. v The TCPIPServerInput node considers each occurrence of the delimiter in the input as either separating (infix) or terminating (postfix) each record. If the data begins with a delimiter, the node treats the (zero length) contents preceding that delimiter as a record and propagates an empty record to the flow. The delimiter is never included in the propagated message. 8. Use the Validation tab to provide validation based on the message set for predefined messages. For more information about validation, see “Validating messages” on page 187. For information about how to provide validation for this tab, see “Validation tab properties” on page 1386. 9. On the Transactions tab, set the transaction mode. Although TCPIP operations are non-transactional, the transaction mode on this input node determines whether the rest of the nodes in the flow are to be executed under point of consistency or not. Select Yes if you want the flow updates to be treated transactionally (if possible) or No if you do not. The default for this property is No. 10. Optional: On the Instances tab, set values for the properties that determine the additional instances (threads) that are available for a node. For more details, see “Configurable message flow properties” on page 1398.
Terminals and properties The terminals of the TCPIPServerInput node are described in the following table. Terminal
Description
Failure
The output terminal to which the message is routed if an error occurs. These errors include failures caused by retry processing. Even if the Validation property is set, messages propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is successfully retrieved from an external resource. If no errors occur within the input node, a message that is received from an external resource is always sent to the Out terminal first.
Close
The output terminal to which the message is routed if the connection closes.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by this node. Exceptions are caught only if this terminal is attached.
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
1172
Message Flows
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 TCPIPServerInput node are described in the following table. Property
M
C
Default
Description
Node name
No
No
TCPIPServerInput
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 Basic properties of the TCPIPServerInput node are described in the following table. Property
M
C
Connection details
Yes
Yes
Timeout waiting for a data record (seconds)
Yes
Yes
Default
Description A string containing the port number to be used, or the name of a configurable service.
60
Specifies how long the node listens on a connection for more data after the first byte of data has arrived. You can specify any length of time in seconds. A value of -1 specifies that there is no time limit (wait forever).
The Advanced properties of the TCPIPServerInput node are described in the following table. Property
M
C
Default
Description
Close connection
Yes
No
No
Controls when the connection is closed, or if it remains open. Valid options are: v No v After Timeout v After Data has been Received v At End of Flow
Close input stream Yes after a record has been received
No
Cleared
Specifies whether to close the input stream as soon as the data has been retrieved. When the connection input stream is reserved, no other node can use it without knowing the ID. By default, this option is not selected.
Input Stream Modification
No
Leave unchanged
Specifies whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, and, if reserved, whether to release the input stream at the end of the flow. Valid options are:
No
v Leave unchanged v Reserve input stream (for use by future TCPIP nodes) v Reserve input stream (for use by future TCPIP nodes) then release at end of flow When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. If the input stream is released at the end of the flow, it is returned to the pool and becomes available for use by any input or receive node.
Message flows
1173
Property
M
C
Default
Description
Output stream modification
No
No
Leave unchanged
Specifies whether this output stream is released and returned to the pool for use by any output node. Valid options are: v Leave unchanged v Release output stream and reset ReplyID If you select Release output stream and reset ReplyID, the ReplyID is passed in the local environment when leaving this node, but is reset for the next record on this connection.
The Input Message Parsing properties of the TCPIPServerInput node are described in the following table. Property
M
C
Default
Description
Message domain
No
No
The domain that is used to parse the incoming message.
Message set
No
No
The name or identifier of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message Set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message.
Message format
No
No
The name of the physical format of the incoming message.
Message coded character set ID
Yes
No
Broker System Default
The ID of the coded character set used to interpret the data being read.
Message encoding
Yes
No
Broker System Determined
The encoding scheme for numbers and large characters used to interpret the data being read. Valid values are Broker System Determined or a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150.
The Parser Options properties of the TCPIPServerInput node are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are: v On Demand v Immediate v Complete For a full description of this property, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
1174
Message Flows
No
No
Cleared
This property controls whether the syntax elements in the message tree have data types taken from the XML Schema.
Property
M
C
Default
Description
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing property, Message Domain, is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed by the XMLNSC parser.
The Records and Elements properties of the TCPIPServerInput node are described in the following table: Property
M
C
Default
Description
Record detection
Yes
No
End of Stream
The mechanism used to identify records in the input data. Valid options are: v End of Stream v Fixed Length v Delimited v Parsed Record Sequence
Length (bytes)
Yes
No
0
The length of each record, in bytes, when Fixed Length record detection is selected.
Delimiter
Yes
No
DOS or UNIX Line End
The type of delimiter bytes that separates, or ends, each record when Delimited record detection is selected. Valid options are: v DOS or UNIX Line End v Custom Delimiter (Hexadecimal)
Custom delimiter (hexadecimal)
No
No
The delimiter bytes, expressed in hexadecimal, when Delimited record detection and Custom Delimiter (Hexadecimal) are selected. This property is mandatory only if the Delimiter property is set to Custom Delimiter (Hexadecimal).
Message flows
1175
Property
M
C
Default
Description
Delimiter type
Yes
No
Postfix
The location of the delimiter when Delimited record detection and Custom Delimiter (Hexadecimal) are selected. Valid options are: v Infix v Postfix This property is ignored unless the Delimiter property is set to Custom Delimiter (Hexadecimal).
The Retry properties of the TCPIPServerInput node are described in the following table: Property
M
C
Default
Description
Retry mechanism
Yes
No
Failure
How the node handles a flow failure. Valid options are: v Failure v Short Retry v Short and Long Retry
Retry threshold
Yes
Yes
0
The number of times to retry the flow transaction when Retry mechanism is Short retry.
Short retry interval (seconds)
No
Yes
0
The interval, in seconds, between each retry if Retry threshold is not zero.
Long retry interval (seconds)
No
Yes
300
The interval between retries if Retry mechanism is Short and Long Retry and the retry threshold has been exhausted.
The Validation properties of the TCPIPServerInput node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are v None v Content and Value v Content
Failure action
No
No
Exception
This property controls what happens if validation fails. Valid values are: v User Trace v Local Error Log v Exception v Exception List
The Transactions properties of the TCPIPServerInput node are described in the following table:
1176
Message Flows
Property
M
C
Default
Description
Transaction mode
No
Yes
No
The transaction mode on this input node determines whether the rest of the nodes in the flow are executed under point of consistency. Valid options are: v Yes v No
The Instances properties of the TCPIPServerInput node are described in the following table. For a full description of these properties, see “Configurable message flow properties” on page 1398. Property
M
C
Default
Description
Additional instances pool
No
Yes
Use Pool Associated with Message Flow
The pool from which additional instances are obtained.
Additional instances
No
Yes
v If you select Use Pool Associated with Node, additional instances are allocated from the node’s additional instances based on the number specified in the Additional instances property. The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | | |
0
v If you select Use Pool Associated with Message Flow, additional instances are obtained from the message flow pool.
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TCPIPServerOutput node Use the TCPIPServerOutput node to create a server connection to a raw TCPIP socket, and to send data over that connection to an external application. This topic contains the following sections: v “Purpose” v “Using the TCPIPServerOutput node in a message flow” on page 1179 v “Configuring the TCPIPServerOutput node” on page 1179 v “Terminals and properties” on page 1182
Purpose The TCPIPServerOutput listens on a TCPIP port and waits for a client node to make connection with the port. When the client node connects to the port, the server node creates a new connection for the client. The connections are not made directly by the node but are obtained from a connection pool managed by the WebSphere Message Broker execution group. Message flows
1177
The execution group uses the default TCPIPServer configurable service to determine which attributes are used for the socket connection. However, if the configurable service is set on the node, the configurable service is used for all the properties, including the host and port number. When the connection has been established, the data is sent. If the data is not sent successfully within the time limit specified by the node’s Timeout sending a data record property, an exception is thrown. Properties in the local environment can override the TCPIP connection used by the node. Table 35. Input local environment properties Location in local environment
Description
$LocalEnvironment/Destination/TCPIP/Output/ Hostname
The host name used to make a connection.
$LocalEnvironment/Destination/TCPIP/Output/Port
The port number used to make a connection.
$LocalEnvironment/Destination/TCPIP/Output/Id
The ID of the socket being used. This ID is an internal identifier used by WebSphere Message Broker to uniquely identify a connection.
$LocalEnvironment/Destination/TCPIP/Output/ReplyId The Reply ID that is stored on this connection. It can be any text string.
You can dynamically choose the connection details (host name and port number), and the connection used (ID), using these properties. The Reply ID can also be set on the connection, which enables a string to be stored in the connection and to be displayed in the local environment. This behavior can be used to store Reply IDs from other TCPIP nodes or from other transports such WebSphere MQ. The output of the node contains the same information as the input, plus any fields that are missing from the input are updated with details from the connection used. For example, if the Id property is not provided as input (because you want to create a new connection or reuse a pool connection), the output local environment contains the ID of the connection that is used. Table 36. Output local environment properties Location in local environment
Description
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/Hostname
The host name used to make a connection.
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/Port
The port number used to make a connection.
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/OpenTimestamp
The time stamp when the connection was first opened.
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/CloseTimestamp
The time stamp when the connection was closed (null if not yet closed).
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/SequenceNumber
The sequence number of the message received on this connection. The first record has a sequencing number 1; the second record 2; and so on.
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/Id
The ID of the socket being used. This ID is an internal identifier used by WebSphere Message Broker to uniquely identify a connection.
1178
Message Flows
Table 36. Output local environment properties (continued) Location in local environment
Description
$LocalEnvironment/WrittenDestination/TCPIP/Output/ ConnectionDetails/ReplyId
The Reply ID that is stored on this connection. It can be any text string.
If the connection closes (or any other type of exception occurs) while using the TCPIP transport, an exception is thrown. This exception goes to the Failure terminal if it is connected; otherwise the exception goes back down the flow. The node also has a Close input terminal. If a message is sent to this terminal, the connection is closed using a combination of the details provided in the node and the local environment. The TCPIPServerOutput node is contained in the TCPIP drawer of the palette and is represented in the workbench by the following icon:
Using the TCPIPServerOutput node in a message flow You can use the TCPIPServerOutput node in any message flow that needs to send data to an external application. Look at the following samples to see how to use it: v TCPIP Client Nodes sample v TCPIP Handshake sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the TCPIPServerOutput node When you have put an instance of the TCPIPServerOutput node into a message flow, you can configure it. 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 in that view. To configure the TCPIPServerOutput node: 1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab. 2. On the Basic tab, set the properties that determine how the TCPIP connection is controlled. v Use the Connection details property to specify the port number to be used, or the name of a configurable service. This property is mandatory. The following formats are supported: – Configurable service name. This value is used to look up the port number in configurable services; for example, TCPIPProfile1. – . This value is the port number; for example, 1111 – . This value is the port number. In this case the host name is assumed to be localhost. v Use the Timeout sending a data record (seconds) property to specify how long the node waits when trying to send data. You can specify any length of time in seconds. When the specified time has been exceeded, all available data is sent to the Failure terminal. The default is 60 seconds. Message flows
1179
3. On the Advanced tab, set the properties that determine how the data stream is controlled. v Use the Send to property to specify whether the data is to be sent to one connection or to all available connections. – Select One connection to send the message to only one connection, as specified by the node properties and message overrides. This value is the default. – Select All available connections to send the data to all available connections. v Use the Close connection property to specify when and how to close the connection. – Select No to leave the connection open. This value is the default. – Select After timeout to close the connection when a timeout occurs. – Select After data has been sent to close the connection when the end of the record has been sent. v Select Close output stream after a record has been sent to close the output stream as soon as the data has been sent. By default, this property is not selected. v Use the Output Stream Modification property to specify whether to reserve or release the output stream. These options are available only if you have not selected the Close output stream after a record has been sent property. – Select Leave unchanged to leave the output stream as it was when it entered the node. This value is selected by default. – Select Release output stream to specify that this output stream is returned to the pool and is available for use by any output node. – Select Reserve output stream (for use by future TCPIP output nodes) to specify that this output stream can be used only by this node and by other output nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve output stream (for use by future TCPIP output nodes) then release after propagate to specify that this output stream can be used only by this node and output nodes that request it by specifying the correct connection ID. After the message has been propagated, this output stream is returned to the pool and becomes available for use by any output node. v Use the Input Stream Modification property to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release the input stream at the end of the flow. – Select Leave unchanged to leave the input stream as it was when it entered the node. This value is selected by default. – Select Release input stream to specify that this input stream is returned to the pool and is available for use by any input or receive node. – Select Reserve input stream (for use by future TCPIP input and receive nodes) to specify that this input stream can be used only by this node and by other input or receive nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve input stream (for use by future TCPIP input and receive nodes) then release after propagate to specify that this input stream can be used only by this node and receive nodes that request it by specifying the
1180
Message Flows
correct connection ID. After the message has been propagated, this input stream is returned to the pool and becomes available for use by any input or receive node. 4. On the Request tab, specify the location of the data to be written. You can specify the properties on this tab as XPath or ESQL expressions. Content Assist is available in the Properties view and also in the XPath Expression Builder, which you can call by using the Edit button to the right of each property. a. In Data location, specify the input data location, which is the location in the input message tree that contains the record to be written. The default value is $Body, which is the entire message body ($InputRoot.Body). When you are specifying this property, and the data in the message tree that it identifies is owned by a model-driven parser, such as the MRM parser or XMLNSC parser, be aware of the following considerations: v If you are using MRM CWF format, ensure that the identified message tree exists as a message definition. If this message tree is defined as a global element only, exceptions BIP5180 and BIP5167 are generated. v If you are using MRM TDS format, the serialization of the identified message is successful if the element is defined as a global element or message. However, if the identified field is not found as a global element or message, note that: – If this field is a leaf field in the message tree, the field is written as self-defining. No validation occurs even if validation is enabled. – If this field is a complex element, an internal exception is generated, BIP5522, indicating that the logical type cannot be converted to a string. v If you are using MRM XML, the events are similar to the MRM TDS format except that, if the field is a complex element, it is written as self-defining. v If you use the XMLNSC parser, no validation occurs, even if validation is enabled. b. In Port location, specify the location of the value to override the Port that is set in the Connection details property of the Basic tab. If you do not specify a location, the default value is $LocalEnvironment/Destination/TCPIP/ Output/Port. c. In ID location, specify the location of the Id of the socket being used. This internal identifier is used by WebSphere Message Broker to uniquely identify a connection. If you do not specify a location, the default value is $LocalEnvironment/Destination/TCPIP/Output/Id. d. In Reply ID location, specify the location of the Reply ID that is stored on the connection that is being used. The Reply ID can be used when data is returned in an input node. If you do not specify a location, the default value is $LocalEnvironment/Destination/TCPIP/Output/ReplyId. 5. Use the Records and Elements tab to specify how the TCPIPServerOutput node writes the record that is derived from the message. v In Record definition, choose from the following values: – Record is Unmodified Data specifies that records are left unchanged. This value is the default. – Record is Fixed Length Data specifies that records are padded to a given length if necessary. You specify this length in the Length property. If the record is longer than the value specified in Length, the node generates an exception. Use the Padding byte property to specify the byte to be used for padding the message to the required length. Message flows
1181
– Record is Delimited Data specifies that records are separated by a delimiter and accumulated by concatenation. The delimiter is specified by the Delimiter, Custom delimiter, and Delimiter type properties. The file is finished only when a message is received on the Finish File terminal. v In Length, specify the length (in bytes) of records when Record definition is set to Record is Fixed Length Data. Records longer than this value cause an exception to be thrown. This value must be between 1 byte and 100 MB. The default is 80 bytes. v When Record definition is set to Record is Fixed Length Data, use Padding byte to specify the byte to be used when padding records to the specified length if they are shorter than this length. Specify this as two hexadecimal digits. The default value is X’20’. v In Delimiter, specify the delimiter to be used if you set Record definition to Record is Delimited Data. Choose from: – Broker System Line End specifies that a line end sequence of bytes is used as the delimiter as appropriate for the file system on which the broker is running. This value is the default. For example, on Windows systems, this line end is a ’carriage-return, line-feed’ pair (X’0D0A’); on UNIX systems, it is a single ’line-feed’ byte (X’0A’); on z/OS systems, it is a ’newline’ byte (X’15’). – Custom Delimiter specifies that the explicit delimiter sequence defined in the Custom delimiter property is to be used to delimit records. v In Custom delimiter, specify the delimiter sequence of bytes to be used to delimit records when Delimiter is set toCustom Delimiter. Specify this value as an even-numbered string of hexadecimal digits. The default is X’0A’ and the maximum length of the string is 16 bytes. v If you set Record definition toRecord is Delimited Data, use Delimiter type to specify how the delimiter is to separate records. Choose from the following values: – Postfix specifies that the delimiter is added after each record that is written. This value is the default. – Infix specifies that the delimiter is inserted between any two adjacent records only. 6. On the Validation tab, specify the parser validation properties of the node. For more information about validation, see “Validating messages” on page 187. For information about how to provide validation for this tab, see “Validation tab properties” on page 1386.
Terminals and properties The TCPIPServerOutput node terminals are described in the following table. Terminal
Type
Description
In
Input data
The input terminal that accepts a message for processing by the node.
Close
Input control
The input terminal to which a message is routed when the connection given in the local environment is closed.
Out
Output data
The output terminal to which the message is routed if it is successfully sent to an external resource. The message received on the In terminal is propagated to the Out terminal and is left unchanged except for the addition of status information.
Close
Output control
The output terminal to which a message propagated from the Close input terminal is routed.
1182
Message Flows
Terminal
Type
Description
Failure
Output data
The output terminal to which the message is routed if a failure is detected in 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 for deployment). The Description properties of the TCPIPServerOutput node are described in the following table: Property
M
C
Default
Description
Node name
No
No
TCPIPServerOutput
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 Basic properties of the TCPIPServerOutput node are described in the following table: Property
M
C
Connection details
Yes
Yes
Timeout sending a data Yes record (seconds)
Yes
Default
Description A string containing the port number to be used, or the name of a configurable service.
60
Specifies how long the node waits when trying to send data. You can specify any length of time in seconds.
The Advanced properties of the TCPIPServerOutput node are described in the following table. Property
M
C
Default
Description
Close connection
Yes
No
No
Controls when the connection is closed, or if it remains open. Valid options are: v No v After Timeout v After Data has been Sent
Close output stream Yes after a record has been sent
No
Cleared
Specifies whether to close the output stream as soon as the data has been sent. By default, this property is not selected.
Output Stream Modification
No
Leave unchanged
Specifies whether to reserve this output stream or release it and return it to the pool for use by any output node. Valid options are:
No
v Leave unchanged v Release output stream v Reserve output stream (for use by future TCPIP nodes) v Reserve output stream (for use by future TCPIP nodes) then release at end of flow
Message flows
1183
Property
M
C
Default
Description
Input Stream Modification
No
No
Leave unchanged
Specifies whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release the input stream at the end of the flow. Valid options are: v Leave unchanged v Release input stream v Reserve input stream (for use by future TCPIP nodes) v Reserve input stream (for use by future TCPIP nodes) then release at end of flow When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. If the input stream is released after the message has been propagated, it is returned to the pool and becomes available for use by any input or receive node.
Send to:
Yes
No
One connection
Specifies whether the data is to be sent to one connection or to all available connections. Valid options are: v One Connection v All Available Connections
The Request properties of the TCPIPServerOutput node are described in the following table: Property
M
C
Default
Description
Data location
Yes
No
$Body
The location in the input message tree that contains the record to be written.
Port location
Yes
No
$LocalEnvironment/Destination/TCPIP/Output/ Port
The message element location that contains the port.
ID
Yes
No
$LocalEnvironment/Destination/TCPIP/ Output/Id
The message element location that contains the ID.
Reply ID location
Yes
No
$LocalEnvironment/Destination/TCPIP/Output/ ReplyId
The message element location that contains the Reply ID.
The Records and Elements properties of the TCPIPServerOutput node are described in the following table:
1184
Message Flows
Property
M
C
Default
Description
Record definition
Yes
No
Record is Unmodified Data
This property controls how the records derived from the message are written. Valid options are: v Record is Unmodified Data v Record is Fixed Length Data v Record is Delimited Data
Length (bytes)
Yes
No
0
The required length of the output record. This property applies only when Record definition is set to Record is Fixed Length Data.
Padding byte (hexadecimal)
Yes
No
20
The 2-digit hexadecimal byte to be used to pad short messages when Record definition is set to Record is Fixed Length Data.
Delimiter
Yes
No
Broker System Line End
The delimiter to be used when Record definition is set toRecord is Delimited Data. Valid options are: v Broker System Line End v Custom Delimiter (Hexadecimal)
Custom delimiter (hexadecimal)
No
No
None
The delimiter byte sequence to be used when Record definition is set toRecord is Delimited Data and Delimiter is set toCustom Delimiter (Hexadecimal).
Delimiter type
Yes
No
Postfix
This property specifies the way in which the delimiters are inserted between records when Record definition is set to Record is Delimited Data. Valid options are: v Infix v Postfix
The Validation properties of the TCPIPServerOutput node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385.
|
Property
M
C
Default
Description
Validate
No
Yes
Inherit
This property controls whether validation takes place. Valid values are: v None v Content and Value v Content v Inherit
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are: v User Trace v Local Error Log v Exception v Exception List
The Monitoring properties of the node are described in the following table:
Message flows
1185
||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TCPIPServerReceive node
|
Use the TCPIPServerReceive node to receive data over a server TCPIP connection. This topic contains the following sections: v “Purpose” v “Using the TCPIPServerReceive node in a message flow” on page 1187 v “Configuring the TCPIPServerReceive node” on page 1188 v “Terminals and properties” on page 1192
Purpose The TCPIPServerReceive node waits for data to be received on a TCPIP connection, and retrieves the data. If the connection is closed, an exception is thrown. When a connection is established, the data is sent to the TCPIPServerReceive node. If the TCPIPServerReceive node fails to receive all of the data within the time specified in the Timeout waiting for a data record property, the message is sent to the Timeout terminal; if no Timeout terminal is connected, an exception is thrown. Properties in the local environment can override the TCPIP connection used by the node. Table 37. Input local environment properties Location in local environment for input to node
Description
$LocalEnvironment//TCPIP/Receive/ Hostname
The host name used to make a connection.
$LocalEnvironment//TCPIP/Receive/Port
The port number used to make a connection.
$LocalEnvironment/TCPIP/Receive/Id
The ID of the socket being used. This ID is an internal identifier used by WebSphere Message Broker to uniquely identify a connection.
$LocalEnvironment/TCPIP/Receive/ReplyId The Reply ID to be stored on this connection. This ID can then be used when data is returned on an input node. The Reply ID can be any text string.
These properties enable the connection details (host name and port number) and the connection used (ID) to be chosen dynamically. The Reply ID can also be set on the connection, which enables a string to be stored in the connection and to be displayed in the local environment. In this way, you can store Reply IDs from other TCPIP nodes or from other transports, such as WebSphere MQ. When a record has been retrieved, the ConnectionDetails field in the LocalEnvironment tree is populated with the details of the connection that is being used.
1186
Message Flows
Table 38. Output local environment properties Location in local environment for output from node
Description
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ Type
The Server.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ Hostname
The host name used to make a connection.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ Port
The port number used to make a connection.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ OpenTimestamp
The time stamp when the connection was first opened.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ CloseTimestamp
The time stamp when the connection was closed (null if not yet closed).
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ SequenceNumber/InputRecord
The sequence number of the message that is received on this connection. The first record has a sequencing number of 1; the second record is 2; and so on.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ SequenceNumber/OutputRecord
The sequence number of the message that is sent on this connection. The first record has a sequencing number of 1; the second record is 2; and so on.
$LocalEnvironment/TCPIP/Receive/ ConnectionDetails/Id
The ID of the socket being used. This ID is an internal identifier used by WebSphere Message Broker to uniquely identify a connection.
$LocalEnvironment/TCPIP/Receive/ConnectionDetails/ ReplyId
The Reply ID that is stored on this connection. It can be any text string.
The TCPIPServerReceive node is contained in the TCPIP drawer of the palette, and is represented in the workbench by the following icon:
Message structure The TCPIPServerReceive node handles messages in the following message domains: v MRM v XMLNSC v v v v v v v
DataObject XMLNS JMSMap JMSStream MIME BLOB XML (this domain is deprecated; use XMLNSC)
v IDOC (this domain is deprecated; use MRM)
Using the TCPIPServerReceive node in a message flow Look at the following samples to see how to use the TCPIPServerReceive node: v TCPIP Client Nodes sample Message flows
1187
v TCPIP Handshake sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Configuring the TCPIPServerReceive node When you have put an instance of the TCPIPServerReceive node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk. Configure the TCPIPServerReceive node: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Basic tab, set the properties that determine how the TCPIP connection is controlled. v Use the Connection details property to specify the port number to be used, or the name of a configurable service. This property is mandatory. The following formats are supported: – Configurable service name. This value is used to look up the port and host name in configurable services. For example, TCPIPProfile1. – . This value is the port number; for example, 1111. – . This value is the port number. In this case, the host name is assumed to be localhost. v Use the Timeout waiting for a data record (seconds) property to specify how long the node listens on a connection for more data after the first byte of data has arrived. You can specify any length of time in seconds. A value of -1 specifies that there is no time limit (wait forever). The default is 60 seconds. When the specified time has been exceeded, all available data is sent to the Failure terminal. 3. On the Advanced tab, set the properties that determine how the data stream is controlled. v Use the Close connection property to specify when and how to close the connection. – Select No to leave the connection open. This value is the default. – Select After timeout to close the connection when a timeout occurs. – Select After data has been received to close the connection when the end of the record is found. v Select Close input stream after a record has been received to close the input stream as soon as the data has been retrieved. By default this property is not selected. When the connection input stream is reserved, no other node can use it without knowing the ID. v Use the Input Stream Modification property to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release the input stream at the end of the flow. – Select Leave unchanged to leave the input stream as it was when it entered the node. This value is selected by default. – Select Release input stream to specify that this input stream is returned to the pool and is available for use by any input or receive node.
1188
Message Flows
– Select Reserve input stream (for use by future TCPIP input and receive nodes) to specify that this input stream can be used only by this node and by other input or receive nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve input stream (for use by future TCPIP input and receive nodes) then release after propagate to specify that this input stream can be used only by this node and receive nodes that request it by specifying the correct connection ID. After the message has been propagated, this input stream is returned to the pool and becomes available for use by any input or receive node. v Use the Output Stream Modification property to specify whether to reserve or release the output stream. These options are available only if you have not selected the Close output stream after a record has been sent property. – Select Leave unchanged to leave the output stream as it was when it entered the node. This value is selected by default. – Select Release output stream to specify that this output stream is returned to the pool and is available for use by any output node. – Select Reserve output stream (for use by future TCPIP output nodes) to specify that this output stream can be used only by this node and by other output nodes that request it by specifying the connection ID. When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. – Select Reserve output stream (for use by future TCPIP output nodes) then release after propagate to specify that this output stream can be used only by this node and output nodes that request it by specifying the correct connection ID. After the message has been propagated, this output stream is returned to the pool and becomes available for use by any output node. 4. On the Request tab, specify the location of the data to be written. You can specify the properties on this tab as XPath or ESQL expressions. Content Assist is available in the Properties view and also in the XPath Expression Builder, which you can run by clicking Edit to the right of each property. v In Port location, specify the location of the value to override the Port that is set in the Connection details property of the Basic tab. If you do not specify a location, the default value is $LocalEnvironment/TCPIP/Receive/Port. v In ID location, specify the location of the Id of the socket that is being used. This internal identifier is used by WebSphere Message Broker to uniquely identify a connection. If you do not specify a location, the default value is $LocalEnvironment/TCPIP/Receive/Id. v In Reply ID location, specify the location of the Reply ID that is stored on the connection being used. The Reply ID can be used when data is returned in an input node. If you do not specify a location, the default value is $LocalEnvironment/TCPIP/Receive/ReplyId. 5. On the Result tab, set values for the properties that determine where the reply is to be stored. v Use the Output data location property to specify the start location in the output message tree where the parsed elements from the bit string of the message are stored. The default value is $Root. v Use the Copy local environment property to specify whether the local environment is copied to the output message. – If Copy local environment is selected, a new copy of the local environment is created in the tree, and it is populated with the contents of Message flows
1189
the local environment from the preceding node. Therefore, that if a node changes the local environment, the upstream nodes are not affected by those changes because they have their own copies. This value is the default. – If Copy local environment is not selected, the node does not generate its own copy of the local environment, but uses the local environment that is passed to it by the preceding node. Therefore, if a node changes the local environment, the changes are reflected by the upstream nodes. 6. On the Input Message Parsing tab, set values for the properties that the node uses to determine how to parse the incoming message. If the incoming message has an MQRFH2 header, you do not need to set values for the Input Message Parsing properties because the values are derived from the <mcd> folder in the MQRFH2 header; for example: <mcd><Msd>MRM<Set>DHM4UO906S001receiptmsg1 XML
If you set values, and those values differ from those in the MQRFH2 header, the values in the MQRFH2 header take precedence. v In Message domain, select the name of the parser that you are using from the list. The default is BLOB. You can choose from the following options: – MRM – XMLNSC – DataObject – XMLNS – JMSMap – JMSStream – MIME – BLOB – XML (this domain is deprecated; use XMLNSC) – IDOC (this domain is deprecated; use MRM) v
v
v
v v
You can also specify a user-defined parser, if appropriate. If you are using the MRM or IDOC parser, or the XMLNSC parser in validating mode, select the Message set that you want to use. The list contains the message sets that are available when you select MRM, XMLNSC, or IDOC as the domain. If you are using the MRM parser, select the correct message type from the list in Message type. This list is populated with available message types when you select the MRM parser. If you are using the MRM or IDOC parser, select the correct message format from the list in Message format. This list is populated with available message formats when you select the MRM or IDOC parser. Specify the message coded character set ID in Message coded character set ID. Select the message encoding from the list in Message encoding or specify a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150.
7. On the Parser Options sub-tab: v Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. v If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391.
1190
Message Flows
8.
Use the Records and Elements tab to specify how the data is interpreted as records: v Use the Record detection property to determine how the data is split into records, each of which generates a single message. Choose from the following options: – Connection closed specifies that all of the data sent during a connection is a single record. – Fixed Length specifies that each record is a fixed number of bytes in length. Each record contains the number of bytes specified in the Length property, except possibly a shorter final record in the file. – Select Delimited if the records you are processing are separated, or ended, by a DOS or UNIX line end or by a sequence of user-defined delimiter bytes. Specify the delimiter and delimiter type in the Delimiter and Delimiter type properties. – Select Parsed Record Sequence if the data contains a sequence of one or more records that are serially recognized by the parser specified in Message domain. The node propagates each recognized record as a separate message. If you select this Record detection option, the parser specified in Message domain must be either XMLNSC or MRM (either CWF or TDS physical format). v If you set Record detection to Fixed Length, use Length to specify the required length of the output record. This value must be between 1 byte and 100 MB. The default is 80 bytes. If you set Record detection toConnection closed, Fixed Length, or Delimited, a limit of 100 MB applies to the length of the records. If you set Record detection to Parsed Record Sequence, the TCPIPServerReceive node does not determine or limit the length of a record. Nodes that are downstream in the message flow might try to determine the record length or process a very long record. If you intend to process large records in this way, ensure that your broker has sufficient memory. You might need to apply flow techniques described in the Large Messaging sample to best use the available memory. v If you set Record detection to Delimited, use Delimiter to specify the delimiter to be used. Choose from the following options: – DOS or UNIX Line End, on UNIX systems, specifies the line feed character (, X’0A’), and, on Windows systems, specifies a carriage return character followed by a line feed character (, X’0D0A’). The node treats both of these strings as delimiters, irrespective of the system on which the broker is running. If both strings are displayed in the same record, the node recognizes both as delimiters. The node does not recognize X’15’ which, on z/OS systems, is the ’newline’ byte; set this property to Custom Delimiter and set Custom delimiter to 15 if your input file is coded using EBCDIC new lines, such as EBCDIC files from a z/OS system. – Custom Delimiter (hexadecimal), permits a sequence of bytes to be specified in Custom delimiter (hexadecimal) v In Custom delimiter (hexadecimal), specify the delimiter byte or bytes to be used when Delimiter is set to Custom delimiter (hexadecimal). Specify this value as an even-numbered string of hexadecimal digits. The default is X’0A’ and the maximum length of the string is 16 bytes (represented by 32 hexadecimal digits). v If you set Record detection to Delimited, use Delimiter type to specify the type of delimiter. Permitted values are:
Message flows
1191
– Infix. If you select this value, each delimiter separates records. If the data ends with a delimiter, the (zero length) data following the final delimiter is still propagated, although it contains no data. – Postfix. If you specify this value, each delimiter ends records. If the data ends with a delimiter, no empty record is propagated after the delimiter. If the data does not end with a delimiter, it is processed as if a delimiter follows the final bytes of the data. Postfix is the default value. v The TCPIPServerReceive node considers each occurrence of the delimiter in the input as either separating (infix) or terminating (postfix) each record. If the data begins with a delimiter, the node treats the (zero length) contents preceding that delimiter as a record and propagates an empty record to the flow. The delimiter is never included in the propagated message. 9. Use the Validation tab to provide validation based on the message set for predefined messages. For more information about validation, see “Validating messages” on page 187. For information about how to provide validation for this tab, see “Validation tab properties” on page 1386.
Terminals and properties The terminals of the TCPIPServerReceive node are described in the following table. Terminal
Description
In
The input terminal that accepts a message for processing by the node.
Out
The output terminal to which the message is routed if it is successfully retrieved from an external resource. If no errors occur within the input node, a message received from an external resource is always sent to the Out terminal first.
Timeout
The terminal to which a message is sent when the time specified in the Timeout waiting for a data record property has been exceeded. The message text is Timeout value is exceeded.
Failure
The output terminal to which the message is routed if an error occurs. These errors include failures caused by retry processing. Even if the Validation property is set, messages propagated to this terminal are not validated.
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 TCPIPServerReceive node are described in the following table. Property
M
C
Default
Description
Node name
No
No
TCPIPServerReceive
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 Basic properties of the TCPIPServerReceive node are described in the following table.
1192
Message Flows
Property
M
C
Connection details
Yes
Yes
Timeout waiting for a data record (seconds)
Yes
Yes
Default
Description A string containing the port number to be used, or the name of a configurable service.
60
Specifies how long the node listens on a connection for more data after the first byte of data has arrived. You can specify any length of time in seconds. A value of -1 specifies that there is no time limit (wait forever).
The Advanced properties of the TCPIPServerReceive node are described in the following table. Property
M
C
Default
Description
Close connection
Yes
No
No
Controls when the connection is closed, or if it remains open. Valid options are: v No v After Timeout v After Data has been Received
Close input stream Yes after a record has been received
No
Cleared
Specifies whether to close the input stream as soon as the data has been retrieved. When the connection input stream is reserved, no other node can use it without knowing the ID. By default this property is not selected.
Input Stream Modification
No
Leave unchanged
Specifies whether to reserve the input stream for use only by input and receive nodes that specify the connection ID, or to release the input stream at the end of the flow. Valid options are:
No
v Leave unchanged v Release input stream v Reserve input stream (for use by future TCPIP nodes) v Reserve input stream (for use by future TCPIP nodes) then release at end of flow When the connection input stream is reserved, no other nodes can use it without specifying the correct connection ID. If the input stream is released after the message has been propagated, it is returned to the pool and becomes available for use by any input or receive node. Output Stream Modification
No
No
Leave unchanged
Specifies whether to reserve this output stream or release it and return it to the pool for use by any output node. Valid options are: v Leave unchanged v Release output stream v Reserve output stream (for use by future TCPIP nodes) v Reserve output stream (for use by future TCPIP nodes) then release at end of flow
The Request properties of the TCPIPServerReceive node are described in the following table:
Message flows
1193
Property
M
C
Default
Description
Port location
Yes
No
$LocalEnvironment/TCPIP/Receive/Port
The message element location that contains the Port.
ID location
Yes
No
$LocalEnvironment/TCPIP/Receive/Id
The message element location that contains the ID.
Reply ID location
Yes
No
$LocalEnvironment/TCPIP/Receive/ReplyId
The message element location that contains the Reply ID.
The Result properties of the TCPIPServerReceive node are described in the following table: Property
M
C
Default
Description
Output data location
No
No
$OutputRoot
The start location in the output message tree where the parsed elements from the bit string of the message are stored.
Copy local environment
No
No
Selected
Specifies whether the local environment is copied to the output message.
The Input Message Parsing properties of the TCPIPServerReceive node are described in the following table. Property
M
C
Default
Description
Message domain
No
No
The domain that is used to parse the incoming message.
Message set
No
No
The name or identifier of the message set in which the incoming message is defined. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message Set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message.
Message format
No
No
The name of the physical format of the incoming message.
Message coded character set ID
Yes
No
Broker System Default
The ID of the coded character set used to interpret the data being read.
Message encoding
Yes
No
Broker System Determined
The encoding scheme for numbers and large characters used to interpret the data being read. Valid values are Broker System Determined or a numeric encoding value. For more information about encoding, see “Converting data with message flows” on page 150.
The Parser Options properties of the TCPIPServerReceive node are described in the following table.
1194
Message Flows
Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an input message is parsed. Valid values are: v On Demand v Immediate v Complete For a full description of this property, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the syntax elements in the message tree have data types taken from the XML Schema.
Use XMLNSC compact No parser for XMLNS domain
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing property, Message Domain, is XMLNS.
Retain mixed content
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions
No
No
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the input message that are to be opaquely parsed by the XMLNSC parser.
The Records and Elements properties of the TCPIPServerReceive node are described in the following table: Property
M
C
Default
Description
Record detection
Yes
No
Connection closed
The mechanism used to identify records in the input data. Valid options are: v Connection closed v Fixed Length v Delimited v Parsed Record Sequence
Length (bytes)
Yes
No
0
The length of each record, in bytes, when Fixed Length record detection is selected.
Message flows
1195
Property
M
C
Default
Description
Delimiter
Yes
No
DOS or UNIX Line End
The type of delimiter bytes that separate, or ends, each record when Delimited record detection is selected. Valid options are: v DOS or UNIX Line End v Custom Delimiter (Hexadecimal)
Custom delimiter (hexadecimal)
No
No
Delimiter type
Yes
No
The delimiter bytes, expressed in hexadecimal, when Delimited record detection and Custom Delimiter (Hexadecimal) are selected. This property is mandatory only if the Delimiter property is set to Custom Delimiter (Hexadecimal). Postfix
The location of the delimiter when Delimited record detection and Custom Delimiter (Hexadecimal) are selected. Valid options are: v Infix v Postfix This property is ignored unless the Delimiter property is set to Custom Delimiter (Hexadecimal).
The Validation properties of the TCPIPServerReceive node are described in the following table. For a full description of these properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are v None v Content and Value v Content v Inherit
Failure action
No
No
Exception
This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are: v User Trace v Local Error Log v Exception v Exception List
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
1196
Message Flows
|
Throw node Use the Throw node to throw an exception within a message flow. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties”
Purpose An exception can be caught and processed by: v A preceding TryCatch node v The message flow input node (the built-in nodes, for example HTTPInput and MQInput, have Catch terminals) v 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 ExceptionList subtree within the message. The Throw node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following samples to see how to use this node: v Airline Reservations sample v Error Handler sample v Large Messaging sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. 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” on page 259. 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. Message flows
1197
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 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. Property
M
C
Default
Description
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. Property
M
C
Message Catalog
No
No
Message Number
No
No
Message Text
No
No
Default Description 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 WebSphere Message Broker. To use the default supplied catalog, leave this property blank. 3001
The error number of the exception that is being thrown. v 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. v If you are using the default message catalog, specify a number between 3001 (the default) and 3049. These numbers are reserved in the default 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. 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 number If you are using the default message catalog, this text is inserted as &1 in the message text.
The Monitoring properties of the node are described in the following table:
|
1198
Message Flows
||
Property
M
C
| | | | |
Events
No
No
Default
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 using monitoring properties” on page 130 for details.
| | | |
Description
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TimeoutControl node Use the TimeoutControl node to process an input message that contains a timeout request. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties” on page 1200
Purpose The TimeoutControl node validates the timeout request message, stores the message, and propagates the message (unchanged) to the next node in the message flow. For more information, see “Sending timeout request messages” on page 656. The TimeoutControl node is contained in the Timer drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Use a TimeoutControl node and a TimeoutNotification node together in a message flow for an application that requires events to occur at particular times, or at regular intervals. These examples show when you must use the timeout nodes in a message flow: v You need to run a batch job every day at midnight. v You want information about currency exchange rates to be sent to banks at hourly intervals. v You want to confirm that important transactions are processed within a certain time period and perform some other specified actions to warn when a transaction has not been processed in that time period. You can use more than one TimeoutControl node with a TimeoutNotification node. Timeout requests that are initiated by those TimeoutControl nodes are all processed by the same TimeoutNotification node if the same Unique identifier is used for the TimeoutNotification node and each of the TimeoutControl nodes. Look at the following sample for more details about how to use the timeout processing nodes: v Timeout Processing sample Message flows
1199
You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the TimeoutControl node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 TimeoutControl node terminals are described in the following table. Terminal Description In
The input terminal that accepts a message tree for processing (which includes validating the timeout request specified in the message tree at Request location) and adds it to the control queue.
Failure
The output terminal to which the input message is propagated if a failure is detected during processing in this node. If this terminal is not connected to another node, error information is passed back to the previous node in the message flow.
Out
The output terminal to which incoming messages are propagated, unchanged, after successful timeout request processing. If this terminal is not connected to another node, no propagation occurs. If propagation of the message fails, the message is propagated to the Failure terminal.
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 TimeoutControl node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type, TimeoutControl
The name of the node.
Short No description
No
A brief description of the node.
Long No description
No
Text that describes the purpose of the node in the message flow.
The Basic properties of the TimeoutControl node are described in the following table. Property
M
C
Default
Description
Unique identifier
Yes
Yes
None
This is the only mandatory property for the node. Its value must be unique within the broker. The equivalent property of the TimeoutNotification node with which it is paired must have the same value. The maximum length of this identifier is 12 characters.
1200
Message Flows
Property
M
C
Default
Description
Request location
No
No
None
This property describes where to find the timeout request information in the incoming message. This value can be any valid location in the input message tree and is validated at run time. If you do not specify a request location, InputLocalEnvironment.TimeoutRequest is assumed. For more information about the timeout request message, see “Sending timeout request messages” on page 656.
Request persistence
No
No
Automatic
This property controls whether an incoming timeout request survives a restart of either the broker or the message flow that contains the TimeoutNotification node that is paired with this TimeoutControl node. Select Yes if you want the incoming request to persist; select No if you do not. If you select Automatic (the default), the Persistence setting in the Properties folder of the incoming message is used.
The Message properties of the TimeoutControl node are described in the following table. Property
M
C
Default
Description
Stored message location
No
No
None
This property identifies the location of the part of the request message that you want to store for propagation by the TimeoutNotification node with which this node is paired. If you do not specify a value, the entire message is stored. You can specify any valid location in the message tree. If you choose to store the entire message, you do not need to specify any values in Message domain, Message set, Message type, or Message format.
Message domain
No
No
BLOB
The domain that is used to parse the stored timeout request message by the TimeoutNotification node. If you do not specify a value and the message location is stored, the default value is BLOB. Select the name of the parser that you are using. This value, and the three corresponding values in Message set, Message type, and Message format, are used by the TimeoutNotification node with which it is paired when it rebuilds the stored message for propagation. If you have stored the entire request message (by leaving Stored message location blank), do not specify any values here. If you choose to store part of the request message, specify values here that reflect the stored request message fragment as if it were the entire message, which is the case when it is processed by the TimeoutNotification node. Choose from the following parsers: v MRM v XMLNSC v XMLNS v BLOB v XML (this domain is deprecated; use XMLNSC) You can also specify a user-defined parser, if appropriate.
Message set
No
No
None
The name or identifier of the message set in which the stored timeout request message is defined. If you are using the MRM parser, or the XMLNSC parser in validating mode, select the Message set that you want to use from the list. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
None
The name of the stored timeout request message. If you are using the MRM parser, select the correct message from the list in Message type. This list is populated with messages that are defined in the Message set that you have selected.
Message flows
1201
Property
M
C
Default
Description
Message format
No
No
None
The name of the physical format of the stored timeout request message. If you are using the MRM parser, select the format of the message from the list in Message format. This list includes all the physical formats that you have defined for this Message set.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TimeoutNotification node
|
Use the TimeoutNotification node to manage timeout-dependent message flows, This topic contains the following sections: v “Purpose” v “Using this node in a message flow” v “Terminals and properties” on page 1203
Purpose The TimeoutNotification node is an input node that you can use in two ways: v A TimeoutNotification node can be paired with one or more TimeoutControl nodes. The TimeoutNotification node processes timeout request messages that are sent by the TimeoutControl nodes with which it is paired, and propagates copies of the messages (or selected fragments of the messages) to the next node in the message flow. v A TimeoutNotification node can be used as a stand-alone node. Generated messages are propagated to the next node in the message flow at time intervals that are specified in the configuration of this node. The TimeoutNotification node is contained in the Timer drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Use a TimeoutControl node and a TimeoutNotification node together in a message flow for an application that requires events to occur at a particular time, or at regular intervals; for example, when you want a batch job to run every day at midnight, or you want information about currency exchange rates to be sent to banks at hourly intervals.
1202
Message Flows
You can use more than one TimeoutControl node with a TimeoutNotification node. Timeout requests that are initiated by those TimeoutControl nodes are all processed by the same TimeoutNotification node if the same Unique Identifier is used for the TimeoutNotification node and each of the TimeoutControl nodes. However, do not use the same Unique Identifier for more than one TimeoutNotification node. When a TimeoutNotification node is started as a result of the broker starting, or by the message flow that contains the node starting, it scans its internal timeout store and purges any non-persistent timeout requests. Notifications are issued for any persistent timeout requests that are now past and that have the IgnoreMissed property set to False. If you use a TimeoutNotification node to generate a WebSphere MQ message to an output node, such as theMQOutput node, provide a valid MQMD. You must also provide a valid MQMD if the TimeoutNotification node is running in automatic mode (as a stand-alone node). If the TimeoutNotification node is running in controlled mode (that is, it is paired with one or more TimeoutControl nodes), you must provide a valid MQMD only if the stored messages do not already have an MQMD. The following ESQL shows how to provide a valid MQMD: CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD'; SET OutputRoot.MQMD.Version = MQMD_CURRENT_VERSION; SET OutputRoot.MQMD.Format = 'XML';
Look at the following sample for more details about how to use the timeout processing nodes: v Timeout Processing sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the TimeoutNotification node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 terminals of the TimeoutNotification node are described in the following table. Terminal Description Failure
The output terminal to which the message is propagated if a failure is detected during processing in this node. Nodes can be connected to this terminal to process these failures. If this terminal is not connected to another node, messages are not propagated and no logging or safe storage of data occurs.
Out
The output terminal to which messages are propagated after timeouts expire. v If the TimeoutNotification node is running in Automatic mode (that is, there are no TimeoutControl nodes paired with this node), the propagated messages contain only a Properties folder and a LocalEnvironment that is populated with the timeout information. v If the TimeoutNotification node is running in Controlled mode (that is, TimeoutControl nodes that are paired with this node store timeout requests), the propagated messages contain what was stored by the TimeoutControl nodes, which might be entire request messages or fragments of them. If the TimeoutNotification node is used as the input node to a message flow that generates a WebSphere MQ message (for example, by using an MQOutput node), the message flow must create the necessary MQ headers and data (for example, MQMD).
Message flows
1203
Terminal Description Catch
The output terminal to which the message is propagated if an exception is thrown downstream. If this terminal is not connected to another node, the following events occur: 1. The TimeoutNotification node writes the error to the local error log. 2. The TimeoutNotification node repeatedly tries to process the request until the problem that caused the exception is resolved.
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 TimeoutNotification node are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type: TimeoutNotification
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 Basic properties of the TimeoutNotification node are described in the following table. Property
M
C
Default
Description
Unique Identifier
Yes
Yes
None
This property specifies a value that is unique within the broker and that is the same as the identifier that is specified for the TimeoutControl nodes with which this node is paired (if there are any). The maximum length of this identifier is 12 characters. Do not use the same Unique Identifier for more than one TimeoutNotification node.
Transaction No Mode
1204
No
Message Flows
Yes
The transaction mode for the node. If the transaction mode is Automatic, a transaction is based on the persistence of the stored messages, which is controlled by the Request Persistence property of the TimeoutControl node with which it is paired. You can set this property to one of the following values: v Select Yes, if you want a transaction to be started. v Select No, if you do not want a transaction to be started. v Select Automatic, only if you have set Operation Mode to Controlled. Whether a transaction is started depends on the persistence of the stored timeout requests, which is controlled by the value of Request Persistence in the TimeoutControl node with which it is paired.
Property
M
C
Default
Description
Operation No Mode
No
Automatic
This property indicates whether this node is paired with any paired TimeoutControl nodes. Valid values are: v If you select Automatic, the node is not paired with any TimeoutControl nodes. The node generates timeout requests with an interval that is controlled by the setting of the Timeout Value property, which must be a positive integer. v If you select Controlled, the node processes all timeout requests that have been stored by the TimeoutControl nodes with which it is paired.
Timeout Interval
No
1
The interval (in seconds) between timeout requests. This property is relevant only if Operation Mode is set to Automatic.
No
The value of this property must be a positive integer.
The properties of the Parser Options for the TimeoutNotification node are described in the following table. Property
M
C
Default
Description
Parse Timing
No
No
On This property controls when the timeout message is parsed. Valid Demand values are On Demand, Immediate, and Complete. By default, this property is set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
Use MQRFH2C Compact Parser for MQRFH2 Domain
No
No
Cleared
This property controls whether the MQRFH2C Compact Parser, instead of the MQRFH2 parser, is used for MQRFH2 headers.
Use XMLNSC Compact Parser for XMLNS Domain
No
No
Cleared
This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input RFH2 header or default properties Domain is XMLNS.
Retain Mixed Content
No
No
None
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in a timeout message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain Comments
No
No
None
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in a timeout message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain Processing Instructions
No
No
None
This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in a timeout message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Message flows
1205
Property
M
C
Default
Description
Opaque elements
No
No
Blank
This property is used to specify a list of elements in the timeout message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if Validate is None); entries that are specified in Opaque Elements are ignored if validation is enabled.
The Validation properties of the TimeoutNotification node are described in the following table. If a message is propagated to the Failure terminal of the node, it is not validated. For more information, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content, and Content And Value.
Failure Action
No
No
Exception This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Trace node
|
Use the Trace node to generate trace records that you can use to monitor the behavior of a message flow. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1207 v “Terminals and properties” on page 1207
Purpose Trace records can incorporate text, message content, and date and time information, to help you to monitor the behavior of the message flow. You can choose to write the records to the user trace file, another file, or the local error log (which contains error and information messages written by all other WebSphere Message Broker components). If you write traces to the local error log, you can issue a message from the default message catalog that is supplied with WebSphere Message Broker, or you can create your own message catalog.
1206
Message Flows
The operation of the Trace node is independent of the setting of user tracing for the message flow that contains it. In particular, records that are written by the Trace node to the user trace log are written even if user trace is not currently active for the message flow. The Trace node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following samples to see how to use this node: v Airline Reservations sample v Aggregation sample v Timeout Processing sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Include a Trace node to help diagnose errors in your message flow. By tracing the contents of the message at various points in the flow, you can determine the sequence of processing. You can configure the Trace node to record the content of a message, and to check the action of a specific node on the message. For example, you can include a Trace node immediately after a Compute node to check that the output message has the expected format. You can also use the Trace node to provide information in error handling within your message flows. For example, you can use this node to record failures in processing due to errors in the content or format of a message. When you have tested the message flow and proved that its operation is correct, remove Trace nodes from your message flow, or switch them off.
Terminals and properties When you have put an instance of the Trace node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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 terminals of the Trace node are described in the following table. Terminal
Description
In
The input terminal that accepts a message for processing by the node.
Out
The output terminal through which the message is propagated.
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). Message flows
1207
The Description properties of the Trace node are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type: Trace
The name of the node.
Short No Description
No
A brief description of the node.
Long No Description
No
Text that describes the purpose of the node in the message flow.
The Basic properties of the Trace node are described in the following table. Property
M
Destination Yes
C
Default
Description
No
User Trace
The destination of the trace record that is written by the node. The Destination refers to the computer that hosts the broker on which the Trace node is deployed: v To write the trace record to the local system error log, select Local Error Log. The information that you include in the trace record is written to one of the following locations: – –
Windows On Windows systems, data is written to the Event log (Application View) Linux
UNIX
On Linux and UNIX systems, data is written to the
syslog –
| | |
z/OS
On z/OS systems, data is written to the operator console
UNIX On UNIX systems, syslog entries are restricted in length and messages are truncated by the new line character. To record a large amount of data in a log, set the destination to File or User Trace instead.
If you select Local Error Log, indicate the number of the trace message that is to be written, and the message catalog in which the message is defined. – If you leave Message Catalog blank, the default message catalog is used as the source of the message that is to be written. You must also enter the error number of the record in Message Number. Numbers 3051 to 3099 are reserved in the default catalog for this use. The text of each of these messages in the default message catalog is identical, but if you use a different number within this range for each situation that you trace, you can identify the exact cause of the error. The default message number is 3051. – If you create your own message catalog, enter the fully-qualified file name for your catalog in Message Catalog. You must also enter the appropriate number for the message in the catalog that you want to write to the local error log in Message Number. On some systems, message numbers that end 00 are reserved for system use; do not include messages with numbers like 3100 in your message catalog.
1208
Message Flows
Property
M
C
Default
Description v To write the trace record to the system-generated user trace log, select User Trace. These records are written regardless of the setting of the User Trace property for the deployed message flow. The location of the trace logs depends on your environment: Windows
Windows If you set the workpath using the -w parameter of the mqsicreatebroker command, the location is workpath\log.
| | | | | | | | |
If you have not specified the broker workpath, the location is:%ALLUSERSPROFILE%\Application Data\IBM\MQSIcommon\ log where %ALLUSERSPROFILE% is the environment variable that defines the system working directory. The default directory depends on the operating system:
|
The actual value might be different on your computer.
– On Windows XP and Windows Server 2003: C:\Documents and Settings\All Users\Application Data\IBM\MQSIcommon\log – On Windows Vista and Windows Server 2008: C:\ProgramData\IBM\MQSIcommon\log
Linux
UNIX
Linux and UNIX /var/mqsi/common/log
z/OS
z/OS /component_filesystem/log
The file name is made up of the broker name, the broker UUID, and a suffix of userTrace.bin (for example, broker.e51906cb-dd00-0000-0080b10e69a5d551.userTrace.bin.0). Use the mqsireadlog and mqsiformatlog commands before you view the user trace log. v To write the trace record to a file of your choice, select File. If you select this option, you must also set File Path to the fully-qualified path name for the trace. If you do not set the path, the location of the file depends on the system; for example, on z/OS, the file is created within the home directory of the broker service ID. You can use any name for the trace file; for example, c:\user\trace\trace.log If you specify a file that does not exist already, the file is created. However, directories are not created by this process, so the full path must already exist. The file is written as text, in the format specified by the Pattern property. You do not need to run the mqsireadlog or mqsiformatlog commands against the file. v If you do not want to write any trace records, select None. You can also switch Trace nodes off. File Path
No
Yes
The fully-qualified file name of the file to which to write records. This property is valid only if Destination is set to File.
Message flows
1209
Property
M
C
Pattern
No
No
Default
Description The data that is to be included in the trace record. Create an ESQL pattern to specify what information to write. If you write the trace record to the local error log, the pattern governs the information that is written in the text of the message number that is selected. If you use the default message catalog, and a number between 3051 and 3099, the pattern information is inserted as &1 in the message text. v You can write plain text, which is copied into the trace record exactly as you have entered it. v You can identify parts of the message to write to the trace record, specifying the full field identifiers enclosed within the characters ${ and }. To record the entire message, specify ${Root}. v Use the ESQL functions to provide additional information; for example, use the ESQL function CURRENT_DATE to record the date, time, or both, at which the trace record is written. The pattern below illustrates some of the options that are available. The pattern writes an initial line of text, records two elements of the current message, and adds a simple timestamp: Message passed through with the following fields: Store name is ${Body.storedetailselement.storename} Total sales are ${Body.totalselement.totalsales} Time is: ${EXTRACT(HOUR FROM CURRENT_TIMESTAMP)} :${EXTRACT(MINUTE FROM CURRENT_TIMESTAMP)} The resulting trace record is: Message passed through with the following fields: Store name is 'SRUCorporation' Total sales are '34.98' Time is: 11:19 A pattern that contains syntax errors does not prevent a message flow that contains the Trace node from deploying, but the node writes no trace records.
Message Catalog
No
No
Message Number
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 that is supplied with WebSphere Message Broker. See Creating message catalogs for more information. 3051
The error number of the message that is written.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TryCatch node
|
Use the TryCatch node to provide a special handler for exception processing. This topic contains the following sections:
1210
Message Flows
v v v v
“Purpose” “Using this node in a message flow” “Connecting the terminals” “Terminals and properties” on page 1212
Purpose Initially, the input message is routed on the Try terminal, which you must connect to the remaining non-error processing nodes of the message flow. If a downstream node (which can be a Throw node) throws an exception, the TryCatch node catches it and routes the original message to its Catch terminal. Connect the Catch terminal to further nodes to provide error processing for the message after an exception. If the Catch terminal is connected, the message is propagated to it. If the Catch terminal is not connected, the message is discarded. The TryCatch node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Look at the following sample to see how to use this node: v Error Handler sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. Use the Throw and TryCatch nodes when you use the Compute node to calculate a total. You can create a message that is sent to your system administrator when the total that is calculated exceeds the maximum value for the Total field.
Connecting the terminals The TryCatch node has no configurable properties that affect its operation. You determine how it operates by connecting the output terminals to subsequent nodes in your message flow. 1. Connect the Try terminal to the first node in the sequence of nodes that provides the normal (non-error) phase of processing of this message. This sequence can contain one or more nodes that perform any valid processing. The sequence of nodes can optionally conclude with an output node. 2. Connect the Catch terminal to the first node in the sequence of nodes that provides the error processing for this message flow. This sequence can contain one or more nodes that perform any valid processing. The sequence of nodes can optionally conclude with an output node. When an exception is thrown in the message flow, either by the explicit use of the Throw node or the ESQL THROW statement, or by the broker raising an implicit exception when it detects an error that the message flow is not programmed to handle, control returns to the TryCatch node. The message is propagated through the Catch terminal and the error handling that you have designed is executed. The message that is propagated through this terminal has the content that it had at the point at which the exception was thrown, including the full description of the exception in the ExceptionList.
Message flows
1211
Terminals and properties When you have put an instance of the TryCatch node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. The TryCatch node terminals are described in the following table. Terminal Description In
The input terminal that accepts a message for processing by the node.
Catch
The output terminal to which the message is propagated if an exception is thrown downstream and caught by this node.
Try
The output terminal to which the message is propagated if it is not caught.
The following table describes 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 TryCatch node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type: TryCatch
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 Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
TwineballInput node
|
Use the TwineballInput node to find out how the WebSphere Adapters nodes work. This topic contains the following sections: v “Purpose” on page 1213 v “Terminals and properties” on page 1213
1212
Message Flows
Purpose The TwineballInput node is provided for educational purposes and helps you to see how the WebSphere Adapters nodes work. The TwineballInput node is a sample node with its own sample EIS. You cannot use the TwineBall nodes to connect to the external SAP, Siebel, and PeopleSoft EIS systems. Do not use this node in production. The TwineballInput node is contained in the WebSphere Adapters drawer of the message flow node palette, and is represented in the workbench by the following icon:
You can use the mqsisetdbparms command in the following format to configure an account name with a user name and password for the Twineball adapter. mqsisetdbparms broker name -n adapter name -u user name -p password
For example: mqsisetdbparms BRK1 -n TwineballInbound.inadapter -u mqbroker -p ********
Look at the Twineball Example EIS Adapter sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the TwineballInput node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. If you double-click a TwineballInput node, you open the Adapter Connection wizard. 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 TwineballInput node terminals are described in the following table. Terminal
Description
Out
Business object events from the adapter are sent to the Out terminal.
Failure
If an error happens in the TwineballInput node, the message is propagated to the Failure terminal. Information about the error, and business object events can also be propagated to the Failure terminal.
Catch
Business object events are sent to the Catch terminal if they cause an uncaught exception in the message flow. If the Catch terminal is not connected, the retry process is activated to handle the business object.
The following table describes 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 TwineballInput node Description properties are described in the following table. Message flows
1213
Property
M
C
Default
Description
Node name
No
No
The node type, TwineballInput.
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 TwineballInput node Basic properties are described in the following table. Property
M
C
Default
Adapter component
Yes
Yes
Description The name of the adapter component that contains configuration properties for the adapter. Either enter a name of an adapter file or click Browse to select an adapter file from the list of files that are available in referenced message set projects.
The TwineballInput node Routing properties are described in the following table. Property
M
C
Default Description
Set No destination list
No
Selected This property specifies whether to add the method binding name to the route to label destination list. If you select this check box, the method binding name is added so that you can use a RouteToLabel node in the message flow after the TwineballInput node.
Label prefix
No
No
The prefix to add to the method name when routing to label. Add a label prefix to avoid a clash of corresponding label nodes when you include multiple WebSphere Adapters input nodes in the same message flow. By default, there is no label prefix, so the method name and label name are identical.
The TwineballInput node Input Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
DataObject
The domain that is used to parse the incoming message. By default, the message that is propagated from the TwineballInput node is in the DataObject domain. You cannot specify a different domain.
Message set
Yes
No
Set automatically
The name of the message set in which the incoming message is defined. This field is set automatically from the Adapter component property. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The name of the incoming message. The node detects the message type automatically. You cannot set this property.
Message format
No
No
The name of the physical format of the incoming message. You cannot set this property.
The TwineballInput node Transactionality properties are described in the following table.
1214
Message Flows
Property
M
Transaction No mode
C
Default Description
No
Yes
The transaction mode on this input node determines whether the rest of the nodes in the flow are executed under sync point.
The Instances properties of the TwineballInput node are described in the following table. For a full description of these properties, refer to “Configurable message flow properties” on page 1398. Property
M
C
Default
Description
Additional instances pool
No
Yes
Use Pool Associated with Message Flow
The pool from which additional instances are obtained. v If you select Use Pool Associated with Message Flow, additional instances are obtained from the message flow value. v If you select Use Pool Associated with Node, additional instances are allocated from the node’s additional instances based on the number specified in the Additional instances property.
Additional instances
No
Yes
0
The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node. By default, no additional instances are given to the node.
The TwineballInput node Retry properties are described in the following table. Property
M
Retry No mechanism
C
Default
Description
No
Failure
This property specifies how retry processing is handled when a failure is rolled back to the TwineballInput node. v If you select Failure, retry processing is not performed so you cannot set the remaining properties. v If you select Short and long retry, retry processing is performed first at the interval that is specified by the Short retry interval property, and if that is unsuccessful, it is then performed at the interval that is specified by the Long retry interval property.
Retry threshold
No
Yes
0
The maximum number of times that retry processing is performed for short retry.
Short retry interval
No
Yes
0
The interval between short retry attempts.
Long retry interval
No
Yes
0
The interval between long retry attempts.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Message flows
1215
TwineballRequest node
|
Use the TwineballRequest node to find out how WebSphere Adapters nodes work. This topic contains the following sections: v “Purpose” v “Terminals and properties”
Purpose The TwineballRequest node is provided for educational purposes and helps you to see how the WebSphere Adapters nodes work. The TwineballRequest node is a sample node with its own sample EIS. You cannot use the TwineBall nodes to connect to the external SAP, Siebel, and PeopleSoft EIS systems. Do not use this node in production. The TwineballRequest node is contained in the WebSphere Adapters drawer of the message flow node palette, and is represented in the workbench by the following icon:
You can use the mqsisetdbparms command in the following format to configure an account name with a user name and password for the Twineball adapter. mqsisetdbparms broker name -n adapter name -u user name -p password
For example: mqsisetdbparms BRK1 -n TwineballOutbound.outadapter -u mqbroker -p ********
Look at the Twineball Example EIS Adapter sample to see how to use this node. You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Terminals and properties When you have put an instance of the TwineballRequest node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. If you double-click a TwineballRequest node, you open the Adapter Connection wizard. 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 TwineballRequest node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts the request business object.
Out
The output terminal to which the response business object is sent if it represents successful completion of the request, and if further processing is required within this message flow.
Failure
If an error happens in the TwineballRequest node, the message is propagated to the Failure terminal. Information about the error, and business object events can also be propagated to the Failure terminal.
The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk on the panel if you
1216
Message Flows
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 TwineballRequest node Description properties are described in the following table. Property
M
C
Default
Description
Node name No
No
The node type, e.g. TwineballRequest
The name of the node.
Short No Description
No
A brief description of the node.
Long No Description
No
Text that describes the purpose of the node in the message flow.
The TwineballRequest node Basic properties are described in the following table. Property
M
C
Default
Description
Adapter component
Yes
No
The name of the adapter component that contains configuration properties for the adapter. Either enter a name of an adapter file, or click Browse to select an adapter file from the list of files that are available in referenced message set projects.
Default method
Yes
Yes
The default method binding to use.
The TwineballRequest node Response Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
DataObject
The domain that is used to parse the response message. By default, the response message that is propagated from the TwineballRequest node is in the DataObject domain. You cannot specify a different domain.
Message set
Yes
No
Set The name of the message set in which the incoming message is defined. automatically This field is set automatically from the Adapter component property. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type No
No
The name of the response message. The node detects the message type automatically. You cannot set this property.
Message format
No
The name of the physical format of the response message. You cannot set this property.
No
The TwineballRequest node Transactionality properties are described in the following table. Property
M
C
Default
Description
Transaction mode
No
No
Automatic This property specifies how updates are handled. If you select Yes, updates are performed in a single transaction. If you select No, updates are performed independently.
Message flows
1217
The TwineballRequest node Request properties are described in the following table. Property
M
C
Default
Description
Method Location
Yes
No
$LocalEnvironment/ Adapter/MethodName
The business method that is used to trigger the TwineballRequest node to perform an action on the external system. For example: v createPurchaseOrder causes the TwineballRequest node to create a purchase order in the EIS. v deletePurchaseOrder causes the TwineballRequest node to delete a purchase order in the EIS.
Data Location
Yes
No
$Body
The location in the incoming message tree from which data is retrieved to form the request that is sent from the TwineballRequest node to the EIS.
The TwineballRequest node Result properties are described in the following table. Property
M
C
Default
Description
Output data location
No
No
$OutputRoot The message tree location to which the TwineballRequest node sends output.
Copy local environment
No
No
Selected
This property controls how the local environment is copied to the output message. If you select the check box, at each node in the message flow, a new copy of the local environment is created in the tree, and it is populated with the contents of the local environment from the preceding node. So if a node changes the local environment, the upstream nodes do not see those changes because they have their own copies. This behavior might be an issue if you are using a FlowOrder node, or if you use the propagate command on a Compute node. If you clear the check box, each node does not generate its own copy of the local environment, but it uses the local environment that is passed to it by the previous node. So if a node changes the local environment, those changes are seen by the upstream nodes.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Validate node
|
Use the Validate node to check that the message that arrives on its input terminal is as expected. You can use this node to check that the message has the expected message template properties (the message domain, message set, and message type) and to check that the content of the message is correct by selecting message validation. This topic contains the following sections: v “Purpose” on page 1219
1218
Message Flows
v “Using this node in a message flow” v “Terminals and properties” on page 1220
Purpose The checks that you can perform depend on the domain of the message. Check
Domain
Check message domain
All domains
Check message set
XMLNSC, MRM, and IDOC only
Check message type
MRM only
Validate message body
XMLNSC, MRM and IDOC only
You can check the message against one or more of message domain, message set, or message type. The property is checked only if you select its corresponding check box, which means that a property that contains an empty string can be compared. You can check the content of the message by giving a value to the Validate property. Validation takes place if the Validate property is set to a value other than None, which is the default value. For validation failures to be returned to the Validate node from the parser, set the Failure Action property to either Exception or Exception List. Otherwise, validation failures are just logged. If all the specified checks pass, the message is propagated to the Match terminal of the node. If any of the checks fail, the message is propagated to the Failure terminal. If the Failure terminal is not connected to some failure handling processing, an exception is generated. The Validate node replaces the Check node, which is deprecated in WebSphere Message Broker Version 6.0 and subsequent releases. The Validate node works in the same way as the Check node, but it has additional Validation properties to allow the validation of message content by parsers that support that capability. The Validate node is contained in the Validation drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow Use the Validate node to confirm that a message has the correct message template properties, and has valid content, before propagating the message to the rest of the flow. Subsequent nodes can then rely on the message being correct, without doing their own error checking. You can also use the Validate node to ensure that the message is routed appropriately through the message flow. For example, configure the node to direct Message flows
1219
a message that requests stock purchases through a different route from that required for a message that requests stock sales. Another routing example is the receipt of electronic messages from your staff at your head office. These messages are used for multiple purposes (for example, to request technical support or stationery, or to advise you about new customer leads). These messages can be processed automatically because your staff complete a standard form. If you want these messages to be processed separately from other messages that are received, use the Validate node to ensure that only staff messages that have a specific message type are processed by this message flow.
Terminals and properties When you have put an instance of the Validate node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. 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 terminals of the Validate 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 message is routed if the incoming message does not match the specified properties.
Match
The output terminal to which the message is routed if the incoming message matches the specified properties.
The following tables describe the properties of the node. 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 Validate node are described in the following table. Property
M
C
Default
Description
Node name No
No
Validate
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 Validate node Basic properties are described in the following table.
1220
Message Flows
Property
M
C
Domain
No
No
Default Description The name of the domain. Select one of the following values from the list of the Domain property: v MRM v SOAP v XMLNSC v DataObject v XMLNS v JMSMap v JMSStream v MIME v BLOB v XML (deprecated - use XMLNSC) v IDOC (deprecated - use MRM) You can also specify a user-defined parser, if appropriate.
Check domain
Yes
No
Set
No
No
Cleared If you select this check box, the incoming message is checked against the Domain property. The name or identifier of the message set to which the incoming message belongs. If you are using the XMLNSC, MRM, or IDOC parser and want to check that the incoming message belongs to a particular message set, select Check set and select one of the values from the list of the Set property. This list is populated when you select XMLNSC, MRM, or IDOC as the message domain. Leave Set clear for the other parsers. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Set property, or restore the reference to this message set project.
Check set Yes
No
Type
No
No
Cleared If you select the check box, the incoming message is checked against the Set property. If you are using the XMLNSC, MRM, or IDOC parser and want to check that the incoming message belongs to a particular message set, select Check set and select one of the values from the list of the Set property. The message name. If you are using the MRM parser and want to check that the incoming message is a particular message type, select Check type and enter the name of the message in the Type property. Leave Type clear for the other parsers.
Check type
Yes
No
Cleared If you select the check box, the incoming message is checked against the Type property. If you are using the MRM parser and want to check that the incoming message is a particular message type, select Check type and enter the name of the message in the Type property.
The Validation properties of the Validate node are described in the following table. If you are using the XMLNSC, MRM, or IDOC parser and want to validate the body of messages against the message set, select the required validation properties on the Validation tab. For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Message flows
1221
Property
M
C
Default
Description
Failure Action
No
No
Exception This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
Default
Description 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 using monitoring properties” on page 130 for details.
| | |
You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Warehouse node
|
Use the Warehouse node to interact with a database in the specified ODBC data source. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1223 v “Terminals and properties” on page 1223
Purpose The Warehouse node is a specialized form of the Database node that stores the entire message, parts of the message, or both, in a table within the database. You define what is stored by creating mappings that use the data from the input message to identify the action that is required. You can use the Warehouse node: v To maintain an audit trail of messages that are passing through the broker v For offline or batch processing of messages that have passed through the broker (data mining) v As a source from which to reprocess selected messages in the broker Use standard database query and mining techniques to retrieve messages that you have stored in the warehouse. (No explicit support is provided by WebSphere Message Broker.) You must have created or identified the following items: v Input data in the form of a message set and message v An ODBC connection to the database v A database and database table to store the message v At least two columns in the table: one for the binary object (the message), and one for the timestamp The Warehouse node is contained in the Database drawer of the palette, and is represented in the workbench by the following icon:
1222
Message Flows
Using this node in a message flow When you use the Warehouse node, you can choose to store the following elements in the database that is associated with the node: v The entire message, optionally with an associated timestamp. The message is stored as a binary object, with the timestamp in a separate column. This option has two advantages: – You do not need to decide beforehand how you will use the warehoused data; because you have stored it all, you can retrieve all the data and apply data mining tools to it later. – You do not need to define a specific database schema for every type of message that might pass through the broker. In a complex system, many different message types might be processed, and the overhead of defining a unique schema for each message type can become prohibitive. You can precede each Warehouse node with a Compute node that converts each message into a canonical warehouse format with a common schema, or you can store the whole message as a binary object. v Selected parts of the message, optionally with an associated timestamp, which requires a defined database schema for that message type. The message is mapped to true type so, for example, a character string in the message is stored as a character string in the database.
Terminals and properties When you have put an instance of the Warehouse node into a message flow, you can configure it. For more information, see “Configuring a message flow node” on page 259. The properties of the node are displayed in the Properties view. (If you double-click a Warehouse 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. The terminals of the Warehouse 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 Warehouse node Description properties are described in the following table.
Message flows
1223
Property
M
C
Default
Description
Node name
No
No
Warehouse
The name of the node.
Short No description
No
A brief description of the node.
Long No description
No
Text that describes the purpose of the node in the message flow.
The Warehouse node Basic properties are described in the following table. Property
M
C
Data source
No
Yes
Default
Description The ODBC data source name of the database that contains the tables to which you refer in the mappings that are associated with this node (identified by the Field mapping property). The name identifies the appropriate database on the system on which this message flow is to run. 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 On z/OS systems, the broker uses the broker started task ID, or the user ID and password that are specified on the mqsisetdbparms command JCL, BIPSDBP in the customization data set .SBIPPROC.
Field mapping
Yes
No
Warehouse The name of the mapping routine that contains the statements that are to be executed against the database or the message tree. By default, the name that is assigned to the mapping routine is identical to the name of the mappings file in which the routine is defined, and 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_Warehouse.msgmap for the first Warehouse 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 Field mapping. To work with the mapping routine that is associated with this node, double-click the node, or right-click the node and select 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.msgmap in the Broker Development view. The content of the mapping routine determines what is stored in the database, and in what format. You can, for example, store all or just a part of each message. You can also store the data as binary data, or store each field in the same format as it is in the message (for example, a character field in the message is stored as character in the database). 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 Warehouse 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” on page 520.
1224
Message Flows
Property
M
C
Default
Transaction Yes
No
Automatic The transaction mode for the node. Select the value that you require: v If you select Automatic (the default), the message flow, of which the Warehouse node is a part, is committed if it is successful; that is, the actions that you define in the mappings are taken and the message continues through the message flow. If the message flow fails, it is rolled back. Therefore, selecting Automatic means that the ability to commit or roll back the action of the Warehouse node on the database depends on the success or failure of the entire message flow. v If you select Commit, any uncommitted actions that are taken in this message flow are committed on the database that is connected to this node, irrespective of the success or failure of the message flow as a whole. The changes to the database are committed even if the message flow itself fails.
Treat warnings as errors
No
Cleared
Yes
Description
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 by default. 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 typical return codes, and does not raise any exceptions. The most significant warning raised is not found, which can be handled as a typical return code safely in most circumstances.
Throw exception on database error
Yes
No
Selected
For the broker to generate an exception when a database error is detected, select Throw exception on database errors. The check box is selected by default. 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 can connect the Failure terminal to an error processing subroutine.
XSLTransform node Use the XSLTransform node to transform an XML message to another form of message, according to the rules provided by an XSL (Extensible Stylesheet Language) style sheet, and to set the Message domain, Message set, Message type, and Message format for the generated message. This node was formerly known as the XMLTransformation node. This topic contains the following sections: v “Purpose” v “Using this node in a message flow” on page 1226 v “Deployed and non-deployed style sheets” on page 1228 v “Configuring the XSLTransform node” on page 1230 v “Terminals and properties” on page 1232
Purpose You can specify the location of the style sheet to apply to this transformation in three ways:
Message flows
1225
v Use the content of the XML data within the message itself to transform the message according to a style sheet that the message itself defines. v Set a value within the LocalEnvironment folder. You must set this value in a node that precedes the XSLTransform node (for example, a Compute node). You can therefore use a variety of inputs to determine which style sheet to use for this message, such as the content of the message data, or a value in a database. v Use node properties to ensure that the transformation that is defined by this single style sheet is applied to every message that is processed by this node. An XSLT (Extensible Stylesheet Language for Transformations) compiler is used for the transformation if the style sheet is not embedded within the message, and the node cache level (node property Stylesheet Cache Level) is greater than zero. If the XSLT is cached, the performance is improved because the XSLT is not parsed every time it is used. If the prologue of the input message body contains an XML encoding declaration, the XSLTransform node ignores the encoding, and always uses the CodedCharSetId in the message property folder to decode the message. The XSLTransform node is contained in the Transformation drawer of the palette, and is represented in the workbench by the following icon:
Using this node in a message flow For an example of how to use this node, consider two news organizations that exchange information on a regular basis. One might be a television station, the other a newspaper. Although the information is similar, the vocabulary that is used by the two is different. This node can transform one format to the other by applying the rules of the specified style sheet. If you specify the style sheet in the message (either the XML data or the LocalEnvironment), the same node can perform both transformations. You cannot use relative path external entities that are defined in the DTD of input messages (for example, ]>). Use an absolute path definition. Look at the following sample for more details about how to use the XSLTransform node: v XSL Transform sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
Using LocalEnvironment variables to set properties This node supports a number of LocalEnvironment message tree variables, which you can use to dynamically alter the values that are set in the node’s properties. The following table lists each LocalEnvironment variable against the name of the node property that it overrides:
1226
Message Flows
Local environment variable name
Node property name
XSL.StyleSheetName
Stylesheet name
XSL.MessageDomain
Message domain
XSL.MessageSet
Message set
XSL.MessageType
Message type
XSL.MessageFormat
Message format
XSL.OutputCharSet
Character set
This node searches for the name of the style sheet to be used by interrogating, in the following order: 1. The input message. The node searches the message XML data for information about the location of the style sheet. For example, the XML data might contain:
and ″foo.xsl″ is then used as the name of the style sheet. 2. The LocalEnvironment. If no style sheet name is found in the input message, the node searches the LocalEnvironment that is associated with the current message for style sheet information stored in an element called XSL.StyleSheetName. This node was available in Version 5.0 and Version 6.0, and element ComIbmXslXmltStylesheetname was used for the name of the style sheet, therefore the current node checks both elements. If both are present, the value in XSL.StyleSheetName takes precedence. 3. The node’s properties. If no style sheet name is found in the input message or LocalEnvironment, the node uses the Stylesheet name and Stylesheet directory properties to determine the correct values. The node searches for the message domain, message set, message type, and message format to use for the output message by interrogating, in the following order: 1. The LocalEnvironment. The node searches the LocalEnvironment that is associated with the current message for message domain, message set, message type, and message format information stored, respectively, in elements called XSL.MessageDomain, XSL.MessageSet, XSL.MessageType, and XSL.MessageFormat. 2. The node’s properties. If no message domain, message set, message type, or message format information is found in these LocalEnvironment variables, the node uses, respectively, the Message domain, Message set, Message type, and Message format properties to determine the correct values. If the node cannot determine the message domain from either XSL.MessageDomain or the Message domain property, the default value of BLOB is used. There are no default values for message set, message type, and message format. The node searches for the character set to use for the output message by interrogating, in the following order: 1. The LocalEnvironment. The node searches the LocalEnvironment that is associated with the current message for character set information stored in an element called XSL.OutputCharSet; for example, to encode the output of the transformation as UTF-8, enter the value 1208 as a string in this element.
Message flows
1227
This node was available in Version 5.0 and Version 6.0, and element ComIbmXslXmltOutputcharset was used for the output character set, therefore the current node checks both elements. If both are present, the value in XSL.OutputCharSet takes precedence. 2. The node’s properties. If no character set information is found in the LocalEnvironment, the node uses the Character set property to determine the correct value. If you set a value for Character set, the value that you enter must be numeric; for example, to encode the output of the transformation as UTF-16, enter 1200. If the node cannot determine the output character set from either of these two sources, because either no value is set or the selection priorities are set to zero, the default value of 1208 (UTF-8) is used. You should be aware of certain considerations if the input to the XSLTransform node is generated from the XMLNSC parser or the MRM parser. The XMLNSC parser discards certain information in XML documents, such as processing instructions and comments, if you do not set properties to retain this information in a preceding node. To ensure that the XSLTransform node transforms the message correctly, set the Retain mixed content, Retain comments, and Retain processing instructions properties correctly on the preceding node (for example, an MQInput node). The MRM parser also discards this information, but you cannot retain information for this parser, therefore avoid using the MRM domain if such information is vital to your transformation.
Deployed and non-deployed style sheets You can use style sheets in two different ways with the XSLTransform node: Deployed style sheets Deployed style sheets are style sheets that you import into a broker archive (BAR) file and deploy to target systems. Deployed style sheets are managed by the broker. A principal style sheet is the root style sheet that is referenced in a message flow; for example, a reference to a principal style sheet in the Eclipse workspace, C:\\project1\a\b.xsl must be specified as a/b.xsl (or ./a/b.xsl). A principal style sheet can reference (include or import) its descendent style sheets. Non-deployed style sheets Non-deployed style sheets are style sheets that you store in a location where the XSLTransform node can access them. Non-deployed style sheets are not managed by the broker. For more information, see Migrating style sheets and XML files from Version 5.0.
Deployment of deployed style sheets or XML files Before you can configure the XSLTransform node, you must understand how to work with style sheets. A style sheet can refer to both another XML file and a style sheet. To use deployed style sheets or XML files: 1. Make sure that the files have the correct file name extensions. Style sheets that are to be deployed must have either .xsl or .xslt as their file extension, and XML files to be deployed must have .xml as their file extension. 2. Import the files into the Eclipse workspace. Import into an Eclipse workspace project all style sheets and XML files that are to be deployed. Put location-dependent descendant style sheets, or XML files
1228
Message Flows
that are to be deployed, in the correct directory structure relative to their parent style sheets. Do not put in the Eclipse workspace location-dependent descendants that you do not want to deploy. 3. Make sure that all references to the files are relative. Typically, all references to a deployed style sheet must be made relative, no matter where they are displayed. A reference to a principal style sheet must be made relative to the root of the relevant Eclipse workspace project. The only exception is when you specify a principal style sheet as the Stylesheet name property on an XSLTransform node; you can use an absolute path that points to the correct directory structure in the Eclipse workspace. If the principal style sheet is found, the system resets the node property automatically to the correct relative value. The system also performs an automatic deployment of the principal style sheet, together with all of its location-dependent descendant style sheets that are available in the relevant Eclipse workspace project. All references to the location-dependent descendant style sheets (or XML files) of a principal style sheet must be made relative to the location of their parent style sheets. For example, if style sheet //project1/a/b.xsl references style sheet //project1/a/c/d.xsl, the reference must be changed to c/d.xsl (or ./c/d.xsl). 4. Handle non-deployed child style sheets or XML files. Style sheets can refer to other style sheets. If you have a relatively-referenced child style sheet (or XML file) that is not to be deployed, yet its parent is, make sure that the child style sheet is placed in the correct location under workpath/XSL/external (workpath/XML/external), where workpath is the full path to the working directory of the broker. You can use the MQSI_WORKPATH environment variable to find the location of the workpath on your system; for example, on Windows XP systems, the default workpath is MQSI_WORKPATH=C:\Documents and Settings\All Users\Application Data\IBM\MQSI. A broker automatically associates the execution group deployed storage tree, workpath/XSL/external, and workpath/XML/external tree, together. Therefore if, for example, the document b/c.xml is not found in the broker’s deployed storage, the broker automatically searches for a reference to it in the workpath/XML/external/a/b directory in the deployed principal style sheet a/style.xsl. Relative path references must also be used for files that have been deployed but which are not available in the workspace. 5. Deploy the files. Deploy manually only those style sheets or XML files that are not picked up by the system (the Message Broker Toolkit provides warnings about these files). If you click Browse for the node, or provide the full path of the location of the style sheet in the Eclipse workspace, the style sheet is included automatically in the BAR file. To deploy manually, add the files to be deployed to a broker archive. For more information, see Adding files to a broker archive and “Adding keywords to XSL style sheets” on page 1234. For every execution group that uses the XSLTransform node, perform one of the following actions: v Include the style sheet in the workpath/XSL/external directory on the broker; do not include the style sheet in the BAR file. If a style sheet in the workpath/XSL/external directory shares the same path and name with a deployed style sheet, the deployed style sheet is used.
Message flows
1229
v Include the style sheet in the BAR file and deploy the BAR file. If multiple BAR files include the same style sheet name, the style sheet from the last BAR file that was deployed is used. v Deploy the style sheet in its own BAR file. If the BAR files use XSLTransform nodes, but do not include the style sheet, the Message Broker Toolkit issues warning messages.
Configuring the XSLTransform node When you have put an instance of the XSLTransform node into a message flow, you can configure it; see “Configuring a message flow node” on page 259. 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. Configure the XSLTransform node: 1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab. 2. On the Stylesheet tab, to specify a style sheet using node properties, enter the required value for Stylesheet name. Specify a principal style sheet using one of the following methods: v Click Browse next to Stylesheet name. The identified principal style sheet and all its relatively-referenced descendant style sheets are added automatically to the BAR file when you add a message flow to a BAR file (if both they and their parent style sheets are available). v To identify an already deployed, or ready to be deployed, style sheet, use the Stylesheet name property, and leave the Stylesheet directory property blank. v In the Message Flow editor, drag an .xslt file onto the XSLTransform node; the Stylesheet name is set automatically. 3. On the Advanced sub-tab: a. If the style sheet identification is fully qualified, Stylesheet directory is ignored; otherwise, the value that you set in this property is added to the beginning of the specification, regardless of where it is found. b. In Stylesheet cache level, specify the number of compiled or parsed style sheets that are stored in this instance of the node; the default value is 5. The style sheet cache is retained for the life of the node, and is cleared when the node is deleted from the flow, when the flow is deleted, or when the execution group is stopped. If you change a cached style sheet (by redeploying or replacing the file in the file system), the XSLTransform node that is holding the cache replaces the cached version with the modified (latest) version before a new message is processed. However, if you are changing several style sheets, stop relevant message flows before you make any changes. If you do not stop the relevant message flows before you make the changes, the order of the changes cannot be guaranteed by running message flows, which might cause an incompatibility between the style sheets that are changed. Use the mqsireload command to reload a style sheet; however, this command does not prevent incompatibility. 4. On the Output Message Parsing tab:
1230
Message Flows
a. To associate a specific parser with the output message, specify the new domain in Message domain. The default value is BLOB. This domain is applied to the output message. Alternatively, use Inherit to associate the parser that owned the input message. v MRM v XMLNSC v XMLNS v JMSMap v JMSStream v MIME v BLOB v XML (deprecated - use XMLNSC) v Inherit You can also specify a user-defined parser if appropriate. b. If you are using the MRM parser, or the XMLNSC parser in validating mode, select the Message set that you want to use. This list is populated with available message sets when you select MRM or XMLNSC as the domain. c. If you are using the MRM parser, select the correct message from the list in Message type. This list is populated with messages that are defined in the Message set that you have selected. d. If you are using the MRM parser, select the XML physical format for the output message from the list in Message format. This list includes all the physical formats that you have defined for this Message set. e. To specify a character set for the output message using node properties, specify the required value for Character set. The value that you specify must be numeric; for example, specify 1200 to encode the output message as UTF-16. 5. On the Parser Options sub-tab: a. Parse timing is, by default, set to On Demand, which causes parsing of the message to be delayed. To cause the message to be parsed immediately, see “Parsing on demand” on page 1389. b. If you are using the XMLNSC parser, set values for the properties that determine how the XMLNSC parser operates. For more information, see “Manipulating messages in the XMLNSC domain” on page 391. 6. On the Validation tab, set the validation properties for the parser to validate the body of messages against the Message set. (If a message is propagated to the Failure terminal of the node, it is not validated.) For more details, see “Validating messages” on page 187 and “Validation properties” on page 1385. 7. The Trace setting property on the Detail Trace tab is deprecated. Start user trace instead. The user trace contains the same XSL trace information. If you set Trace setting in the XSLTransform node, it does not affect user trace. If you have large XML messages and receive an out of memory error, use the mqsireportproperties command to see the current value of the Java Heap size for the XSLT engine: mqsireportproperties brokerName -e executionGroupLabel -o ComIbmJVMManager -n jvmMaxHeapSize
Use the mqsichangeproperties command to increase the Java Heap size: mqsichangeproperties brokerName -e executionGroupLabel -o ComIbmJVMManager -n jvmMaxHeapSize -v newSize Message flows
1231
In the previous examples, replace brokerName, executionGroupLabel, and newSize with the appropriate values. The value that you choose for newSize depends on the amount of physical memory that your computer has, and how much you are using Java. A value in the range 512 MB (536870912) to 1 GB (1073741824) is typically sufficient.
Terminals and properties The XSLTransform node terminals are described in the following table. Terminal
Description
In
The input terminal that accepts the message for processing by the node.
Failure
The output terminal to which the original message is routed if an error is detected during transformation.
Out
The output terminal to which the successfully transformed message is routed.
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 XSLTransform node Description properties are described in the following table. Property
M
C
Default
Description
Node name
No
No
The node type
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 XSLTransform node Stylesheet properties are described in the following table. Property
M
C
Stylesheet name
No
Yes
Default
Description The name of the style sheet, used if the style sheet specification is searched for in node properties.
The XSLTransform node Advanced properties are described in the following table. Property
M
C
Stylesheet directory
No
Yes
1232
Message Flows
Default
Description The path where the style sheet is located. This path is used by all location methods.
Property
M
C
Default
Description
Stylesheet cache level
No
No
5
The number of compiled or parsed style sheets that are stored in this instance of the node. Enter a positive integer between zero (0) and 100. The default value is 5. If you set this property to a character other than a positive integer, a flow configuration exception error message is issued. If you set this property to zero (0), no style sheet is cached, and style sheets are interpreted rather than compiled.
The XSLTransform node Output Message Parsing properties are described in the following table. Property
M
C
Default
Description
Message domain
No
No
BLOB
The message domain that is associated with the output message.
Message set
No
No
The message set that is associated with the output message. If you set this property, then subsequently update the project dependencies to remove this message set reference, a warning is issued. Either update the Message set property, or restore the reference to this message set project.
Message type
No
No
The message type that is associated with the output message.
Message format
No
No
The message format that is associated with the output message.
Character set
No
No
The numeric value of the character set for the output message.
The XSLTransform node Parser Options are described in the following table. Property
M
C
Default
Description
Parse timing
No
No
On Demand
This property controls when an output message is parsed. Valid values are On Demand, Immediate, and Complete. For a full description of parsing on demand, see “Parsing on demand” on page 1389.
Build tree using XML schema data types
No
No
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML Schema. You can select this property only if you set the Validate property to Content or Content and Value.
Use XMLNSC compact parser for XMLNS domain
No
No
No
This property controls whether the XMLNSC Compact Parser is used for output messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Domain is XMLNS.
Message flows
1233
The XSLTransform node Validation properties are described in the following table. For a full description of Validation properties, see “Validation properties” on page 1385. Property
M
C
Default
Description
Validate
No
Yes
None
This property controls whether validation takes place of the output message. Valid values are None, Content, Content and Value, and Inherit.
Failure action
No
No
Exception
This property controls what happens if validation of the output message fails. You can set this property only if you set Validate to Content and Value or Content. Valid values are User Trace, Local Error Log, Exception, and Exception List.
The XSLTransform node Detail Trace properties are described in the following table.
| | |
Property
M
C
Default
Description
Trace setting
Yes
No
Off
This property is deprecated. Start user trace instead. The user trace contains the same XSL trace information. If you set this property, it does not affect user trace.
| | |
In previous versions of WebSphere Message Broker, this property controls whether tracing is on or off. If tracing is on, low level tracing is recorded in a file.
The Monitoring properties of the node are described in the following table:
| ||
Property
M
C
| | | | |
Events
No
No
| | |
Default
Description 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 using monitoring properties” on page 130 for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box.
Adding keywords to XSL style sheets
|
Keywords can be embedded at any place in an XSL style sheet. The keyword can be added as an XML comment. XML comments must have the following format: $MQSI keyword = value MQSI$
The example shows how to add the keyword of author with the value John to an XML style sheet: , the sequence is replaced with the text -->. This ensures that the contents of the comment cannot prematurely terminate the comment. Occurrences of <, >, &, ″, and ’ are not translated to their escape sequences. Examples of the XML comment in an XML document and in tree structure form are shown below: <example>
1466
Message Flows
Element - name="example"
Comment - value=" This is a comment "
XML content This syntax element is the default value element supported by the XML parser. Use content to represent character data (including white space characters) that is part of the element content. There might be many content elements as children of a single element, in which case they are separated by other syntax element types such as nested elements or attributes. When content is written to a message, occurrences of ampersand (&), less than (<), greater than (>), double quotation mark (″), and apostrophe (’) are replaced by the predefined XML entities &, <, >, ", and '. The pcdata element is also supported for compatibility with earlier versions of the product.
XML element This syntax element is the default name element supported by the XML parser, and is one of the most common elements. The name of the syntax element corresponds to the name of the XML element in the message. This element can have many children, including attributes, elements, and content. The tag element is also supported for backward compatibility.
XML EntityReferenceStart and EntityReferenceEnd When an entity reference is encountered in the XML message, both the expanded form and the original entity name are stored in the syntax element tree. The name of the entity is stored as the value of the EntityReferenceStart and EntityReferenceEnd syntax elements, and any syntax elements between contain the entity expansion. Examples of the XML entity references in an XML document and in tree structure form are shown below: ]> <example>Test: &entityName;
Element - name="example"
Content - value="Test: "
EntityReferenceStart Content - value="entityName" - value="eValue"
EntityReferenceEnd - value="entityName"
Message flows
1467
The XML declaration and the document type declaration are not shown here. Refer to “The XML declaration” on page 1463 and “XML document type declaration” on page 1469 for details of those sections of the syntax element tree.
XML message body example: elements, attributes, and content Examples of an XML message body in an XML document and in tree structure form are shown below. The XML document contains elements, attributes, and content, and these items are shown in the tree structure. Cormac Keogh
Element - name="person"
Attribute - name="age" - value="32"
Attribute - name="height" - value="172cm"
Content - value="\n"
Element - name="Name"
Content - value="\n"
Content - value="Cormac Keogh"
XML ProcessingInstruction An XML processing instruction encountered outside the document type declaration is represented by the ProcessingInstruction syntax element. This is a name-value element; the name of the syntax element is the processing instruction target name, and the value of the syntax element is the character data of the processing instruction. The value of the syntax element must not be empty. The name cannot be XML in either uppercase or lowercase. If the value of the element contains the character sequence ?>, the sequence is replaced with the text ?>. This ensures that the content of the processing instruction cannot prematurely terminate the processing instruction. Occurrences of <,>, &, ″, and ’ are not translated to their escape sequences. Examples of the XML ProcessingInstruction in an XML document and in tree structure form are shown below: <example>
Element - name="example"
ProcessingInstruction - name="target" - value="This is a PI."
1468
Message Flows
XML document type declaration The document type declaration (DTD) of an XML message is represented by a syntax element of type DocTypeDecl and its children and descendants. These comprise the DOCTYPE construct. Only internal (inline) DTD subsets are represented in the syntax element tree. An inline DTD is a DTD that is declared within the XML document itself. It can be a complete DTD definition, or can extend the definition in an external DTD. External DTD subsets (identified by the SystemID or PublicId elements described below) can be referenced in the message, but those referenced are not resolved by the broker. Field type constants are defined by WebSphere Message Broker: v DocTypeDecl v NotationDecl v Entities v ElementDef v AttributeList v AttributeDef v DocTypePI v WhiteSpace and DocTypeWhiteSpace v DocTypeComment DTD example is an example of an XML DTD.
XML DocTypeDecl DocTypeDecl is a named element and is a child of the XML parser. DocTypeDecl is written to the bit stream before the element that represents the body of the document during serialization. The following attributes can be specified within this element: v IntSubset v PublicId v SystemId The example below is included in DTD example:
XML IntSubset: IntSubset is a named element that groups all those elements that represent the DTD constructs contained in the internal subset of the message. Although the IntSubset element is a named element, its name is not relevant. XML PublicId: PublicId is an element that represents a public identifier in an XML message. It can be part of a DocTypeDecl, NotationDecl, or UnparsedEntityDecl element. The value of the PublicId element is typically a URL. A public identifier of the form PUBLIC "//this/is/a/URI/test" has a string value of //this/is/a/URI/test.
Message flows
1469
XML SystemId: SystemId is a value element that represents a system identifier in an XML message. It can be part of a DocTypeDecl, NotationDecl, or UnparsedEntityDecl element. The value of the SystemId is a URI, and is typically a URL or the name of a file on the current system. A system identifier of the form SYSTEM "Note.dtd" has a string value of Note.dtd.
XML NotationDecl The NotationDecl element represents a notation declaration in an XML message. NotationDecl is a name element whose name corresponds to the name given with the notation declaration. It must have a SystemId as a child and it can optionally have a child element of type PublicId. For example:
The name of the NotationDecl is gif.
XML entities Entities in the DTD are represented by one of six named element types described below: v EntityDecl v EntityDeclValue v ExternalParameterEntityDecl v ExternalEntityDecl v ParameterEntityDecl v UnparsedEntityDecl XML EntityDecl: The EntityDecl element represents a general entity and is declared in the internal subset of the DTD. It is a named element and has a single child element, which is of type EntityDeclValue. An entity declaration of the form:
has an EntityDecl element of name bookTitle and a child element of type EntityDeclValue with a string value of User Guide. XML EntityDeclValue: The EntityDeclValue element represents the value of an EntityDecl or ParameterEntityDecl defined internally in the DOCTYPE construct. It is always a child of an element of one of those types, and is a value element. For the following entity:
bookTitle "User Guide">
the EntityDeclValue element has the string value User Guide. XML ExternalParameterEntityDecl: The ExternalParameterEntityDecl element represents a parameter entity definition where the entity definition is contained externally to the current message. It is a named element and has a child of type SystemId. It can also have a child of type
1470
Message Flows
PublicId. The name of the entity does not include the percent sign %. In XML an external parameter entity declaration takes the form:
This represents an ExternalParameterEntityDecl element of name bookDef with a single child of type SystemId with a string value of BOOKDEF.DTD. XML ExternalEntityDecl: The ExternalEntityDecl element represents a general entity where the entity definition is contained externally to the current message. It is a named element and has a child of type SystemId. It can also have a child of type PublicId. An external entity declaration of the form:
bookAppendix SYSTEM "appendix.txt">
has an EntityDecl element of name bookAppendix and a child element of type SystemId with a string value of appendix.txt. XML ParameterEntityDecl: The ParameterEntityDecl represents a parameter entity definition in the internal subset of the DTD. It is a named element and has a single child element that is of type EntityDeclValue. For parameter entities, the name of the entity does not include the percent sign %. In XML a parameter entity declaration takes the form:
XML UnparsedEntityDecl: An unparsed entity is an external entity whose external reference is not parsed by an XML processor. This means that you can include data in an XML document that is not well-formed XML, such as a graphic file. The UnparsedEntityDecl is named element and a child of type SystemId that identifies the URI for the entity (a URL or a local file location). UnparsedEntityDecl can optionally have a child of type PublicId. UnparsedEntityDecl can also have a child of type NotationReference, a value element that represents a reference to a notation declaration elsewhere in the XML document. It defines the type of data of the unparsed entity. An unparsed entity declaration takes the form:
In this example, the SystemId has a string value of scheme.gif. The value of NotationReference is gif. It refers to a NOTATION defined within the XML document:
The next entity is included in the DTD example:
This shows the optional PublicId element, which has the string value of //this/is/a/URI/me.gif.
Message flows
1471
XML ElementDef The ElementDef element represents the
The name of the element is subel2 and the value is (#PCDATA).
XML AttributeList The AttributeList name element represents the
el5satt CDATA #IMPLIED>
This example shows an AttributeList that defines one AttributeDef, and its content is explained in AttributeDef.
XML AttributeDef The AttributeDef name element describes the definition of an attribute within an
el5satt CDATA #IMPLIED>
The name of the AttributeDef is el5satt and it is a child of AttributeList el5. The name of the AttributeDefType is CDATA, and the value of the AttributeDefDefaultType is IMPLIED. XML AttributeDefValue: For attributes of type CDATA (see “XML AttributeDefType”), or defined by an enumerated list, the AttributeDefValue gives the default value of the attribute. For an example of AtrtibuteDefValue, see DTD example. XML AttributeDefType: The AttributeDefType syntax element is a name-value element whose name corresponds to the attribute type found in the attribute definition. Possible values for the name are: v CDATA v ID v IDREF
1472
Message Flows
v v v v v v
IDREFS ENTITY ENTITIES NMTOKEN NMTOKENS NOTATION
If there is an enumeration present for the attribute definition, the entire enumeration string is held as a string in the value member of the name-value syntax element. In this case, the name member of the name-value syntax element is empty. The value string starts with an open parenthesis ( and ends with a close parenthesis ). Each entry in the enumeration string is separated by a vertical bar | character. If the Attribute value is not defined by an enumerated list, the value member of the syntax element is empty. An example is included in AttributeDef. XML AttributeDefDefaultType: The AttributeDefDefaultType syntax element is a value element that represents the attribute default as defined under the attribute definition. The value can be one of the following strings: v #REQUIRED v #IMPLIED v #FIXED An example is included in AttributeDef.
XML DocTypeComment Comments in the XML DTD are represented by the DocTypeComment element. It is a value element for which the value string contains the comment text. This element follows the same processing rules as the Comment element. See “XML comment” on page 1466.
XML DocTypePI The DocTypePI element represents a processing instruction found within the DTD. The ProcessingInstruction element represents a processing instruction found in the XML message body. This element is a name-value element. The name of the element is used to store the processing instruction target name, and the value contains the character data of the processing instruction. The value of the element can be empty. The name cannot be the string XML in either uppercase or lowercase form. This element follows the same processing rules as the ProcessingInstruction element. See “XML ProcessingInstruction” on page 1468.
XML WhiteSpace and DocTypeWhiteSpace The WhiteSpace element represents any white space characters outside the message body and DTD that are not represented by any other element. For example, white space within the body of the message (within elements) is reported as element content using the Content element type, but white space characters between the XML declaration and the beginning of the message body are represented by the WhiteSpace element.
.... Message flows
1473
The characters between "1.0"?> and are represented by the WhiteSpace element. White space is used in XML for readability and has no business meaning. Input XML messages can include line breaks, blanks lines, and spaces between tags (all shown below). If you process XML messages that contain any of these spaces, they are represented as elements in the message tree. Therefore they appear when you view the message in the debugger, and in any trace output. <s1>......... <s2>abc <s2>def <s3>123
If you do not want white space elements in your message trees, you must present the input message as a single line, or use the XMLNSC compact parser in its default mode The DocTypeWhiteSpace element represents white space that is found inside the DTD that is not represented by any other element. White space characters found within a DocType between two definitions are represented by the DocTypeWhiteSpace element.
The characters between DTD"> and
XML DTD example This example shows an XML DTD in an XML document and the tree structure form of that document: ]>
When a message is parsed by the generic XML parser, the relevant part of the message tree looks like this (assuming that there are no carriage returns or white space between tags):
1474
Message Flows
XML
DocTypeDecl - name="test"
SystemId - value="test.dtd"
PublicId - value="//this/is/a/URI/test"
IntSubset
The IntSubset structure contains the following structures at the next level of nesting: the tree structure for each of these is shown in the tree structures below.
NotationDecl - name="teX"
SystemId - value="//TexID"
PublicId - value="//this/is/a/URI/TexID"
EntityDecl - name="ent1"
EntityDeclValue - value="this is a entity"
ParameterEntityDecl - name="ent2"
EntityDeclValue - value="#PCDATA | subel2"
ExternalParameterEntityDecl - name="extent1"
SystemId - value="more.txt"
PublicId - value="//this/is/a/URI/extent2"
Message flows
1475
ExternalEntityDecl - name="extent2"
SystemId - value="more.txt"
PublicId - value="//this/is/a/URI/extent2"
UnparsedEntityDecl - name="unpsd"
SystemId - value="me.gif"
PublicId - value="//this/is/a/URI/me.gif"
DocTypeWhiteSpace - value="
"
DocTypePI - name="test" - value="Do this"
DocTypeComment - value="this is a comment"
ElementDef - name="subel2" - value="(#PCDATA)"
ElementDef - name="subel1" - value="Subel2 | el4"
ElementDef - name="el1" - value="(#PCDATA)"
ElementDef - name="el2" - value="(#PCDATA | Subel2)*"
ElementDef - name="el3" - value="(#PCDATA | Subel2)*"
ElementDef - name="el4" - value="(#PCDATA)"
1476
Message Flows
NotationReference - value="TeX"
ElementDef - name="el5" - value="(#PCDATA | Subel1)*"
ElementDef - name="el6" - value="(#PCDATA)"
AttributeList - name="Subel1"
AttributeDef - name="size"
AttributeDef - name="shape"
AttributeDefType AttributeDefValue - value="(big | small)" - value="big" AttributeDefDefaultType - value="REQUIRED"
AttributeDefType - value="(round | square)"
AttributeList - name="el5"
AttributeDef - name="el5satt"
AttributeDefType - name="CDATA"
AttributeDefDefaultType - value="IMPLIED"
Data sources on z/OS The Data Source name in the Compute and Database nodes identifies the location of the table referred to in the respective node’s ESQL. Data sources on z/OS correspond to DB2 subsystems rather than DB2 databases. The DB2 owning region for a particular database table is identified using a combination of the DSNAOINI file and DB2 subsystem configuration. The MVSDEFAULTSSID parameter in the DSNAOINI file identifies the local DB2 subsystem to which the broker is connected. This subsystem is used to locate the data source which is either a local or remote DB2. The mapping between a particular data source and DB2 subsystem is shown in the DSNTIPR installation panel of the default DB2 subsystem and SYSIBM.LOCATIONS table.
Message flows
1477
When you access remote DB2 subsystems, ensure that the DBRMs for ODBC are bound at the remote subsystem. For more information, refer to the ’Programming for ODBC’ topics in the DB2 Information Management Software Information Center for z/OS Solutions . If you need to access databases that are not on DB2 on z/OS, you can use DB2’s Distributed Data Facility (DDF) and Distributed Relational Architecture (DRDA) to incorporate a remote unit of work within a message flow.
1478
Message Flows
ESQL reference SQL is the industry standard language for accessing and updating database data and ESQL is a language derived from SQL Version 3, particularly suited to manipulating both database and message data. This section covers the following topics: “Syntax diagrams: available types” on page 1480 This describes the formats that are available for viewing ESQL syntax diagrams. “ESQL data types in message flows” on page 1480 This describes the valid data types for ESQL. “ESQL field reference overview” on page 1493 This topic describes the syntax of field references. “Special characters, case sensitivity, and comments in ESQL” on page 1696 This describes the special characters you use when writing ESQL statements. “ESQL operators” on page 1500 This describes the operators that are available. “ESQL reserved keywords” on page 1698 This lists the reserved keywords which you cannot use for variable names. “ESQL non-reserved keywords” on page 1698 This lists the keywords that are not reserved, as well as those reserved for future releases, which you can use if you choose. “ESQL functions: reference material, organized by function type” on page 1592 This topic lists the functions available in ESQL, and what they do. “ESQL constants” on page 1692 This topic lists the constants available in ESQL, and what they do. “ESQL statements” on page 1507 This topic lists the different statement types available in ESQL, and what they do. “Calling ESQL functions” on page 1595 This topic describes all the ESQL functions in detail. “ESQL variables” on page 1493 This topic describes the types of ESQL variable and their lifetimes. “Broker properties that are accessible from ESQL and Java” on page 1693 This topic lists the broker attributes that can be accessed from ESQL code. An XML format message that is used in many of the ESQL examples in these topics is shown in “Example message” on page 1701. For information about how you can use ESQL statements and functions to configure Compute, Database, and Filter nodes, see “Writing ESQL” on page 305.
© Copyright IBM Corp. 2000, 2008
1479
Syntax diagrams: available types The syntax for commands and ESQL statements and functions is presented in the form of a diagram. The diagram tells you what you can do with the command, statement, or function and indicates relationships between different options and, sometimes, different values of an option. There are two types of syntax diagrams: railroad diagrams and dotted decimal diagrams. Railroad diagrams are a visual format suitable for sighted users. Dotted decimal diagrams are text-based diagrams that are more helpful for blind or partially-sighted users. To select which type of syntax diagram you use, click the appropriate button above the syntax diagram in the topic that you are viewing. The following topics describe how to interpret each type of diagram: v How to read railroad diagrams v How to read dotted decimal diagrams
ESQL data types in message flows All data that is referred to in message flows must be one of the defined types: v “ESQL BOOLEAN data type” v “ESQL datetime data types” v “ESQL NULL data type” on page 1485 v “ESQL numeric data types” on page 1486 v “ESQL REFERENCE data type” on page 1488 v “ESQL ROW data type” on page 1488 v “ESQL string data types” on page 1489
ESQL BOOLEAN data type The BOOLEAN data type holds a Boolean value which can have the values: v TRUE v FALSE v UNKNOWN Boolean literals consist of the keywords TRUE, FALSE, and UNKNOWN. The literals can appear in uppercase or lowercase. For further information about UNKNOWN, see the “IF statement” on page 1565.
ESQL datetime data types ESQL supports several data types that handle datetime values. The following data types are collectively known as datetime data types: v “ESQL DATE data type” on page 1481 v “ESQL TIME data type” on page 1481 v “ESQL GMTTIME data type” on page 1481 v “ESQL TIMESTAMP data type” on page 1481 v “ESQL GMTTIMESTAMP data type” on page 1482 v “ESQL INTERVAL data type” on page 1482 For information about datetime functions see “ESQL datetime functions” on page 1600.
1480
Message Flows
ESQL DATE data type The DATE data type holds a Gregorian calendar date (year, month, and day). The format of a DATE literal is the word DATE followed by a space, followed by a date in single quotation marks in the form ’yyyy-mm-dd’. For example: DECLARE MyDate DATE; SET MyDate = DATE '2000-02-29';
Do not omit leading zeroes from the year, month, and day.
ESQL TIME data type The TIME data type holds a time of day in hours, minutes, seconds, and fractions of a second. The format of a TIME literal is the word TIME followed by a space, followed by a time in single quotation marks in the form ’hh:mm:ss.ffffff’. For example: DECLARE MyTime TIME; SET MyTime = TIME '11:49:23.656';
Each of the hour, minute, and second fields in a TIME literal must always be two digits; the optional fractional seconds field can be up to 6 digits in length. The PutTime reported by WebSphere MQ on z/OS and other times or timestamps can be inconsistent if the CVT field is not set correctly. For details about when this problem can occur, and how to solve it, see The PutTime that is reported by WebSphere MQ on z/OS, and other times or timestamps are inconsistent.
ESQL GMTTIME data type The GMTTIME data type is similar to the TIME data type, except that its values are interpreted as values in Greenwich Mean Time. GMTTIME literals are defined in a similar way to TIME values. For example: DECLARE MyGetGmttime GMTTIME; SET MyGetGmttime = GMTTIME '12:00:00';
The PutTime reported by WebSphere MQ on z/OS and other times or timestamps can be inconsistent if the CVT field is not set correctly. For details about when this problem can occur, and how to solve it, see The PutTime that is reported by WebSphere MQ on z/OS, and other times or timestamps are inconsistent.
ESQL TIMESTAMP data type The TIMESTAMP data type holds a DATE and a TIME in years, months, days, hours, minutes, seconds, and fractions of a second. The format of a TIMESTAMP literal is the word TIMESTAMP followed by a space, followed by a time stamp in single quotation marks in the form ’yyyy-MM-dd HH:mm:ss.SSSSSS’. For example: DECLARE MyTimeStamp TIMESTAMP; SET MyTimeStamp = TIMESTAMP '1999-12-31 23:59:59';
The year field must always be four digits in length. The month, day, hour, and minute fields must always be two digits. (Do not omit leading zeros.) The optional fractional seconds field can be 0 - 6 digits long. For a description of the characters used when formatting a time stamp in the ESQL CAST function, see “Formatting and parsing dateTimes as strings” on page 1656
ESQL reference
1481
The PutTime reported by WebSphere MQ on z/OS and other times or time stamps can be inconsistent if the CVT field is not set correctly. For details about when this problem can occur, and how to solve it, see The PutTime that is reported by WebSphere MQ on z/OS, and other times or timestamps are inconsistent.
ESQL GMTTIMESTAMP data type The GMTTIMESTAMP data type is similar to the TIMESTAMP data type, except that the values are interpreted as values in Greenwich Mean Time. GMTTIMESTAMP values are defined in a similar way to TIMESTAMP values, for example: DECLARE MyGetGMTTimeStamp GMTTIMESTAMP; SET MyGetGMTTimeStamp = GMTTIMESTAMP '1999-12-31 23:59:59.999999';
The PutTime reported by WebSphere MQ on z/OS and other times or timestamps can be inconsistent if the CVT field is not set correctly. For details about when this problem can occur, and how to solve it, see The PutTime that is reported by WebSphere MQ on z/OS, and other times or timestamps are inconsistent.
ESQL INTERVAL data type The INTERVAL data type holds an interval of time. It has a number of subtypes: v YEAR v YEAR TO MONTH v MONTH v DAY v DAY TO HOUR v DAY TO MINUTE v DAY TO SECOND v HOUR v HOUR TO MINUTE v HOUR TO SECOND v MINUTE v MINUTE TO SECOND v SECOND All these subtypes describe intervals of time and all can take part in the full range of operations of the INTERVAL type; for example, addition and subtraction operations with values of type DATE, TIME, or TIMESTAMP. Use the CAST function to convert from one subtype to another, except for intervals described in years and months, or months, which cannot be converted to those described in days, hours, minutes, and seconds. The split between months and days arises because the number of days in each month varies. An interval of one month and a day is not meaningful, and cannot be sensibly converted into an equivalent interval in numbers of days only. An interval literal is defined by the syntax: INTERVAL
The format of interval string and interval qualifier are defined by the table below. Interval qualifier
Interval string format
Example
YEAR
’’ or ’<sign> ’
’10’ or ’-10’
YEAR TO MONTH
’-<month>’ or ’<sign> -<month>’
’2-06’ or ’- 2-06’
1482
Message Flows
Interval qualifier
Interval string format
Example
MONTH
’<month>’ or ’<sign> <month>’
’18’ or ’-18’
DAY
’’ or ’<sign> ’
’30’ or ’-30’
DAY TO HOUR
’ ’ or ’<sign> ’
’1 02’ or ’-1 02’
DAY TO MINUTE
’ :<minute>’ or ’<sign> :<minute>’
’1 02:30’ or ’-1 02:30’
DAY TO SECOND
’ :<minute>:<second>’ or ’<sign> :<minute>:<second>’
’1 02:30:15’ or ’-1 02:30:15.333’
HOUR
’’ or ’<sign> ’
’24’ or ’-24’
HOUR TO MINUTE
’:<minute>’ or ’<sign> :<minute>’
’1:30’ or ’-1:30’
HOUR TO SECOND
’:<minute>:<second>’ or ’<sign> :<minute>:<second>’
’1:29:59’ or ’-1:29:59.333’
MINUTE
’<minute>’ or ’<sign> <minute>’
’90’ or ’-90’
MINUTE TO SECOND
’<minute>:<second>’ or ’<sign> <minute>:<second>’
’89:59’ or ’-89:59’
SECOND
’<second>’ or ’<sign> <second>’
’15’ or ’-15.7’
Where an interval contains both a year and a month value, a hyphen is used between the two values. In this instance, the month value must be within the range [0, 11]. If an interval contains a month value and no year value, the month value is unconstrained. A space is used to separate days from the rest of the interval. If an interval contains more than one of HOUR, MINUTE, and SECOND, a colon is needed to separate the values and all except the leftmost are constrained as follows: HOUR 0-23 MINUTE 0-59 SECOND 0-59.999... The largest value of the left-most value in an interval is +/- 2147483647. Some examples of valid interval values are: v 72 hours v 3 days: 23 hours v 3600 seconds v 90 minutes: 5 seconds Some examples of invalid interval values are: v 3 days: 36 hours A day field is specified, so the hours field is constrained to [0,23]. v 1 hour: 90 minutes An hour field is specified, so minutes are constrained to [0,59]. Here are some examples of interval literals: ESQL reference
1483
INTERVAL '1' HOUR INTERVAL '90' MINUTE INTERVAL '1-06' YEAR TO MONTH
Representation of ESQL datetime data types When your application sends a message to a broker, the way in which the message data is interpreted depends on the content of the message itself and the configuration of the message flow. If your application sends a message to be interpreted either by the generic XML parser, or the MRM parser, that is tailored by an XML physical format, the application can include date or time data that is represented by any of the XML Schema primitive datetime data types. The XML Schema data type of each piece of data is converted to an ESQL data type, and the element that is created in the logical message tree is of the converted type. If the datetime data in an input message does not match the rules of the chosen schema data type, the values that the parser writes to the logical message tree are modified even if the message is in the MRM domain and you have configured the message flow to validate the input message. (Validation is not available for generic XML messages.) This has the following effect on the subfields of the input datetime data: v If any of the subfields of the input message are missing, a default value is written to the logical message tree. This default is substituted from the full timestamp that refers to the beginning of the current epoch: 1970-01-01 00:00:00. v If the input message contains information for subfields that are not present in the schema, the additional data is discarded. If this occurs, no exception is raised, even if a message in the MRM domain is validated. v After the data is parsed, it is cast to one of three ESQL datetime data types. These are DATE, TIME, and TIMESTAMP. – If a datetime value contains only date subfields, it is cast to an ESQL DATE. – If a datetime value contains only time subfields, it is cast to an ESQL TIME. – If a datetime value contains both date and time subfields, it is cast to an ESQL TIMESTAMP. The following examples illustrate these points. Input data XML Schema data type
Schema rules
Input value in the bit stream
Value written to the logical tree (ESQL data type in brackets)
xsd:dateTime
CCYY-MM-DDThh:mm:ss
2002-12-31T23:59:59
2002-12-31 23:59:59 (TIMESTAMP)
--24
1970-01-24 (DATE)
23:59:59
23:59:59 (TIME)
2002-12-31
2002-12-31 (DATE)
2002-12-31T23:59:59
2002-12-31 (DATE)
-06-24
1970-06-24 (DATE)
xsd:date
CCYY-MM-DD
xsd:time
hh:mm:ss
14:15:16
14:15:16 (TIME)
xsd:gDay
---DD
---24
1970-01-24 (DATE)
xsd:gMonth
--MM
--12
1970-12-01 (DATE)
xsd:gMonthDay
--MM-DD
--12-31
1970-12-31 (DATE)
xsd:gYear
CCYY
2002
2002-01-01 (DATE)
1484
Message Flows
Input data XML Schema data type
Schema rules
Input value in the bit stream
Value written to the logical tree (ESQL data type in brackets)
xsd:gYearMonth
CCYY-MM
2002-12
2002-12-01 (DATE)
Validation with missing subfields: When you consider which schema datetime data type to use, bear in mind that, if the message is in the MRM domain, and you configure the message flow to validate messages, missing subfields can cause validation exceptions. The schema data types Gday, gMonth, gMonthDay, gYear, and gYearMonth are used to record particular recurring periods of time. There is potential confusion when validation is turned on, because the recurring periods of time that are used in these schema data types are stored by ESQL as specific points in time. For example, when the 24th of the month, which is a gDay (a monthly day) type, is written to the logical tree, the missing month and year subfields are supplied from the epoch (January 1970) to provide the specific date 1970-01-24. If you code ESQL to manipulate this date, for example by adding an interval of 10 days, and then generate an output message that is validated, an exception is raised. This is because the result of the calculation is 1970-02-03 which is invalid because the month subfield of the date no longer matches the epoch date.
ESQL NULL data type All ESQL data types (except REFERENCE) support the concept of the null value. A value of null means that the value is unknown, undefined, or uninitialized. Null values can arise when you refer to message fields that do not exist, access database columns for which no data has been supplied, or use the keyword NULL, which supplies a null literal value. Null is a distinct state and is not the same as any other value. In particular, for integers it is not the same thing as the value 0 and for character variables it is not the same thing as a string of zero characters. The rules of ESQL arithmetic take null values into account, and you are typically unaware of their existence. Generally, but not always, these rules mean that, if any operand is null, the result is null. If an expression returns a null value its data type is not, in general, known. All null values, whatever their origin, are therefore treated equally. This can be regarded as their belonging to the data type NULL , which is a data type that can have just one value, null. An expression always returns NULL if any of its elements are NULL.
Testing for null values To test whether a field contains a null value, use the IS operator described in Operator=.
The effect of setting a field to NULL Take care when assigning a null value to a field. For example, the following command deletes the Name field: ESQL reference
1485
SET OutputRoot.XMLNS.Msg.Data.Name = NULL;
-- this deletes the field
The correct way to assign a null value to a field is as follows: SET OutputRoot.XMLNS.Msg.Data.Name VALUE = NULL; -- this assigns a NULL value to a field without deleting it
ESQL numeric data types ESQL supports several data types that handle numeric values. The following data types are collectively known as numeric data types: v “ESQL DECIMAL data type” v “ESQL FLOAT data type” on page 1487 v “ESQL INTEGER data type” on page 1488 Notes: 1. INTEGER and DECIMAL types are represented exactly inside the broker; FLOAT types are inherently subject to rounding error without warning. Do not use FLOAT if you need absolute accuracy, for example, to represent money. 2. Various casts are possible between different numeric types. These can result in loss of precision, if exact types are cast into FLOAT. For information about numeric functions see “ESQL numeric functions” on page 1605.
ESQL DECIMAL data type The DECIMAL data type holds an exact representation of a decimal number. Decimals have precision, scale, and rounding. Precision is the total number of digits of a number: v The minimum precision is 1 v The maximum precision is 34 Scale is the number of digits to the right of the decimal point: v The minimum scale (-exponent) is -999,999,999 v The maximum scale (-exponent) is +999,999,999 You cannot define precision and scale when declaring a DECIMAL, because they are assigned automatically. It is only possible to specify precision and scale when casting to a DECIMAL. Scale, precision, and rounding: The following scale, precision, and rounding rules apply: v Unless rounding is required to keep within the maximum precision, the scale of the result of an addition or subtraction is the greater of the scales of the two operands. v Unless rounding is required to keep within the maximum precision, the scale of the result of a multiplication is the sum of the scales of the two operands. v The precision of the result of a division is the smaller of the number of digits needed to represent the result exactly and the maximum precision. v All addition, subtraction, multiplication, and division calculations round the least significant digits, as necessary, to stay within the maximum precision
1486
Message Flows
v All automatic rounding is banker’s or half even symmetric rounding. The rules of this are: – When the first dropped digit is 4 or less, the first retained digit is unchanged – When the first dropped digit is 6 or more, the first retained digit is incremented – When the first dropped digit is 5, the first retained digit is incremented if it is odd, and unchanged if it is even. Therefore, both 1.5 and 2.5 round to 2 while 3.5 and 4.5 both round to 4 – Negative numbers are rounded according to the same rule Decimal literals: Decimal literals that consist of an unquoted string of digits only, that is, that contain neither a decimal point nor an exponent (for example 12345) are of type INTEGER if they are small enough to be represented as integers. Otherwise they are of type DECIMAL. Decimal literals that consist of an unquoted string of digits, optionally a decimal point, and an exponent (for example 123e1), are of type FLOAT if they are small enough to be represented as floats. Otherwise they are of type DECIMAL. Decimal literals that consist of the keyword DECIMAL and a quoted string of digits, with or without a decimal point and with or without an exponent, are of type DECIMAL, for example, DECIMAL ’42’, DECIMAL ’1.2346789e+203’. The strings in this type of literal can also have the values: v ’NAN’, not a number v ’INF’, ’INFINITY’ v ’+INF’, ’+INFINITY’ v ’-INF’, ’-INFINITY’ v ’MAX’ v ’MIN’ (in any mixture of case) to denote the corresponding values. Note, if you do not specify sufficient precision digits, that INF is returned, as shown in the following example: SET VAL [equals char] CAST('123456' AS DECIMAL(3,0))
ESQL FLOAT data type The FLOAT data type holds a 64-bit, base 2, fraction and exponent approximation to a real number. This gives a range of values between +-1.7E–308 and +- 1.7E+308. Float literals consist of an unquoted string of digits and either a decimal point (for example 123.4) or an exponent (for example 123e4) or both (for example 123.4e5) . They are of type FLOAT if they are small enough to be represented as floats. Otherwise they are of type DECIMAL Rounding: When you CAST a FLOAT to an INTEGER, either implicitly or explicitly, the FLOAT is truncated; that is, the numbers after the decimal point are removed and no rounding occurs. ESQL reference
1487
ESQL INTEGER data type The INTEGER data type holds an integer number in 64-bit two’s complement form. This gives a range of values between -9223372036854775808 and +9223372036854775807. Integer literals consist of an unquoted string of digits only; that is, they contain neither a decimal point nor an exponent; for example, 12345. They are of type INTEGER if they are small enough to be represented as integers. Otherwise they are of type DECIMAL. In addition to this format, you can write integer literals in hexadecimal notation; for example, 0x1234abcd. You can write the hexadecimal letters A to F, and the “x” after the initial zero, in uppercase or lowercase. If you use hexadecimal format, the number must be small enough to fit into an integer. (That is, it cannot be a decimal.)
ESQL REFERENCE data type The REFERENCE data type holds the location of a field in a message. It cannot hold the location of a constant, a database table, a database column, or another reference. Note: For compatibility with earlier versions, reference variables can also point at scalar variables A reference literal is an hierarchic path name, consisting of a list of path elements separated by periods. The first element in the list is known as the correlation name, and identifies a reference, row, or scalar variable. Any subsequent elements apply to references to message trees only, and identify field types, names, and indexes within the message tree relative to the field pointed to by the correlation name. For example: InputRoot.MQMD.Priority
is a field reference literal that refers to the Priority field contained within an MQMD structure within an input message.
ESQL ROW data type The ROW data type holds a tree structure. A row in a database is a particular type of tree structure, but the ROW data type is not restricted to holding data from database rows. In a database, a row is a fixed, ordered, set of scalar values. Note: A scalar is a single entity value or a string. A database table is an unordered set of rows and is thus a two dimensional ″array″ of scalar values, in which one dimension is fixed and the other is variable. In ESQL, a row is an open-ended, ordered, set of named values in which each value can be scalar or another row. That is, a row is an open-ended tree structure with no restrictions on dimensions or regularity. Consider the following diagram:
1488
Message Flows
Root Row PartNumber Description Price Row PartNumber Description Price Row PartNumber Description Price
= 1 = 'Chocolate bar' = 0.30 = 2 = 'Biscuit' = 0.35 = 3 = 'Fruit' = 0.42
In the example, Root contains three elements all named “Row”. Each of these in turn contains three elements with different names and values. This diagram equally describes an instance of an ESQL row data type (that is, a tree structure) or the contents of a database table.
ROW and LIST The ROW data type is a normal data type. You can use the DECLARE statement to create ROW variables in the same way as you create INTEGER or CHARACTER variables. There is also a more general concept of a ROW data type. In the previous example, Root is the root element of a ROW variable. Each of the elements called “Row”, while not the root element of ROW variables, are the root elements of sub-structures. Many ESQL operations (and particularly the SELECT function) work with the general concept of ROW and will operate equally on whole trees or parts of them. There is also a general concept of a LIST data type. The set of elements called “Row” can be regarded as a list. Some ESQL operations (particularly SELECT) work with the general concept of list. InputRoot, OutputRoot (and so on) are examples of ROW variables that are automatically declared and connected into the broker’s structure, ready for use.
ESQL string data types ESQL supports several data types that handle string values. The following data types are collectively known as string data types: v “ESQL BIT data type” v “ESQL BLOB data type” on page 1490 v “ESQL CHARACTER data type” on page 1490 For information about string functions, see “ESQL string manipulation functions” on page 1620.
ESQL BIT data type The BIT data type holds a variable length string of binary digits. It is commonly used to represent arbitrary binary data that does not contain an exact number of bytes. A bit string literal consists of the letter B, followed by a string of binary digits enclosed in single quotation marks, as in the following example: B'0100101001'
Any number of digits, which must be either 0 or 1, can be specified. The initial B can be specified in uppercase or lowercase. ESQL reference
1489
ESQL BLOB data type The BLOB data type holds a variable length string of 8-bit bytes. It is commonly used to represent arbitrary binary data. A BLOB literal consists of the letter X, followed by a string of hexadecimal digits enclosed in single quotation marks, as in the following example: X'0123456789ABCDEF'
There must be an even number of digits in the string, because two digits are required to define each byte. Each digit can be one of the hexadecimal digits 0-9 and A-F. Both the initial X and the hexadecimal letters can be specified in uppercase or lowercase.
ESQL CHARACTER data type The character data type holds a variable length string of Unicode characters. A character string literal consists of any number of characters in single quotation marks. If you want to include a single quotation mark within a character string literal, use another single quotation mark as an escape character. For example, the assignment SET X='he''was''' puts the value he'was' into X.
ESQL-to-Java data-type mapping table Table summarizing the mappings from ESQL to Java. The following table summarizes the mappings from ESQL to Java. Notes: v Only the Java scalar wrappers are passed to Java. v The ESQL scalar types are mapped to Java data types as object wrappers, or object wrapper arrays, depending upon the direction of the procedure parameter. Each wrapper array contains exactly one element. v Scalar object wrappers are used to allow NULL values to be passed to and from Java methods. ESQL data types
1
Java IN data types
Java INOUT and OUT data types
INTEGER, INT
java.lang.Long
java.lang.Long []
FLOAT
java.lang.Double
java.lang.Double[]
DECIMAL
java.math.BigDecimal
java.math.BigDecimal[]
CHARACTER, CHAR
java.lang.String
java.lang.String[]
BLOB
byte[]
byte[][]
BIT
java.util.BitSet
java.util.BitSet[]
com.ibm.broker.plugin.MbDate
com.ibm.broker.plugin.MbDate[]
com.ibm.broker.plugin.MbTime
com.ibm.broker.plugin.MbTime[]
com.ibm.broker.plugin.MbTime
com.ibm.broker.plugin.MbTime[]
com.ibm.broker.plugin.MbTimestamp
com.ibm.broker.plugin.MbTimestamp[]
DATE TIME
2
GMTTIME
2
TIMESTAMP
2 2
com.ibm.broker.plugin.MbTimestamp
com.ibm.broker.plugin.MbTimestamp[]
INTERVAL
Not supported
Not supported
BOOLEAN
java.lang.Boolean
java.lang.Boolean[]
GMTTIMESTAMP
1490
Message Flows
REFERENCE (to a message tree)
3 4
com.ibm.broker.plugin.MbElement
com.ibm.broker.plugin.MbElement[] (Supported for INOUT. Not supported for OUT)
ROW
Not supported
Not supported
LIST
Not supported
Not supported
5 6
1. Variables that are declared to be CONSTANT (or references to variables that are declared to be CONSTANT) are not allowed to have the direction INOUT or OUT. 2. The time zone set in the Java variable is not important; you obtain the required time zone in the output ESQL. 3. The reference parameter cannot be NULL when passed into a Java method. 4. The reference cannot have the direction OUT when passed into a Java method. 5. If an MbElement is passed back from Java to ESQL as an INOUT parameter, it must point to a location in the same message tree as that pointed to by the MbElement that was passed into the called Java method. For example, if an ESQL reference to OutputRoot.XML.Test is passed into a Java method as an INOUT MbElement, but a different MbElement is passed back to ESQL when the call returns, the different element must also point to somewhere in the OutputRoot tree. 6. An MbElement cannot be returned from a Java method with the RETURNS clause, because no ESQL routine can return a reference. However, an MbElement can be returned as an INOUT direction parameter, subject to the conditions described in point 5. A REFERENCE to a scalar variable can be used in the CALL of a Java method, provided that the data type of the variable to which the reference refers matches the corresponding data type in the Java program signature.
ESQL-to-XPath mapping table The following table summarizes the mappings from ESQL to XPath. ESQL
XPath 1.0
BOOLEAN data types True False Unknown
True() False() No equivalent
Date Time data types
No equivalent
NULL data type
No equivalent
XPath 1.0 usage notes Equivalent to Boolean ″1″ or ″True″ Equivalent to Boolean ″0″ or ″False″
Numeric data types DECIMAL FLOAT INTEGER
REFERENCE data type
12678967.543233 with or without quotation marks 1.7976931348623158 with or without quotation marks 9223372036854775807 with or without quotation marks
Cannot express an exponent or a leading plus sign. Cannot express an exponent or a leading plus sign. Cannot express an exponent or a leading plus sign.
FilterExpression ’/’ RelativeLocationPath
For example, $InputRoot/MQMD/ Priority
ESQL reference
1491
String data types BIT BLOB CHARACTER
No equivalent No equivalent Literal
NAME
$NAME
Simple comparison operators > < >= ’=’ <>
> < >= ’=’ !=
Complex comparison operators
No equivalent
Logical operators AND OR NOT
and or not (operand)
Numeric operators Unary + * /
- Unary expression + * div
String operator
No equivalent
Date time functions
No equivalent
Numeric functions FLOOR CEIL and CEILING ROUND
floor (number) ceiling (number) No equivalent
String manipulation functions SUBSTRING TRANSLATE
substring(string, number, number) translate(string, string, string)
For example 'a "b"' or "a 'b'" Can assign such a variable any valid value, of type Boolean, number, or string.
The not function returns true if its argument is false, and false otherwise.
Multiplication operator
XPath property editors The XPath files are supplied in three property editors located in the com.ibm.etools.mft.ibmnodes plugin . The property editors are: Read only Located in com.ibm.etools.mft.ibmnodes.editors.xpath.XPathReadOnlyPropertyEditor Read write Located in com.ibm.etools.mft.ibmnodes.editors.xpath.XPathReadWritePropertyEditor Expression Located in com.ibm.etools.mft.ibmnodes.editors.xpath.XPathPropertyEditor For information on adding a property editor to your workspace, see Adding a property editor or compiler.
1492
Message Flows
ESQL variables ESQL variables can be described as external, normal, or shared; their use is defined in the DECLARE statement.
Types of variable External External variables (defined with the EXTERNAL keyword) are also known as user-defined properties (see “User-defined properties in ESQL” on page 286). They exist for the entire lifetime of a message flow and are visible to all messages that pass through the flow. You can define external variables only at the module and schema level. You can modify their initial values (optionally set by the DECLARE statement) by using the Message Flow editor, or at deployment time, by using the BAR editor. You can query and set the values of user-defined properties at run time by using the Configuration Manager Proxy (CMP) API. For more information, see Setting user-defined properties dynamically at run time. Normal “Normal” variables have a lifetime of just one message passing through a node. They are visible to that message only. To define a “normal” variable, omit both the EXTERNAL and SHARED keywords. Shared Shared variables (defined with the SHARED keyword) can be used to implement an in-memory cache in the message flow (see “Optimizing message flow response times” on page 180). Shared variables have a long lifetime and are visible to multiple messages that pass through the flow (see “Long-lived variables” on page 287). They exist for the lifetime of the execution group process, the lifetime of the flow or node, or the lifetime of the node’s SQL that declares the variable (whichever is the shortest). They are initialized when the first message passes through the flow or node after each broker startup. See also the ATOMIC option of the “BEGIN ... END statement” on page 1510. The BEGIN ATOMIC construct is useful when a number of changes need to be made to a shared variable and when it is important to prevent other instances seeing the intermediate states of the data.
ESQL field reference overview How to use ESQL field references to form paths to message body elements.
ESQL reference
1493
The full syntax for field references is as shown below:
CorrelationName
.
PathElement
PathElement: (
Type )
: Namespace { NamespaceExpression *
Name { NameExpression *
}
}
[
] Index < Index > Index <
A field reference consists of a correlation name, followed by zero or more Path Elements separated by periods (.). The correlation name identifies a well-known starting point and must be the name of a constant, a declared variable (scalar, row or reference), or one of the predefined start points; for example, InputRoot. The path Fields define a path from the start point to the desired field. See: v “Namespace” on page 1495 for the meaning of the different combinations of namespace and name v “Target field references” on page 1499 for the meaning of the different combinations of field references v “Index” on page 1496 for the meaning of the different combinations of index clauses v “Type” on page 1497 for the meaning of the different combinations of types For example: InputRoot.XMLNS.Data.Invoice
starts the broker at the location InputRoot (that is, the root of the input message to a Compute node) and then performs a sequence of navigations. First, it navigates from root to the first child field called XMLNS, then to the first child field of the XMLNS field called Data. Finally, the broker navigates to the first child field of the Data field called Invoice. Whenever this field reference occurs in an ESQL program, the invoice field is accessed.
1494
Message Flows
This form of field reference is simple, convenient, and is the most commonly used. However, it does have two limitations: v Because the names used must be valid ESQL identifiers, you can use only names that conform to the rules of ESQL. That is, the names can contain only alphanumeric characters including underscore, the first character cannot be numeric, and names must be at least one character long. You can avoid these limitations by enclosing names not conforming to these rules in double quotation marks. For example: InputRoot.XMLNS."Customer Data".Invoice
If you need to refer to fields that contain quotation marks, use two pairs of quotation marks around the reference. For example: Body.Message."""hello"""
Some identifiers are reserved as keywords but, with the exception of the correlation name, you can use them in field references without the use of double quotation marks v Because the names of the fields appear in the ESQL program, they must be known when the program is written. This limitation can be avoided by using the alternative syntax that uses braces ( { ... } ). This syntax allows you to use any expression that returns a non-null value of type character. For example: InputRoot.XMLNS."Customer Data".{'Customer-' || CurrentCustomer}.Invoice
in which the invoices are contained in a folder with a name is formed by concatenating the character literal Customer- with the value in CurrentCustomer (which in this example must be a declared variable of type character). You can use the asterisk (*) wildcard character in a path element to match any name. You can also use “*” to specify a partial name. For example, Prefix* matches any name that begins with “Prefix”. Note that enclosing anything in double quotation marks in ESQL makes it an identifier; enclosing anything in single quotation marks makes it a character literal. You must enclose all character strings in single quotation marks.
Namespace Field names can belong to namespaces. Field references provide support for namespaces as follows: v Each field of each field reference that contains a name clause can also contain a namespace clause defining the namespace to which the specified name belongs. v Each namespace name can be defined by either a simple identifier or by an expression (enclosed in curly braces). If an identifier is the name of a declared namespace constant, the value of the constant is used. If an expression is used, it must return a non-null value of type character. v A namespace clause of * explicitly states that namespace information is to be ignored when locating Fields in a tree. v A namespace clause consisting of only : explicitly targets the notarget namespace. The clause has no identifier, expression or wildcard (*). For example:
ESQL reference
1495
DECLARE sp1 NAMESPACE 'http://www.ibm.com/space1'; /* Namespace declaration to associate prefix 'space1' with the namespace */ SET OutputRoot.XMLNS.TestCase.(XML.NamespaceDecl)xmlns:space1 = 'http://www.ibm.com/space1'; SET OutputRoot.XMLNS.TestCase.{sp1}:data1 = 'Hello!';
generates: <space1:data1>Hello!
Index Each field of a field reference can contain an index clause. This clause is denoted by brackets ( [ ... ] ) and accepts any expression that returns a non-null value of type integer. This clause identifies which of several fields with the same name is to be selected. Fields are numbered from the first, starting at one. If this clause is not present, it is assumed that the first field is required. Thus, the two examples below have exactly the same meaning: InputRoot.XMLNS.Data[1].Invoice InputRoot.XMLNS.Data.Invoice[1]
This construct is most commonly used with an index variable, so that a loop steps though all such fields in sequence. For example: WHILE count < 32 DO SET TOTAL = TOTAL + InputRoot.XMLNS.Data.Invoice[count].Amount; SET COUNT = COUNT + 1 END WHILE;
Use this kind of construct with care, because it implies that the broker must count the fields from the beginning each time round the loop. If the repeat count is large, performance will be poor. In such cases, a better alternative is to use a field reference variable. Index expressions can optionally be preceded by a less-than sign ( < ), indicating that the required field is to be indexed from the last field, not the first. In this case, the index 1 refers to the last field and the index 2 refers to the penultimate field. For completeness, you can use a greater-than sign to indicate counting from the first field. The example below shows ESQL code that handles indexes where there are four fields called Invoice. InputRoot.XMLNS.Data.Invoice InputRoot.XMLNS.Data.Invoice[1] InputRoot.XMLNS.Data.Invoice[>] InputRoot.XMLNS.Data.Invoice[>1] InputRoot.XMLNS.Data.Invoice[>2] InputRoot.XMLNS.Data.Invoice[<] InputRoot.XMLNS.Data.Invoice[<1] InputRoot.XMLNS.Data.Invoice[<2] InputRoot.XMLNS.Data.Invoice[<3]
----------
Selects Selects Selects Selects Selects Selects Selects Selects Selects
the the the the the the the the the
first first first first second fourth fourth third second
An index clause can also consist of an empty pair of brackets ( [] ). This selects all fields with matching names. Use this construct with functions and statements that expect lists (for example, the SELECT, CARDINALITY, SINGULAR, and EXISTS functions, or the SET statement) .
1496
Message Flows
Type Each field of a field reference can contain a type clause. These are denoted by parentheses ( ( ) ), and accept any expression that returns a non-null value of type integer. The presence of a type expression restricts the fields that are selected to those of the matching type. This construct is most commonly used with generic XML, where there are many field types and it is possible for one XML field to contain both attributes and further XML Fields with the same name. For example: -
5678
Here, the XML field Item has two child Fields, both called “Value”. The child Fields can be distinguished by using type clauses: Item.(.Attribute)Value to select the attribute, and Item.(XML.Element)Value to select the field, where is one of XML, XMLNS, or XMLNSC, as determined by the message domain of the source.
Type constraints A type constraint checks the data type returned by a field reference.
(1) (
FieldReference )
ScalarDataTypeName
Notes: 1
ScalarDataTypeName can be any one of BOOLEAN, INTEGER, INT, FLOAT, DECIMAL, DEC, DATE, TIME, TIMESTAMP, GMTTIME, GMTTIMESTAMP, INTERVAL, CHARACTER, CHAR, BLOB, BIT.
Typically, a type constraint causes the scalar value of the reference to be extracted (in a similar way to the FIELDVALUE function) and an exception to be thrown if the reference is not of the correct type. By definition, an exception will be thrown for all nonexistent fields, because these evaluate to NULL. This provides a convenient and fast way of causing exceptions if essential fields are missing from messages. However, when type constraints occur in expressions that are candidates for being passed to a database (for example, they are in a WHERE clause), the information is used to determine whether the expression can be given to the database. This can be important if a WHERE clause contains a CAST operating on a database table column. In the absence of a type constraint, such expressions cannot be given to the database because the broker cannot tell whether the database is capable of performing the required conversion. Note, however, that you should always exercise caution when using casts operating on column values, because some databases have exceedingly limited data conversion capabilities.
ESQL reference
1497
Field references summary *, *[..], (..)*, (..)*[..] None of these forms specifies a name or namespace. The target field can have any name, in any namespace or in no namespace. It is located solely by its type, its index, or its type and index, as appropriate. Name, Name[..], (..)Name, (..)Name[..] All these forms specify a name but no namespace. The target field is located by namespace and name, and also by type and index where appropriate. The namespace is taken to be the only namespace in the namespace path containing this name. The only namespace that can be in the path is the notarget namespace. These forms all existed before namespaces were introduced. Although their behavior has changed in that they now compare both name and namespace, existing transforms should see no change in their behavior because all existing transforms create their Fields in the notarget namespace. :*, :*[..], (..):*, (..):*[..] All these forms specify the notarget namespace but no name. The target field is located by its namespace and also by type and index where appropriate. :Name, :Name[..], (..):Name, (..):Name[..] All these forms specify a name and the notarget namespace. The target field is located by namespace and name and also by type and index where appropriate. *:*, *:*[..], (..)*:*, (..)*:*[..] None of these forms specifies a name or a namespace. Note that “*:*” is equivalent to “*”, and matches no namespace as well as any namespace. The target field can have any name, in any namespace or in no namespace. It is located solely by its type, its index, or its type and index, as appropriate. *:Name, *:Name[..], (..)*:Name, (..)*:Name[..] All these forms specify a name but no namespace. The target field is located by name and also by type and index where appropriate. Namespace:*, Namespace:*[..], (..)Namespace:*, (..)Namespace:*[..] All these forms specify a namespace but no name. The target field is located by namespace and also by type and index where appropriate. Namespace:Name, Namespace:Name[..], (..)Namespace:Name, (..)Namespace:Name[..] All these forms specify a namespace and name. The target field is located by namespace and name and also by type and index where appropriate. In all the preceding cases a name, or namespace, provided by an expression contained in braces ({}) is equivalent to a name provided as an identifier. By definition, the name of the notarget namespace is the empty string. The empty string can be selected by expressions which evaluate to the empty string, the empty identifier ″″, or by reference to a namespace constant defined as the empty string.
1498
Message Flows
Target field references The use of field references usually implies searching for an existing field. However, if the required field does not exist, as is usually the case for field references that are the targets of SET statements and those in the AS clauses of SELECT functions, it is created. In these situations, there are a variety of circumstances in which the broker cannot tell what the required name or namespace is, and in these situations the following general principles apply : v If the name clause is absent or does not specify a name, and the namespace clause is absent or does not specify or imply a namespace (that is, there is no name or namespace available), one of the following conditions applies: – If the assignment algorithm does not copy the name from some existing field, the new field has both its name and namespace set to the empty string and its name flag is not set automatically. In the absence of a type specification, the field’s type is not Name or NameValue, which effectively indicates that the new field is nameless. – Otherwise, if the assignment algorithm chooses to copy the name from some existing field, the new field has both its name and namespace copied from the existing field and its Name flag is set automatically v If the name clause is present and specifies a name, but the namespace clause is absent or does not specify or imply a namespace (that is, a name is available but a namespace is not), the new field has its: – Name set to the given value – Namespace set to the empty string – Name flag set automatically v If the name clause is absent or does not specify a name, but the namespace clause is present and specifies or implies a namespace (that is, a namespace is available but a name is not), the new field has its: – Namespace set to the given value – Name set to the empty string – Name flag set automatically v If the name clause is present and specifies a name, and the namespace clause is present and specifies or implies a namespace, the new field has its: – Name set to the given value – Namespace set to the given value – Name flag set automatically There are also cases where the broker creates Fields in addition to those referenced by field references: v Tree copy: new Fields are created by an algorithm that uses a source tree as a template. If the algorithm copies the name of a source field to a new field, its namespace is copied as well. v Anonymous select expressions: SELECT clauses are not obliged to have AS clauses; those that do not have them, set the names of the newly created Fields to default values (see “SELECT function” on page 1662). These defaults can be derived from field names, column names or can simply be manufactured sequence names. If the name is an field name, this is effectively a tree copy, and the namespace name is copied as above.
ESQL reference
1499
Otherwise, the namespace of the newly-created field is derived by searching the path, that is, the name is be treated as the NameId syntax of a field reference.
The effect of setting a field to NULL Take care when assigning a null value to a field. For example, the following command deletes the Name field: SET OutputRoot.XMLNS.Msg.Data.Name = NULL;
-- this deletes the field
The correct way to assign a null value to a field is as follows: SET OutputRoot.XMLNS.Msg.Data.Name VALUE = NULL; -- this assigns a NULL value to a field without deleting it
Note: to users on compatibility with earlier versions For compatibility with earlier versions, the LAST keyword is still supported, but its use is deprecated. LAST cannot be used as part of an index expression: [LAST] is valid, and is equivalent to [<], but [LAST3] is not valid. The LAST keyword has been replaced by the following arrow syntax, which allows both a direction of search and index to be specified: Field Field Field Field Field Field
[> ] [> (a + b) * 2 ] [ < ] [ < 1 ] [ < 2 ] [ < (a + b) / 3 ]
-- The first field, equivalent to [ 1 ] -- The last field, equivalent to [ LAST ] -- The last field, equivalent to [ LAST ] -- The last but one field
ESQL operators This section provides reference information for the following groups of operators, and for the rules for precedence: v Simple comparison operators v Complex comparison operators v Logical operators v Numeric operators v String operator v Rules for operator precedence
ESQL simple comparison operators This topic describes ESQL’s simple comparison operators. For information about ESQL’s complex comparison operators, see “ESQL complex comparison operators” on page 1502. ESQL provides a full set of comparison operators (predicates). Each compares two scalar values and returns a Boolean. If either operand is null the result is null. Otherwise the result is true if the condition is satisfied and false if it is not. Comparison operators can be applied to all scalar data types. However, if the two operands are of different types, special rules apply. These are described in “Implicit casts” on page 1682.
1500
Message Flows
Some comparison operators also support the comparison of rows and lists. These are noted below. Operator> The first operand is greater than the second. Operator < The first operand is less than the second. Operator>= The first operand is greater than or equal to the second. Operator <= The first operand is less than or equal to the second. Operator = The first operand is equal to that of the second. This operator can also compare rows and lists. See “ROW and LIST comparisons” on page 1672 for a description of list and row comparison. Operator <> The first operand is not equal to the second. This operator can also compare rows and lists. See “ROW and LIST comparisons” on page 1672 for a description of list and row comparison. The meanings of “equal”, “less”, and “greater” in this context are as follows: v For the numeric types (INTEGER, FLOAT, DECIMAL) the numeric values are compared. Thus 4.2 is greater than 2.4 and -2.4 is greater than -4.2. v For the date/time types (DATE, TIME, TIMESTAMP, GMTTIME, GMTTIMESTAMP but not INTERVAL) a later point in time is regarded as being greater than an earlier point in time. Thus the date 2004-03-31 is greater than the date 1947-10-24. v For the INTERVAL type, a larger interval of time is regarded as being greater than a smaller interval of time. For the string types (CHARACTER, BLOB, BIT) the comparison is lexicographic. Starting from the left, the individual elements (each character, byte or bit) are compared. If no difference is found, the strings are equal. If a difference is found, the values are greater if the first different element in the first operand is greater than the corresponding element in the second and less if they are less. In the special case where two strings are of unequal length but equal as far as they go, the longer string is regarded as being greater than the shorter. Thus: 'ABD' is greater than 'ABC' 'ABC' is greater than 'AB'
Trailing blanks are regarded as insignificant in character comparisons. Thus if you want to ensure that two strings are truly equal you need to compare both the strings themselves and their lengths. For example: 'ABC
' is equal to 'ABC'
Note that comparing strings with a length of one is equivalent to comparing individual characters, bytes, or bits. Because ESQL has no single character, byte, or bit data types, it is standard practice to use strings of length one to compare single characters, bytes, or bits.
ESQL reference
1501
ESQL complex comparison operators This topic describes ESQL’s complex comparison operators (predicates). For information about ESQL’s simple comparison operators, see “ESQL simple comparison operators” on page 1500. Operator BETWEEN The operator BETWEEN allows you to test whether a value lies between two boundary values.
BETWEEN operator ASYMMETRIC expression
BETWEEN
NOT SYMMETRIC endpoint_1 AND
endpoint_2
This operator exists in two forms, SYMMETRIC and ASYMMETRIC (which is the default if neither is specified). The SYMMETRIC form is equivalent to: (source>= boundary1 AND source <= boundary2) OR (source>= boundary2 AND source <= boundary1)
The ASYMMETRIC form is equivalent to: source>= boundary1 AND source <= boundary2
The ASYMMETRIC form is simpler but returns only the result that you expect when the first boundary value has a smaller value than the second boundary. It is only useful when the boundary condition expressions are literals. If the operands are of different types, special rules apply. These are described in “Implicit casts” on page 1682. Operator EXISTS
EXISTS operator Operand (
ListExpression
)
The operator EXISTS returns a Boolean value indicating whether a SELECT function returned one or more values (TRUE) or none (FALSE). EXISTS(SELECT * FROM something WHERE predicate)
Operator IN The operator IN allows you to test whether a value is equal to one of a list of values.
1502
Message Flows
IN operator , IN ( operand_2
operand_1
)
NOT
The result is TRUE if the left operand is not NULL and is equal to one of the right operands. The result is FALSE if the left operand is not NULL and is not equal to any of the right operands, none of which have NULL values. Otherwise the result is UNKNOWN. If the operands are of different types, special rules apply. These are described in “Implicit casts” on page 1682. Operator IS The operator IS allows you to test whether an expression has returned a special value.
IS operator
Operand
IS NOT
TRUE FALSE INF +INF -INF INFINITY +INFINITY -INFINITY NAN NULL NUM NUMBER UNKNOWN
The primary purpose of the operator IS is to test whether a value is NULL. The comparison operator (=) does not allow this because the result of comparing anything with NULL is NULL. IS also allows you to test for the Boolean values TRUE and FALSE, and the testing of decimal values for special values. These are denoted by INF, +INF, -INF, NAN (not a number), and NUM (a valid number) in any mixture of case. The alternative forms +INFINITY, -INFINITY, and NUMBER are also accepted. If applied to non-numeric types, the result is FALSE. Operator LIKE The operator LIKE searches for strings that match a certain pattern.
ESQL reference
1503
LIKE operator source
LIKE pattern NOT
ESCAPE
EscapeChar
The result is TRUE if none of the operands is NULL and the source operand matches the pattern operand. The result is FALSE if none of the operands is NULL and the source operand does not match the pattern operand. Otherwise the result is UNKNOWN. The pattern is specified by a string in which the percent (%) and underscore (_) characters have a special meaning: v The underscore character _ matches any single character. For example, the following finds matches for IBM and for IGI, but not for International Business Machines or IBM Corp: Body.Trade.Company LIKE 'I__'
v The percent character % matches a string of zero or more characters. For example, the following finds matches for IBM, IGI, International Business Machines, and IBM Corp: Body.Trade.Company LIKE 'I%'
To use the percent and underscore characters within the expressions that are to be matched, precede the characters with an ESCAPE character, which defaults to the backslash (\) character. For example, the following predicate finds a match for IBM_Corp. Body.Trade.Company LIKE 'IBM\_Corp'
You can specify a different escape character by using the ESCAPE clause. For example, you could also specify the previous example like this: Body.Trade.Company LIKE 'IBM$_Corp' ESCAPE '$'
Operator SINGULAR
SINGULAR operator Operand (
ListExpression
)
The operator SINGULAR returns a Boolean value of TRUE if the list has exactly one element, otherwise it returns FALSE.
ESQL logical operators ESQL provides the following logical operators: Operator AND The result is the logical AND of the two operands. Both operands must be Boolean values. Operator OR The result is the logical OR of the two operands. Both operands must be Boolean values.
1504
Message Flows
Operator NOT The result is the logical NOT of the operand, which must be a Boolean value. NULL and UNKNOWN values are treated as special values by these operators. The principles are: v NULL and UNKNOWN are treated the same. v If an operand is NULL the result is NULL unless the operation result is already dictated by the other parameter. The result of AND and OR operations is defined by the following table. Value of P
Value of Q
Result of P AND Q
Result of P OR Q
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
TRUE
TRUE
UNKNOWN
UNKNOWN
TRUE
FALSE
TRUE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
UNKNOWN
FALSE
UNKNOWN
UNKNOWN
TRUE
UNKNOWN
TRUE
UNKNOWN
FALSE
FALSE
UNKNOWN
UNKNOWN
UNKNOWN
UNKNOWN
UNKNOWN
The result of NOT operations is defined by the following table. Operand
Result of NOT
TRUE
FALSE
FALSE
TRUE
UNKNOWN
UNKNOWN
ESQL numeric operators ESQL provides the following numeric operators: Unary Operator The result is the negation of the operand (that is, it has the same magnitude as the operand but the opposite sign). You can negate numeric values (INTEGER, DECIMAL and FLOAT) and intervals (INTERVAL). Operator + The result is the sum of the two operands. You can add two numeric values, two intervals, and an interval to a datetime value (DATE, TIME, TIMESTAMP, GMTTIME, and GMTTIMESTAMP). Operator The result is the difference between the two operands. It is possible to: v Subtract one numeric value from another. v Subtract one date-time from another. The result is an interval. v Subtract one interval from another. The result is an interval. v Subtract an interval from a datetime value. The result is a date-time.
ESQL reference
1505
When subtracting one date-time from another, you must indicate the type of interval required. You do this by using a qualifier consisting of parentheses enclosing the expression, followed by an interval qualifier. For example: SET OutputRoot.XMLNS.Data.Age = (DATE '2005-03-31' - DATE '1947-10-24') YEAR TO MONTH;
Operator * The result is the product of the two operands. You can multiply numeric values and multiply an interval by a numeric value. Operator / The result is the dividend of the two operands. You can divide numeric values and divide an interval by a numeric value. Operator || The result is the concatenation of the two operands. You can concatenate string values (CHARACTER, BIT, and BLOB). In all cases, if either operand is NULL, the result is NULL. If the operands are of different types, special rules apply. These are described in “Implicit casts” on page 1682. For examples of how you can use these operators to manipulate datetime values, see “Using numeric operators with datetime values” on page 321.
ESQL string operator ESQL provides the following string operator: Operator || The result is the concatenation of the two operands. You can concatenate string values (CHARACTER, BIT, and BLOB). If either operand is NULL, the result is NULL.
Rules for ESQL operator precedence When an expression involves more than one operator, the order in which the expression is evaluated might affect the result. Consider the following example: SET a = b + c * d;
Under ESQL’s precedence rules, c is multiplied by d and the result is added to b. This rule states that multiplication takes precedence over addition, so reordering the expression as follows: SET a = c * d + b;
makes no difference. ESQL’s precedence rules are set out below but it is generally considered good practice to use parentheses to make the meaning clear. The order of precedence is: 1. Parentheses 2. Unary operators including unary - and NOT 3. Multiplication and division 4. Concatenation 5. Addition and subtraction
1506
Message Flows
Operations at the same level are evaluated from left to right.
ESQL statements The following table summarizes the ESQL statements and what they do. Statement type
Description
Basic statements: “BEGIN ... END statement” on page 1510
Gives the statements defined within the BEGIN and END keywords the status of a single statement.
“CALL statement” on page 1515
Invokes a user-written routine that has been defined using a CREATE FUNCTION or CREATE PROCEDURE statement.
“CASE statement” on page 1518
Uses rules defined in WHEN clauses to select a block of statements to execute.
“CREATE FUNCTION statement” on page 1528
Like CREATE PROCEDURE, CREATE FUNCTION defines a user-written routine. (The few differences between CREATE FUNCTION and CREATE ROUTINE are described in the reference material.)
“CREATE MODULE statement” on page 1537
Creates a module (a named container associated with a node).
“CREATE PROCEDURE statement” on page 1539
Like CREATE FUNCTION, CREATE PROCEDURE defines a user-written routine. (The few differences between CREATE FUNCTION and CREATE ROUTINE are described in the reference material.)
“DECLARE statement” on page 1553
Declares one or more variables that can be used to store temporary values.
“IF statement” on page 1565
Processes a set of statements based on the result of evaluating condition expressions.
“ITERATE statement” on page 1570
Abandons processing the current iteration of the containing WHILE, REPEAT, LOOP, or BEGIN statement, and might start the next iteration.
“LEAVE statement” on page 1571
Abandons processing the current iteration of the containing WHILE, REPEAT, LOOP or BEGIN statement, and stops looping.
“LOOP statement” on page 1573
Processes a sequence of statements repeatedly and unconditionally.
“REPEAT statement” on page 1581
Processes a sequence of statements and then evaluates a condition expression. If the expression evaluates to TRUE, executes the statements again.
“RETURN statement” on page 1583
Stops processing the current function or procedure and passes control back to the caller.
“SET statement” on page 1585
Evaluates a source expression, and assigns the result to the target entity.
“THROW statement” on page 1587
Generates a user exception.
ESQL reference
1507
Statement type
Description
“WHILE statement” on page 1592
Evaluates a condition expression, and if it is TRUE executes a sequence of statements.
Message tree manipulation statements: “ATTACH statement”
Attaches a portion of a message tree into a new position in the message hierarchy.
“CREATE statement” on page 1520
Creates a new message field.
“DELETE statement” on page 1562
Detaches and destroys a portion of a message tree, allowing its memory to be reused.
“DETACH statement” on page 1562
Detaches a portion of a message tree without deleting it.
“FOR statement” on page 1564
Iterates through a list (for example, a message array).
“MOVE statement” on page 1574
Changes the field pointed to by a target reference variable.
Database update statements: “DELETE FROM statement” on page 1560
Deletes rows from a table in an external database based on a search condition.
“INSERT statement” on page 1566
Adds a new row to an external database.
“PASSTHRU statement” on page 1576
Takes a character value and passes it as an SQL statement to an external database.
“UPDATE statement” on page 1589
Updates the values of specified rows and columns in a table in an external database.
Node interaction statements: “PROPAGATE statement” on page 1578
Propagates a message to the downstream nodes within the message flow.
Other statements: “BROKER SCHEMA statement” on page 1512
This statement is optional and is used in an ESQL file to explicitly identify the schema that contains the file.
“DECLARE HANDLER statement” on page 1558
Declares an error handler.
“EVAL statement” on page 1563
Takes a character value, interprets it as an SQL statement, and executes it.
“LOG statement” on page 1572
Writes a record to the event or user trace log.
“RESIGNAL statement” on page 1582
Re-throws the current exception (if any). This is used by an error handler, when it cannot handle an exception, to give an error handler in higher scope the opportunity of handling the exception.
ATTACH statement The ATTACH statement attaches a portion of a message tree into a new position in the message hierarchy.
1508
Message Flows
Syntax
ATTACH dynamic reference TO field reference AS
FIRSTCHILD LASTCHILD PREVIOUSSIBLING NEXTSIBLING
The following example illustrates how to use the ATTACH statement, together with the DETACH statement described in “DETACH statement” on page 1562, to modify a message structure. The dynamic reference supplied to the DETACH statement must point to a modifiable message tree such as Environment, LocalEnvironment, OutputRoot, OutputExceptionList, or InputLocalEnvironment. There are some limitations on the use of ATTACH. In general, elements detached from the output trees of a Compute node are not attached to the environment or to input trees. For example, if you take the following message: - cheese
stilton - bread
- garlic
- wine
the following ESQL statements: SET OutputRoot = InputRoot; DECLARE ref1 REFERENCE TO OutputRoot.XMLNSC.Data.Order[1].Item[1]; DETACH ref1; ATTACH ref1 TO OutputRoot.XMLNSC.Data.Order[2] AS LASTCHILD;
result in the following new message structure: - bread
- garlic
- wine
- cheese
stilton
For information about dynamic references see “Creating dynamic field references” on page 316.
ESQL reference
1509
BEGIN ... END statement The BEGIN ... END statement gives the statements defined within the BEGIN and END keywords the status of a single statement. This allows the contained statements to: v Be the body of a function or a procedure v Have their exceptions handled by a handler v Have their execution discontinued by a LEAVE statement
Syntax
BEGIN Label
Statements
:
END
ATOMIC
Label
NOT
The second Label can be present only if the first Label is present. If both labels are present, they must be identical. Two or more labeled statements at the same level can have the same label, but this partly negates the advantage of the second label. The advantage is that the labels unambiguously and accurately match each END with its BEGIN. However, a labeled statement nested within Statements cannot have the same label, because this makes the behavior of the ITERATE and LEAVE statements ambiguous.
Scope of variables A new local variable scope is opened immediately after the opening BEGIN and, therefore, any variables declared within this statement go out of scope when the terminating END is reached. If a local variable has the same name as an existing variable, any references to that name that occur after the declaration access the local variable. For example: DECLARE Variable1 CHAR 'Existing variable'; -- A reference to Variable1 here returns 'Existing variable' BEGIN -- A reference to Variable1 here returns 'Existing variable' DECLARE Variable1 CHAR 'Local variable'; the name is the same
-- Perfectly legal even though
-- A reference to Variable1 here returns 'Local variable' END;
ATOMIC If ATOMIC is specified, only one instance of a message flow (that is, one thread) is allowed to execute the statements of a specific BEGIN ATOMIC... END statement (identified by its schema and label), at any one time. If no label is present, the behavior is as if a zero length label had been specified.
1510
Message Flows
The BEGIN ATOMIC construct is useful when a number of changes need to be made to a shared variable and it is important to prevent other instances seeing the intermediate states of the data. Consider the following code example: CREATE PROCEDURE WtiteSharedVariable1(IN NewValue CHARACTER) SharedVariableMutex1 : BEGIN ATOMIC -- Set new value into shared variable END; CREATE FUNCTION ReadSharedVariable1() RETURNS CHARACTER SharedVariableMutex1 : BEGIN ATOMIC DECLARE Value CHARACTER; -- Get value from shared variable RETURN Value; END;
The last example assumes that the procedure WriteSharedVariable1 and the function ReadSharedVariable1 are in the same schema and are used by nodes within the same flow. However, it does not matter whether or not the procedure and function are contained within modules, or whether they are used within the same or different nodes. The broker ensures that, at any particular time, only one thread is executing any of the statements within the atomic sections. This ensures that, for example, two simultaneous writes or a simultaneous read and write are executed serially. Note that: v The serialization is limited to the flow. Two flows which use BEGIN ATOMIC... END statements with the same schema and label can be executed simultaneously. In this respect, multiple instances within a flow and multiple copies of a flow are not equivalent. v The serialization is limited by the schema and label. Atomic BEGIN ... END statements specified in different schemas or with different labels do not interact with each other. Note: You can look at this in a different way, if you prefer. For each combination of message flow, schema, and label, the broker has a mutex that prevents simultaneous access to the statements associated with that mutex. Do not nest BEGIN ATOMIC... END statements, either directly or indirectly, because this could lead to “deadly embraces”. For this reason, do not use a PROPAGATE statement from within an atomic block. It is not necessary to use the BEGIN ATOMIC construct in flows that will never be deployed with more than one instance (but it might be unwise to leave this to chance). It is also unnecessary to use the BEGIN ATOMIC construct on reads and writes to shared variables. The broker always safely writes a new value to, and safely reads the latest value from, a shared variable. ATOMIC is only required when the application is sensitive to seeing intermediate results. Consider the following example: DECLARE LastOrderDate SHARED DATE; ... SET LastOrderDate = CURRENT_DATE; ... SET OutputRoot.XMLNSC.Data.Orders.Order[1].Date = LastOrderDate;
Here we assume that one thread is periodically updating LastOrderDate and another is periodically reading it. There is no need to use ATOMIC, because the second SET statement always reads a valid value. If the updating and reading
ESQL reference
1511
occur very closely in time, whether the old or new value is read is indeterminate, but it is always one or the other. The result will never be garbage. But now consider the following example: DECLARE Count SHARED INT; ... SET Count = Count + 1;
Here we assume that several threads are periodically executing the SET statement. In this case you do need to use ATOMIC, because two threads might read Count in almost the same instant, and get the same value. Both threads perform the addition and both store the same value back. The end result is thus N+1 and not N+2. The broker does not automatically provide higher-level locking than this (for example, locking covering the whole SET statement), because such locking is liable to cause “deadly embraces”.
Hint You can consider the BEGIN ... END statement to be a looping construct, which always loops just once. The effect of an ITERATE or LEAVE statement nested within a BEGIN ... END statement is then as you would expect: control is transferred to the statement following the END. Using ITERATE or LEAVE within a BEGIN ... END statement is useful in cases where there is a long series of computations that needs to be abandoned, either because a definite result has been achieved or because an error has occurred.
BROKER SCHEMA statement The BROKER SCHEMA statement is optional; use it in an ESQL file to explicitly identify the schema that contains the file.
1512
Message Flows
Syntax
esqlContents BROKER SCHEMA schemaName
PATH schemaPathList
schemaName: < . <
identifier
schemaPathList: < , <
SchemaName
esqlContents: <<
createFunctionStatement createModuleStatement createProcedureStatement DeclareStatement
An ESQL schema is a named container for functions, procedures, modules, and variables. ESQL schema is similar to the namespace concept of C++ and XML, and to the package concept of Java. In the absence of a BROKER SCHEMA statement, all functions, procedures, modules, and constants belong to the default schema. The default schema is similar to the default namespace in C++, the no-target namespace in XML Schema, and the default package in Java. The concept of BROKER SCHEMA in ESQL language is equivalent to package in Java. The BROKER SCHEMA is not in the broker ESQL.
PATH clause The PATH clause specifies a list of additional schemas to be searched when matching function and procedure calls to their implementations. The schema in which the call lies is implicitly included in the PATH clause. The PATH clause is used to resolve unqualified function and procedure names in the tools according to the following algorithm. A single function or procedure must match the unqualified name, or the tools report an error. You can correct the error by qualifying the function or procedure name with a schemaId: 1. The current MODULE (if any) is searched for a matching function or procedure. MODULE-scope functions or procedures are visible only within ESQL reference
1513
their containing MODULE. If functions or procedures with the same name are found in the current MODULE and schema, MODULE-scope functions or procedures take precedence over schema scoped functions or procedures. 2.
The <node schema> (but none of its contained modules) and the <SQL-broker schema> or schemas identified by the PATH clause are searched for a matching function or procedure.
Note: The schemaId must be a fully qualified schema name. When you start a function or procedure, the name that you use must be qualified by the schema name. The behavior depends on the circumstances: For a module routine: v If the schema is specified, the named schema routine is started. The scalar built-in functions, excluding CAST, EXTRACT, and the special registers, are considered to be defined within an implicitly declared schema called SQL. v If the schema is not specified, and the calling statement is in a module routine, and a routine of the given name exists in the local module, that local routine is started. v If the schema is not specified, and the calling statement is in a module routine, and a routine of the given name does not exist in the local module, all of the schemas in the schema path are searched for a routine of the same name. If a matching function exists in one schema, it is used. A compile-time error occurs if a matching function exists in more than one schema. If there is no matching function, the schema SQL is searched. This rule and the preceding rule imply that a local module routine takes priority over a built-in routine of the same name. For a schema routine: v If the schema is specified, the named schema routine is started. The scalar built-in functions, excluding CAST, EXTRACT, and the special registers, are considered to be defined within an implicitly declared schema called SQL. v If the schema is not specified, and the caller is a schema routine, and a routine of the given name exists in the local schema, that local routine is started. v If the schema is not specified, and the calling statement is in a schema routine, and a routine of the given name does not exist in the local schema, all of the schemas in the schema path are searched for a routine of the same name. If a matching function exists in one schema, it is used. A compile-time error occurs if a matching function exists in more than one schema. If there is no matching function, the schema SQL is searched. This rule and the preceding rule imply that a local schema routine takes priority over a built-in routine of the same name. The <node schema> is defined as the schema containing the node’s message flow. The <node schema> is specified in this manner to provide compatibility with earlier versions of WebSphere Message Broker. When the <node schema> is the only schema referenced, the broker XML message does not include the extra features contained in WebSphere Message Broker V6.1. Brokers in previous versions of WebSphere Message Broker do not support multiple schemas, for example, subroutine libraries for reuse. To deploy to a broker
1514
Message Flows
in a previous version of the product, put all of the ESQL subroutines into the same schema as the message flow and node that start the ESQL subroutines. Eclipse tooling uses WebSphere Message Broker V6.1 ESQL syntax in content assist and source code validation. The broker schema of the message flow must contain, at the schema level, any of the following in its ESQL files: v A schema level function v A schema level procedure v A schema level constant v A module level constant v A module level variable Without the presence of any of the preceding items, the Eclipse tooling generates broker ESQL without MODULE and FUNCTION Main wrappers. Function and procedure names must be unique within their SCHEMA or MODULE.
Examples The following example adds a path to a schema called CommonUtils: BROKER SCHEMA CommonUtils PATH SpecialUtils; MODULE ....
The next example adds a path to the default schema: PATH CommonUtils, SpecialUtils; MODULE ....
CALL statement The CALL statement calls (invokes) a routine.
ESQL reference
1515
Syntax
CALL
RoutineName
(
ParameterList
)
BrokerSchemaName .
Qualifiers
INTO
target
BrokerSchemaName: .
Identifier
ParameterList: ,
Expression
Qualifiers: IN DatabaseSchemaReference EXTERNAL SCHEMA DatabaseSchemaName
DatabaseSchemaReference: Database
.
SchemaClause
. DatabaseSourceClause
DatabaseSourceClause: DatabaseSourceName { DatabaseSourceExpr }
SchemaClause: SchemaName { SchemaExpr }
Using the CALL statement The CALL statement invokes a routine. A routine is a user-defined function or procedure that has been defined by one of the following: v A CREATE FUNCTION statement v A CREATE PROCEDURE statement
1516
Message Flows
Note: As well as standard user-defined functions and procedures, you can also use CALL to invoke built-in (broker-provided) functions and user-defined SQL functions. However, the usual way of invoking these types of function is simply to include their names in expressions. The called routine must be invoked in a way that matches its definition. For example, if a routine has been defined with three parameters, the first two of type integer and the third of type character, the CALL statement must pass three variables to the routine, each of a data-type that matches the definition. This is called exact signature matching, which means that the signature provided by the CALL statement must match the signature provided by the routine’s definition. Exact signature matching applies to a routine’s return value as well. If the RETURNS clause is specified on the CREATE FUNCTION statement, or the routine is a built-in function, the INTO clause must be specified on the CALL statement. A return value from a routine cannot be ignored. Conversely, if the RETURNS clause is not specified on the CREATE FUNCTION statement, the INTO clause must not be specified, because there is no return value from the routine. You can use the CALL statement to invoke a routine that has been implemented in any of the following ways: v ESQL. v Java. v As a stored procedure in a database. v As a built-in (broker-provided) function. (But see the note above about calling built-in functions.) This variety of implementation means that some of the clauses in the CALL syntax diagram are not applicable (or allowed) for all types of routine. It also allows the CALL statement to invoke any type of routine, irrespective of how the routine has been defined. When the optional BrokerSchemaName parameter is not specified, the broker SQL parser searches for the named procedure using the algorithm described in the PATH statement (see the “PATH clause” on page 1513 of the BROKER SCHEMA statement). When the BrokerSchemaName parameter is specified, the broker SQL parser invokes the named procedure in the specified schema without first searching the path. However, if a procedure reference is ambiguous (that is, there are two procedures with the same name in different broker schemas) and the reference is not qualified by the optional BrokerSchemaName, the Eclipse toolset generates a “Tasks view error” that you must correct to deploy the ambiguous code. The broker-provided built-in functions are automatically placed in a predefined broker schema called SQL. The SQL schema is always searched last for a routine that has not been matched to a user-defined routine. Therefore, a user-defined module takes precedence over a built-in routine of the same name. Each broker schema provides a unique symbol or namespace for a routine, so a routine name is unique when it is qualified by the name of the schema to which it belongs. The INTO clause is used to store the return value from a routine that has been defined with a RETURNS clause, or from a built-in function. The target can be an
ESQL reference
1517
ESQL variable of a data type that matches the data type on the RETURNS clause, or a dot-separated message reference. For example, both of the following ESQL statements are valid: CALL myProc1() INTO cursor; CALL myProc1() INTO OutputRoot.XMLNS.TestValue1;
The CALL statement passes the parameters into the procedure in the order given to it. Parameters that have been defined as IN or INOUT on the routine’s definition are evaluated before the CALL is made, but parameters defined as OUT are always passed in as NULL parameters of the correct type. When the procedure has completed, any parameters declared as OUT or INOUT are updated to reflect any changes made to them during the procedure’s execution. Parameters defined as IN are never changed during the cause of a procedure’s execution. Routine overloading is not supported. This means that you cannot create two routines of the same name in the same broker schema. If the broker detects that a routine has been overloaded, it raises an exception. Similarly, you cannot invoke a database stored procedure that has been overloaded. A database stored procedure is overloaded if another procedure of the same name exists in the same database schema. However, you can invoke an overloaded Java method, as long as you create a separate ESQL definition for each overloaded method you want to call, and give each ESQL definition a unique routine name.
CASE statement The CASE statement uses rules defined in WHEN clauses to select a block of statements to process. There are two forms of the CASE statement: the simple form and the searched form.
Syntax Simple CASE statement < CASE MainExpression WHEN
END ELSE statements
1518
Message Flows
CASE
Expression
THEN
Statements
Searched CASE statement < CASE WHEN Expression
THEN
Statements
ELSE
END
statements
CASE
In the simple form, the main expression is evaluated first. Each WHEN clause expression is evaluated in turn until the result is equal to the main expression’s result. That WHEN clause’s statements are then processed. If no match is found and the optional ELSE clause is present, the ELSE clause’s statements are executed instead. The test values do not have to be literals. The only requirement is that the main expression and the WHEN clause expressions evaluate to types that can be compared. In the searched form, each WHEN clause expression is evaluated in turn until one evaluates to TRUE. That WHEN clause’s statements are then executed. If none of the expressions evaluates to TRUE and the optional ELSE clause is present, the ELSE clause’s statements are executed. There does not have to be any similarity between the expressions in each CASE clause. The only requirement is that they all evaluate to a Boolean value. The ESQL language has both a CASE statement and a CASE function (see “CASE function” on page 1647 for details of the CASE function). The CASE statement chooses one of a set of statements to execute. The CASE function chooses one of a set of expressions to evaluate and returns as its value the return value of the chosen expression.
Examples Simple CASE statement: CASE size WHEN minimum + 0 THEN SET description = 'small'; WHEN minimum + 1 THEN SET description = 'medium'; WHEN minimum + 2 THEN SET description = 'large'; CALL handleLargeObject(); ELSE SET description = 'unknown'; CALL handleError(); END CASE;
Searched CASE statement: CASE WHEN i <> 0 THEN CALL handleI(i); WHEN j> 1 THEN
ESQL reference
1519
CALL handleIZeroAndPositiveJ(j); ELSE CALL handleAllOtherCases(j); END CASE;
CREATE statement The CREATE statement creates a new message field.
1520
Message Flows
Syntax
CREATE Qualifier Target
AsClause
(1)
(2)
DomainClause
RepeatClauses ValuesClauses FromClause (3) ParseClause
Qualifier: FIELD PREVIOUSSIBLING NEXTSIBLING FIRSTCHILD LASTCHILD
OF
AsClause: AS
AliasFieldReferenceVariable
DomainClause: DOMAIN
expression
RepeatClauses: REPEAT VALUE
-expression
ValuesClauses:
NamesClauses
VALUE
expression
NamesClauses:
TYPE Expression IDENTITY PathElement
NAMESPACE
Expression
NAME
Expression
FromClause: FROM
SourceFieldReference
ParseClause: PARSE
(
BitStreamExpression
) <<
ENCODING expression CCSID expression SET expression TYPE expression FORMAT expression Options NameValueOptions
ESQL reference
1521
Options: <<-,-<< OPTIONS
expression
NameValueOptions: <<-,-<< NAMEVALUEOPTIONS
expression
Notes: 1
Do not use the DomainClause and ParseClause with the FIELD qualifier.
2
Use the RepeatClauses only with the PREVIOUSSIBLING and NEXTSIBLING qualifiers.
3
Each subclause within the ParseClause can occur once only.
The new message field is positioned either at a given location (CREATE FIELD) or relative to a currently existing location (CREATE ... OF...). New fields can be created only when the target field reference points to a modifiable message; for example, Environment, InputLocalEnvironment, OutputLocalEnvironment, OutputRoot, or OutputExceptionList. If you include a FIELD clause, the field that is specified by Target is navigated to (creating the fields, if necessary) and any values clause, or from clause, is processed. This form of CREATE statement does not necessarily create any fields at all; it ensures only that the given fields exist. If you use array indexes in the target field reference, only one instance of a particular field can be created. Therefore, if you write a SET statement that starts: SET OutputRoot.XMLNS.Message.Structure[2].Field = ...
at least one instance of Structure must already exist in the message. That is, the only fields in the tree that are created are ones on a direct path from the root to the field identified by the field reference. If you include a PREVIOUSSIBLING, NEXTSIBLING, FIRSTCHILD, or LASTCHILD clause, the field that is specified by Target is navigated to (creating the fields if necessary) in exactly the same way as for the FIELD clause. A new field is then created and attached in the specified position (for example, as PREVIOUSSIBLING or FIRSTCHILD). This form of CREATE statement always creates a new field, and places it in the specified position. If you use two CREATE FIRSTCHILD OF target statements that specify the same target, the second statement creates a new field as the first child of the target, and displaces the previously created first child to the right in the message tree (so that it is no longer the first child). Similarly, CREATE LASTCHILD OF target navigates to the target field and adds a new field as its rightmost child, displacing the previous last child to the left.
1522
Message Flows
CREATE PREVIOUSSIBLING OF Target creates a field to the immediate left of the field that is specified by Target (so the depth of the tree is not changed); similarly, CREATE NEXTSIBLING OF Target creates a field to the immediate right of the field that is specified by Target. When creating PREVIOUSSIBLING or NEXTSIBLING, you can use the REPEAT keyword to copy the type and name of the new field from the current field. AS clause: If present, the AS clause moves the named reference variable to point at the newly-created field. This is useful because you probably want to involve the new field in some further processing. DOMAIN clause: If present, the DOMAIN clause associates the new field with a new parser of the specified type. This clause expects a root field name (for example, XMLNS or MQRFH2). If the DOMAIN clause is present, but the value supplied is a zero-length character string, a new parser of the same type as the parser that owns the field specified by target is created. An exception is thrown if the supplied domain name is not CHARACTER data type or its value is NULL. Do not specify the DOMAIN clause with the FIELD clause; it is not certain that a new field is created. REPEAT clause: Use the REPEAT clause to copy the new field’s type and name from the target field. Alternatively, the new field’s type, name, and value can be: v Copied from any existing field (using the FROM clause) v Specified explicitly (using the VALUES clause) v Defined by parsing a bit stream (using the PARSE clause) In the case of the FROM and PARSE clauses, you can also create children of the new field. VALUES clause: For the VALUES clause, the type, name, and value (or any subset of these) can be specified by any expression that returns a suitable data type (INTEGER for type, CHARACTER for name, and any scalar type for value). An exception is thrown if the value supplied for a type or name is NULL. NAMES clause: The NAMES clause takes any expression that returns a non-null value of type character. The meaning depends on the presence of NAME and NAMESPACE clauses as follows: NAMESPACE
NAME
Element named as follows
No
No
The element is nameless (name flag not automatically set)
No
Yes
The element is given the name in the default namespace
Yes
No
The element is given the empty name in the given namespace ESQL reference
1523
NAMESPACE
NAME
Element named as follows
Yes
Yes
The element is given the given name in the given namespace
The IDENTITY operand takes a single path element in place of the TYPE and NAME clauses, where a path element contains (at most) a type, a namespace, a name, and an index. These specify the type, namespace, name, and index of the element to be created and follow all the rules described in the topic for field references (see “ESQL field reference overview” on page 1493). For example: IDENTITY (XMLNS.attribute)Space1:Name1[42]
See the Examples section below for how to use the IDENTITY operand. FROM clause: For the FROM clause, the new field’s type, name, and value are taken from the field pointed to by SourceFieldReference. Any existing child fields of the target are detached (the field might already exist in the case of a FIELD clause), and the new field is given copies of the source field’s children, grandchildren, and so on. PARSE clause: If a PARSE clause is present, a subtree is built under the newly-created field from the supplied bit stream. The algorithm for doing this varies from parser to parser and according to the options specified. All parsers support the mode RootBitStream, in which the tree creation algorithm is the same as that used by an input node. Some parsers also support a second mode, FolderBitStream, which generates a sub tree from a bit stream created by the ASBITSTREAM function (see “ASBITSTREAM function” on page 1633) using that mode. When you use the PARSE clause, specify a scalar value containing the bit stream that is to be parsed for BitStreamExpression. If you use a message tree field reference you must ensure it contains a scalar value that contains the bit stream. An existing message body folder such as InputRoot.XMLNSC does not contain a bit stream and therefore you cannot use this to serialize the XMLNS folder. If you pass a value other than a scalar containing the bit stream to the PARSE clause for BitStreamExpression, then the message flow produces a BIP2906 error message. Instead, you must first call the ASBITSTREAM function to serialize the existing message tree folder. The result of the ASBITSTREAM function can then be passed as the BitStreamExpression to the PARSE clause. The following example shows how to serialize the XMLNSC folder and then use the result of the ASBITSTREAM in the PARSE clause. | | | | | |
DECLARE inCCSID INT InputProperties.CodedCharSetId; DECLARE inEncoding INT InputProperties.Encoding; DECLARE inBitStream BLOB ASBITSTREAM(InputRoot.XMLNSC, inEncoding, inCCSID); CREATE LASTCHILD OF OutputRoot DOMAIN('MRM') PARSE(inBitStream, inEncoding, inCCSID, 'DP3UK14002001', 'TestCase', 'XML1', options);
When the PARSE statement is processed, any PARSE clause expressions are evaluated. An exception is thrown if any of the following expressions do not result in a non-null value of the appropriate type:
1524
Message Flows
Clause
Type
Default value
ENCODING
Integer
0
CCSID
Integer
0
SET
Character
Zero length string
TYPE
Character
Zero length string
FORMAT
Character
Zero length string
The ENCODING clause accepts any expression that returns a value of type integer. However, it is only meaningful to generate option values from the list of supplied constants: MQENC_INTEGER_NORMAL MQENC_INTEGER_REVERSED MQENC_DECIMAL_NORMAL MQENC_DECIMAL_REVERSED MQENC_FLOAT_IEEE_NORMAL MQENC_FLOAT_IEEE_REVERSED MQENC_FLOAT_S390
The values used for the CCSID clause follow the normal numbering system. For example, 1200 = UCS-2, 1208 = UTF-8. For absent clauses, the given default values are used. Use the CCSID and encoding default values because these take their values from the queue manager’s encoding and CCSID settings. Similarly, using the default values for each of the message set, type, and format options is useful, because many parsers do not require message set, type, or format information, and so any valid value is sufficient. When any expressions have been evaluated, a bit stream is parsed using the results of the expressions. Note: Because this function has a large number of clauses, an alternative syntax is supported, in which the parameters are supplied as a comma-separated list rather than by named clauses. In this case the expressions must be in the order: ENCODING -> CCSID -> SET -> TYPE -> FORMAT -> OPTIONS
The list can be truncated at any point and an entirely empty expression can be used in any clauses where you do not supply a value. For details of the syntax of the TYPE clause, refer to Specifying namespaces in the Message Type property. OPTIONS subclause: The value of the OPTIONS subclause can be either a single integer expression or a list of comma-separated integer expressions. When a list of integer expressions is supplied, the values of all the integer expressions are combined into a single integer using the logical OR operator. NAMEVALUEOPTIONS subclause:
ESQL reference
1525
The NAMEVALUEOPTIONS subclause specifies a comma-separated list of named options and their values. Each item in the list must be a string expression of the form 'optionName=value'. There are two valid option names: XMLNSC.OpaqueElement and XMLNSC.OpaqueElementLiteral. Note:
Examples of how to use the CREATE statement 1. The following example creates the specified field: CREATE FIELD OutputRoot.XMLNS.Data;
2. The following example creates a field with no name, type, or value as the first child of ref1: CREATE FIRSTCHILD OF ref1;
3. The following example creates a field using the specified type, name, and value: CREATE NEXTSIBLING OF ref1 TYPE NameValue NAME 'Price' VALUE 92.3;
4. The following example creates a field with a type and name, but no value; the field is added before the sibling indicated by the dynamic reference (ref1): CREATE PREVIOUSSIBLING OF ref1 TYPE Name NAME 'Quantity';
5. The following example creates a field named Component, and moves the reference variable targetCursor to point at it: CREATE FIRSTCHILD OF targetCursor AS targetCursor NAME 'Component';
6. The following example creates a new field as the right sibling of the field pointed to by the reference variable targetCursor having the same type and name as that field. The statement then moves targetCursor to point at the new field: CREATE NEXTSIBLING OF targetCursor AS targetCursor REPEAT;
7. The following example shows how to use the PARSE clause: DECLARE bodyBlob BLOB ASBITSTREAM(InputRoot.XMLNS, InputProperties.Encoding, InputProperties.CodedCharSetId); DECLARE creationPtr REFERENCE TO OutputRoot; CREATE LASTCHILD OF creationPtr DOMAIN('XMLNS') PARSE(bodyBlob, InputProperties.Encoding, InputProperties.CodedCharSetId);
This example can be extended to show the serializing and parsing of a field or folder: DECLARE bodyBlob BLOB ASBITSTREAM(InputRoot.XMLNS.TestCase.myFolder, InputProperties.Encoding, InputProperties.CodedCharSetId,",",",FolderBitStream); DECLARE creationPtr REFERENCE TO OutputRoot; CREATE LASTCHILD OF creationPtr DOMAIN('XMLNS') PARSE(bodyBlob, InputProperties.Encoding, InputProperties.CodedCharSetId,",",",FolderBitStream);
8. The following example shows how to use the IDENTITY operand: CREATE FIELD OutputRoot.XMLNS.TestCase.Root IDENTITY (XML.ParserRoot)Root; CREATE FIELD OutputRoot.XMLNS.TestCase.Root.Attribute IDENTITY (XML.Attribute)NSpace1:Attribute VALUE 'Attrib Value'; CREATE LASTCHILD OF OutputRoot.XMLNS.TestCase.Root IDENTITY (XML.Element)NSpace1:Element1[1] VALUE 'Element 1 Value'; CREATE LASTCHILD OF OutputRoot.XMLNS.TestCase.Root IDENTITY (XML.Element)NSpace1:Element1[2] VALUE 'Element 2 Value';
This sequence of statements produces the following output message:
1526
Message Flows
Element 1 Value Element 2 Value
9. The following example shows how you can use the DOMAIN clause to avoid losing information unique to the XMLNS parser when an unlike parser copy occurs: DECLARE bodyBlob BLOB ASBITSTREAM(InputRoot.XMLNS, InputProperties.Encoding, InputProperties.CodedCharSetId); CREATE FIELD Environment.Variables.myXMLTree; DECLARE creationPtr REFERENCE TO Environment.Variables.myXMLTree; CREATE FIRSTCHILD OF creationPtr DOMAIN('XMLNS') PARSE(bodyBlob, InputProperties.Encoding, InputProperties.CodedCharSetId);
An example of a CREATE statement This example provides sample ESQL and an input message, which together produce the output message at the end of the example. CREATE COMPUTE MODULE CreateStatement_Compute CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN CALL CopyMessageHeaders(); CREATE FIELD OutputRoot.XMLNS.TestCase.description TYPE NameValue VALUE 'This is my TestCase' ; DECLARE cursor REFERENCE TO OutputRoot.XMLNS.TestCase; CREATE FIRSTCHILD OF cursor Domain('XMLNS') NAME 'Identifier' VALUE InputRoot.XMLNS.TestCase.Identifier; CREATE LASTCHILD OF cursor Domain('XMLNS') NAME 'Sport' VALUE InputRoot.XMLNS.TestCase.Sport; CREATE LASTCHILD OF cursor Domain('XMLNS') NAME 'Date' VALUE InputRoot.XMLNS.TestCase.Date; CREATE LASTCHILD OF cursor Domain('XMLNS') NAME 'Type' VALUE InputRoot.XMLNS.TestCase.Type; CREATE FIELD cursor.Division[1].Number TYPE NameValue VALUE 'Premiership'; CREATE FIELD cursor.Division[1].Result[1].Number TYPE NameValue VALUE '1' ; CREATE FIELD cursor.Division[1].Result[1].Home TYPE Name; CREATE LASTCHILD OF cursor.Division[1].Result[1].Home NAME 'Team' VALUE 'Liverpool' ; CREATE LASTCHILD OF cursor.Division[1].Result[1].Home NAME 'Score' VALUE '4'; CREATE FIELD cursor.Division[1].Result[1].Away TYPE Name; CREATE LASTCHILD OF cursor.Division[1].Result[1].Away NAME 'Team' VALUE 'Everton'; CREATE LASTCHILD OF cursor.Division[1].Result[1].Away NAME 'Score' VALUE '0'; CREATE FIELD cursor.Division[1].Result[2].Number TYPE NameValue VALUE '2'; CREATE FIELD cursor.Division[1].Result[2].Home TYPE Name; CREATE LASTCHILD OF cursor.Division[1].Result[2].Home NAME 'Team' VALUE 'Manchester United'; CREATE LASTCHILD OF cursor.Division[1].Result[2].Home NAME 'Score' VALUE '2'; CREATE FIELD cursor.Division[1].Result[2].Away TYPE Name; CREATE LASTCHILD OF cursor.Division[1].Result[2].Away NAME 'Team' VALUE 'Arsenal'; CREATE LASTCHILD OF cursor.Division[1].Result[2].Away NAME 'Score' VALUE '3'; CREATE FIELD cursor.Division[2].Number TYPE NameValue VALUE '2'; CREATE FIELD cursor.Division[2].Result[1].Number TYPE NameValue VALUE '1'; CREATE FIELD cursor.Division[2].Result[1].Home TYPE Name; CREATE LASTCHILD OF cursor.Division[2].Result[1].Home NAME 'Team' VALUE 'Port Vale'; CREATE LASTCHILD OF cursor.Division[2].Result[1].Home NAME 'Score' VALUE '9' ; CREATE FIELD cursor.Division[2].Result[1].Away TYPE Name; CREATE LASTCHILD OF cursor.Division[2].Result[1].Away NAME 'Team' VALUE 'Brentford'; CREATE LASTCHILD OF cursor.Division[2].Result[1].Away NAME 'Score' VALUE '5'; END; CREATE PROCEDURE CopyMessageHeaders() BEGIN DECLARE I INTEGER 1; DECLARE J INTEGER CARDINALITY(InputRoot.*[]); WHILE I < J DO SET OutputRoot.*[I] = InputRoot.*[I]; ESQL reference
1527
SET I = I + 1; END WHILE; END; END MODULE;
CREATE FUNCTION statement The CREATE FUNCTION statement defines a callable function or procedure. You can also use the CREATE PROCEDURE statement to define a callable function or procedure, also known as a routine.
1528
Message Flows
Syntax
CREATE
RoutineType
RoutineName (
ParameterList
) RoutineBody
ReturnType
Language
ResultSet
RoutineType: FUNCTION PROCEDURE
ParameterList: ,
Parameter
Parameter: (1) IN OUT INOUT
ParameterName
DataType CONSTANT (2) NAMESPACE NAME
ReturnType: RETURNS DataType
Language: LANGUAGE
ESQL (3) DATABASE JAVA
ResultSet: DYNAMIC RESULT SETS integer
RoutineBody: Statement EXTERNAL NAME
ExternalRoutineName
Notes: 1
If the routine type is FUNCTION, the direction indicator (IN, OUT, or ESQL reference
1529
INOUT) is optional for each parameter. However, for documentation purposes, it is good programming practice to specify a direction indicator for all new routines; if you do not specify the direction, a default value of IN is used. 2
When the NAMESPACE or NAME clause is used, its value is implicitly CONSTANT and of type CHARACTER. For information about the use of CONSTANT variables, see the “DECLARE statement” on page 1553.
3
If the routine type is FUNCTION, you cannot specify a LANGUAGE of DATABASE.
Overview The CREATE FUNCTION and CREATE PROCEDURE statements define a callable function or procedure, also known as a routine. In previous versions of this product, CREATE FUNCTION and CREATE PROCEDURE had different uses and different capabilities. Subsequent enhancements have resulted in the differences listed previously in notes 1 and 3. Routines are useful for creating reusable blocks of code that can be run independently many times. You can implement them as a series of ESQL statements, a Java method, or a database stored procedure. This flexibility means that some of the clauses in the syntax diagram are not applicable (or allowed) for all types of routine. Each routine has a name, which must be unique within the schema to which it belongs. Routine names therefore cannot be overloaded; if the broker detects that a routine name has been overloaded, it raises an exception. The LANGUAGE clause specifies the language in which the routine’s body is written. The options are: DATABASE The procedure is called as a database stored procedure. ESQL The procedure is called as an ESQL routine. JAVA The procedure is called as a static method in a Java class. Unspecified If you do not specify the LANGUAGE clause, the default language is ESQL unless you specify the EXTERNAL NAME clause (in which case, the default language is DATABASE). Restrictions on the use of the LANGUAGE clause exist. You cannot use: v The ESQL option with an EXTERNAL NAME clause v The DATABASE or JAVA options without an EXTERNAL NAME clause v The DATABASE option with a routine type of FUNCTION Specify the routine’s name using the RoutineName clause, and the routine’s parameters using the ParameterList clause. If the LANGUAGE clause specifies ESQL, implement the routine using a single ESQL statement. This statement is
1530
Message Flows
most useful if it is a compound statement (BEGIN ... END), because it can then contain as many ESQL statements as necessary to fulfil its function. Alternatively, instead of providing an ESQL body for the routine, you can specify a LANGUAGE clause other than ESQL. You can then use the EXTERNAL NAME clause to provide a reference to the actual body of the routine, wherever it is located externally to the broker. For more information about using the EXTERNAL NAME clause, see “Invoking stored procedures” on page 359 and Calling a Java routine. Routines of any LANGUAGE type can have IN, OUT, and INOUT parameters. The caller can pass several values into the routine, and receive back several updated values. These returned parameters are in addition to any RETURNS clause that you have defined for the routine. The RETURNS clause defines the value that the routine returns to the caller. Routines that are implemented in different languages have their own restrictions on which data types can be passed in or returned; these restrictions are documented later in this section. The data type of the returned value must match the data type of the value that is defined to be returned from the routine. Also, if a routine is defined to have a return value, the caller of the routine cannot ignore it. For more information see “CALL statement” on page 1515. Routines can be defined in either a module or a schema. Routines that are defined in a module are local in scope to the current node, which means that only code belonging to that same module (or node) can invoke them. Routines that are defined in a schema, however, can be invoked by using either of the following options: v Code in the same schema v Code in any other schema, if either of the following conditions applies: – The other schema’s PATH clause contains the path to the called routine – The called routine is invoked using its fully qualified name (which is its name, prefixed by its schema name, separated by a period) Thus, if you need to invoke the same routine in more than one node, define it in a schema. For any language or routine type, the method of invocation of the routine must match the manner of declaration of the routine. If the routine has a RETURNS clause, use either the FUNCTION invocation syntax or a CALL statement with an INTO clause. Conversely, if a routine has no RETURNS clause, you must use a CALL statement without an INTO clause.
Parameter directions Parameters that are passed to routines always have a direction associated with them, which is one of the following types: IN The value of the parameter cannot be changed by the routine. A NULL value for the parameter is allowed, and can be passed to the routine. OUT When it is received by the called routine, the parameter that is passed into the routine always has a NULL value of the correct data type. This value is set irrespective of its value before the routine is called. The routine is allowed to change the value of the parameter. ESQL reference
1531
INOUT INOUT is both an IN and an OUT parameter. It passes a value into the routine, and the value that is passed in can be changed by the routine. A NULL value for the parameter is allowed, and can be passed both into and out of the routine. If the routine type is FUNCTION, the direction indicator (IN, OUT, INOUT) is optional for each parameter. However, it is good programming practice to specify a direction indicator for all new routines of any type for documentation purposes. ESQL variables that are declared to be CONSTANT (or references to variables declared to be CONSTANT) are not allowed to have the direction OUT or INOUT.
ESQL routines ESQL routines are written in ESQL, and have a LANGUAGE clause of ESQL. The body of an ESQL routine is typically a compound statement of the form BEGIN ... END, that contains multiple statements for processing the parameters that are passed to the routine.
ESQL example 1 The following example shows the same procedure as in “Database routine example 1” on page 1550, but is implemented as an ESQL routine and not as a stored procedure. The CALL syntax and results of this routine are the same as those in “Restrictions on Java routines” on page 1536. CREATE PROCEDURE swapParms ( IN parm1 CHARACTER, OUT parm2 CHARACTER, INOUT parm3 CHARACTER ) BEGIN SET parm2 = parm3; SET parm3 = parm1; END;
ESQL example 2 This example procedure shows the recursive use of an ESQL routine. It parses a tree, visiting all places at and below the specified starting point, and reports what it has found: SET OutputRoot.MQMD = InputRoot.MQMD; DECLARE answer CHARACTER; SET answer = ''; CALL navigate(InputRoot.XMLNS, answer); SET OutputRoot.XMLNS.Data.FieldNames = answer; CREATE PROCEDURE navigate (IN root REFERENCE, INOUT answer CHARACTER) BEGIN SET answer = answer || 'Reached Field... Type:' || CAST(FIELDTYPE(root) AS CHAR)|| ': Name:' || FIELDNAME(root) || ': Value :' || root || ': '; DECLARE cursor REFERENCE TO root; MOVE cursor FIRSTCHILD; IF LASTMOVE(cursor) THEN SET answer = answer || 'Field has children... drilling down '; ELSE
1532
Message Flows
SET answer = answer || 'Listing siblings... '; END IF; WHILE LASTMOVE(cursor) DO CALL navigate(cursor, answer); MOVE cursor NEXTSIBLING; END WHILE; SET answer = answer || 'Finished siblings... Popping up '; END;
When given the following input message: John Smith <Salary period='monthly' taxable='yes'>-1200
the procedure produces the following output, which has been manually formatted: Reached Field... Type:16777232: Name:XML: Value :: Field has children... drilling down Reached Field... Type:16777216: Name:Person: Value :: Field has children... drilling down Reached Field... Type:16777216: Name:Name: Value :John Smith: Field has children... drilling down Reached Field... Type:33554432: Name:: Value :John Smith: Listing siblings... Finished siblings... Popping up Finished siblings... Popping up Reached Field... Type:16777216: Name:Salary: Value :-1200: Field has children... drilling down Reached Field... Type:50331648: Name:period: Value :monthly: Listing siblings... Finished siblings... Popping up Reached Field... Type:50331648: Name:taxable: Value :yes: Listing siblings... Finished siblings... Popping up Reached Field... Type:33554432: Name:: Value :-1200: Listing siblings... Finished siblings... Popping up Finished siblings... Popping up Finished siblings... Popping up Finished siblings... Popping up
Java routines A Java routine is implemented as a Java method, and has a LANGUAGE clause of JAVA. For Java routines, the ExternalRoutineName must contain the class name and method name of the Java method to be called. Specify the ExternalRoutineName like this: >>--"-- className---.---methodName--"--------------><
where className identifies the class that contains the method and methodName identifies the method to invoke. If the class is part of a package, the class identifier part must include the complete package prefix; for example, “com.ibm.broker.test.MyClass.myMethod”. To find the Java class, the broker uses the search method that is described in “Deploying Java classes” on page 1536. Any Java method that you want to invoke must have the following basic signature: public static <method-name> (< 0 - N parameters>)
where must be in the list of Java IN data types in the table in “ESQL to Java data type mapping” on page 1535 (excluding the REFERENCE type, which is not permitted as a return value), or the Java void data type. The ESQL reference
1533
parameter data types must also be in the “ESQL to Java data type mapping” on page 1535 table. In addition, the Java method is not allowed to have an exception throws clause in its signature. The Java method’s signature must match the ESQL routine’s declaration of the method. You must also observe the following rules: v Ensure that the Java method name, including the class name and any package qualifiers, matches the procedure’s EXTERNAL NAME. v If the Java return type is void, do not put a RETURNS clause on the ESQL routine’s definition. Conversely, if the Java return type is not void, you must put a RETURNS clause on the ESQL routine’s definition. v Ensure that every parameter’s type and direction matches the ESQL declaration, according to the rules listed in the table in “ESQL to Java data type mapping” on page 1535. v Ensure that the method’s return type matches the data type of the RETURNS clause. v Enclose EXTERNAL NAME in quotation marks because it must contain at least ″class.method″. v If you want to invoke an overloaded Java method, you must create a separate ESQL definition for each overloaded method and give each ESQL definition a unique routine name. You can use the Java user-defined node API in your Java method, provided that you observe the restrictions documented in “Restrictions on Java routines” on page 1536. For more information about using the Java API, see Compiling a Java user-defined node.
Java routine example 1 This routine contains three parameters of varying directions, and returns an integer, which maps to a Java return type of java.lang.Long. CREATE FUNCTION myProc1( IN P1 INTEGER, OUT P2 INTEGER, INOUT P3 INTEGER ) RETURNS INTEGER LANGUAGE JAVA EXTERNAL NAME "com.ibm.broker.test.MyClass.myMethod1";
You can use the following ESQL to invoke myProc1: CALL myProc1( intVar1, intVar2, intVar3) INTO intReturnVar3; -- or SET intReturnVar3 = myProc1( intVar1, intVar2, intVar3);
Java routine example 2 This routine contains three parameters of varying directions and has a Java return type of void. CREATE PROCEDURE myProc2( IN P1 INTEGER, OUT P2 INTEGER, INOUT P3 INTEGER ) LANGUAGE JAVA EXTERNAL NAME "com.ibm.broker.test.MyClass.myMethod2";
You must use the following ESQL to invoke myProc2: CALL myProc2(intVar1, intVar2, intVar3);
The following Java class provides a method for each of the preceding Java examples:
1534
Message Flows
package com.ibm.broker.test; class MyClass { public static Long myMethod1( Long P1, Long[] P2 Long[] P3) { ... } public static void myMethod2( Long P2, Long[] P2 Long[] P3) { ... } /* When either of these methods is called: P1 may or may not be NULL (depending on the value of intVar1). P2[0] is always NULL (whatever the value of intVar2). P3[0] may or may not be NULL (depending on the value of intVar3). This is the same as with LANGUAGE ESQL routines. When these methods return: intVar1 is unchanged intVar2 may still be NULL or may have been changed intVar3 may contain the same value or may have been changed. This is the same as with LANGUAGE ESQL routines. When myMethod1 returns: intReturnVar3 is either NULL (if the method returns NULL) or it contains the value returned by the method. */ }
ESQL to Java data type mapping The following table summarizes the mappings from ESQL to Java. Notes: v Only the Java scalar wrappers are passed to Java. v The ESQL scalar types are mapped to Java data types as object wrappers, or object wrapper arrays, depending upon the direction of the procedure parameter. Each wrapper array contains exactly one element. v Scalar object wrappers are used to allow NULL values to be passed to and from Java methods. ESQL data types
1
Java IN data types
Java INOUT and OUT data types
INTEGER, INT
java.lang.Long
java.lang.Long []
FLOAT
java.lang.Double
java.lang.Double[]
DECIMAL
java.math.BigDecimal
java.math.BigDecimal[]
CHARACTER, CHAR
java.lang.String
java.lang.String[]
BLOB
byte[]
byte[][]
BIT
java.util.BitSet
java.util.BitSet[]
com.ibm.broker.plugin.MbDate
com.ibm.broker.plugin.MbDate[]
com.ibm.broker.plugin.MbTime
com.ibm.broker.plugin.MbTime[]
com.ibm.broker.plugin.MbTime
com.ibm.broker.plugin.MbTime[]
com.ibm.broker.plugin.MbTimestamp
com.ibm.broker.plugin.MbTimestamp[]
com.ibm.broker.plugin.MbTimestamp
com.ibm.broker.plugin.MbTimestamp[]
Not supported
Not supported
java.lang.Boolean
java.lang.Boolean[]
com.ibm.broker.plugin.MbElement
com.ibm.broker.plugin.MbElement[] (Supported for INOUT. Not supported for OUT)
Not supported
Not supported
DATE TIME
2
GMTTIME
2
TIMESTAMP
2
GMTTIMESTAMP
2
INTERVAL BOOLEAN REFERENCE (to a message tree)
3 4
5 6
ROW
ESQL reference
1535
LIST
Not supported
Not supported
1. Variables that are declared to be CONSTANT (or references to variables that are declared to be CONSTANT) are not allowed to have the direction INOUT or OUT. 2. The time zone set in the Java variable is not important; you obtain the required time zone in the output ESQL. 3. The reference parameter cannot be NULL when passed into a Java method. 4. The reference cannot have the direction OUT when passed into a Java method. 5. If an MbElement is passed back from Java to ESQL as an INOUT parameter, it must point to a location in the same message tree as that pointed to by the MbElement that was passed into the called Java method. For example, if an ESQL reference to OutputRoot.XML.Test is passed into a Java method as an INOUT MbElement, but a different MbElement is passed back to ESQL when the call returns, the different element must also point to somewhere in the OutputRoot tree. 6. An MbElement cannot be returned from a Java method with the RETURNS clause, because no ESQL routine can return a reference. However, an MbElement can be returned as an INOUT direction parameter, subject to the conditions described in point 5. A REFERENCE to a scalar variable can be used in the CALL of a Java method, provided that the data type of the variable to which the reference refers matches the corresponding data type in the Java program signature.
Restrictions on Java routines The following restrictions apply to Java routines that are called from ESQL: v The Java method must be threadsafe (reentrant). v Database connections must be JDBC type 2 or type 4. Furthermore, database operations are not part of a broker transaction and therefore cannot be controlled by an external resource coordinator (as is the case in an XA environment). v The Java user-defined node API must be used only by the same thread that invoked the Java method. You can create threads inside your method. However, created threads must not use the Java APIs, and you must return control back to the broker. All restrictions that apply to the usage of the Java API also apply to Java methods that are called from ESQL. v Java methods that are called from ESQL must not use the MbNode class. Therefore, they cannot create objects of type MbNode, or call any of the methods on an existing MbNode object. v WebSphere MQ or JMS work done inside a Java method that is called from ESQL must be done in accordance with the guidelines for performing WebSphere MQ and JMS work in a user-defined node. See Planning user-defined input nodes.
Deploying Java classes You can deploy your Java classes to a broker within a Java Archive (JAR) file, using one of the following two methods: 1. Add the JAR file to the broker archive (BAR) file
1536
Message Flows
The most efficient and flexible method of deploying to the broker is to add your JAR file to the BAR file. You can do this manually or automatically using the workbench. If the workbench finds the correct Java class inside a referenced Java project open in the workspace, it automatically compiles the Java class into a JAR file and adds it to the BAR file. This procedure is the same procedure that you follow to deploy a JavaCompute node inside a JAR, as described in User-defined node classloading. When you deploy a JAR file from the workbench, the flow that has been redeployed reloads the JAR file contained in the BAR file. The files are also reloaded if the message flow that references a Java class is stopped and restarted. Ensure that you stop and restart (or redeploy) all flows that reference the JAR file that you want to update. This action avoids the problem of some flows running with the old version of the JAR file and other flows running with the new version. The workbench deploys only JAR files; it does not deploy standalone Java class files. 2. Store the JAR file in either of the following locations: a. The workpath/shared-classes/ folder on the machine running the broker b. The CLASSPATH environment variable on the computer running the broker You must complete this action manually; you cannot use the workbench. In this method, redeploying the message flow does not reload the referenced Java classes; neither does stopping and restarting the message flow. The only way to reload the classes in this case is to stop and restart the broker itself. To enable the broker to find a Java class, ensure that it is in one of the preceding locations. If the broker cannot find the specified class, it generates an exception. Although you have the choices shown previously when you deploy the JAR file, using the workbench to deploy the BAR file provides the greatest flexibility when redeploying the JAR file.
Database routines CREATE FUNCTION does not support database routines. Use CREATE PROCEDURE to define a database routine.
CREATE MODULE statement The CREATE MODULE statement creates a module, which is a named container associated with a node.
ESQL reference
1537
Syntax
(1) CREATE
COMPUTE DATABASE FILTER
MODULE
ModuleName
END MODULE
<<---;---<<
ModuleStatement
Notes: 1
ModuleName must be a valid identifier
A module in the Eclipse tools is referred to from a message processing node by name. The module must be in the <node schema>. Module names occupy the same symbol space as functions and procedures defined in the schema. That is, modules, functions, and procedures contained by a schema must all have unique names. Note: You are warned if there is no module associated with an ESQL node. You cannot deploy a flow containing a node in which a module is missing. The modules for the Compute node, Database node, and Filter node must all contain exactly one function called Main. This function should return a Boolean. It is the entry point used by a message flow node when processing a message. Correlation name
Compute module
Filter module
Database module
Database
×
×
×
Environment
×
×
×
Root
×
×
Body
×
×
Properties
×
×
ExceptionList
×
×
LocalEnvironment
×
×
InputRoot
×
InputBody
×
InputProperties
×
InputExceptionList
×
InputLocalEnvironment
×
OutputRoot
×
OutputExceptionList
×
OutputLocalEnvironment
×
DestinationList
1538
Message Flows
Deprecated synonym for LocalEnvironment
Correlation name
Compute module
Filter module
InputDestinationList
Deprecated synonym for InputLocalEnvironment
OutputDestinationList
Deprecated synonym for OutputLocalEnvironment
Database module
CREATE PROCEDURE statement The CREATE PROCEDURE statement defines a callable function or procedure. You can also use the CREATE FUNCTION statement to define a callable function or procedure, also known as a routine.
ESQL reference
1539
Syntax
CREATE
RoutineType
RoutineName (
ParameterList
) RoutineBody
ReturnType
Language
ResultSet
RoutineType: FUNCTION PROCEDURE
ParameterList: ,
Parameter
Parameter: (1) IN OUT INOUT
ParameterName
DataType CONSTANT (2) NAMESPACE NAME
ReturnType: RETURNS DataType
Language: LANGUAGE
ESQL (3) DATABASE JAVA
ResultSet: DYNAMIC RESULT SETS integer
RoutineBody: Statement EXTERNAL NAME
ExternalRoutineName
Notes: 1
1540
Message Flows
If the routine type is FUNCTION, the direction indicator (IN, OUT, or
INOUT) is optional for each parameter. However, for documentation purposes, it is good programming practice to specify a direction indicator for all new routines; if you do not specify the direction, a default value of IN is used. 2
When the NAMESPACE or NAME clause is used, its value is implicitly CONSTANT and of type CHARACTER. For information about the use of CONSTANT variables, see the “DECLARE statement” on page 1553.
3
If the routine type is FUNCTION, you cannot specify a LANGUAGE of DATABASE.
Overview The CREATE FUNCTION and CREATE PROCEDURE statements define a callable function or procedure, also known as a routine. In previous versions of this product, CREATE FUNCTION and CREATE PROCEDURE had different uses and different capabilities. Subsequent enhancements have resulted in the differences listed previously in notes 1 and 3. Routines are useful for creating reusable blocks of code that can be run independently many times. You can implement them as a series of ESQL statements, a Java method, or a database stored procedure. This flexibility means that some of the clauses in the syntax diagram are not applicable (or allowed) for all types of routine. Each routine has a name, which must be unique within the schema to which it belongs. Routine names therefore cannot be overloaded; if the broker detects that a routine name has been overloaded, it raises an exception. The LANGUAGE clause specifies the language in which the routine’s body is written. The options are: DATABASE The procedure is called as a database stored procedure. ESQL The procedure is called as an ESQL routine. JAVA The procedure is called as a static method in a Java class. Unspecified If you do not specify the LANGUAGE clause, the default language is ESQL unless you specify the EXTERNAL NAME clause (in which case, the default language is DATABASE). Restrictions on the use of the LANGUAGE clause exist. You cannot use: v The ESQL option with an EXTERNAL NAME clause v The DATABASE or JAVA options without an EXTERNAL NAME clause v The DATABASE option with a routine type of FUNCTION Specify the routine’s name using the RoutineName clause, and the routine’s parameters using the ParameterList clause. If the LANGUAGE clause specifies ESQL, implement the routine using a single ESQL statement. This statement is
ESQL reference
1541
most useful if it is a compound statement (BEGIN ... END), because it can then contain as many ESQL statements as necessary to fulfil its function. Alternatively, instead of providing an ESQL body for the routine, you can specify a LANGUAGE clause other than ESQL. You can then use the EXTERNAL NAME clause to provide a reference to the actual body of the routine, wherever it is located externally to the broker. For more information about using the EXTERNAL NAME clause, see “Invoking stored procedures” on page 359 and Calling a Java routine. Routines of any LANGUAGE type can have IN, OUT, and INOUT parameters. The caller can pass several values into the routine, and receive back several updated values. These returned parameters are in addition to any RETURNS clause that you have defined for the routine. The RETURNS clause defines the value that the routine returns to the caller. Routines that are implemented in different languages have their own restrictions on which data types can be passed in or returned; these restrictions are documented later in this section. The data type of the returned value must match the data type of the value that is defined to be returned from the routine. Also, if a routine is defined to have a return value, the caller of the routine cannot ignore it. For more information see “CALL statement” on page 1515. Routines can be defined in either a module or a schema. Routines that are defined in a module are local in scope to the current node, which means that only code belonging to that same module (or node) can invoke them. Routines that are defined in a schema, however, can be invoked by using either of the following options: v Code in the same schema v Code in any other schema, if either of the following conditions applies: – The other schema’s PATH clause contains the path to the called routine – The called routine is invoked using its fully qualified name (which is its name, prefixed by its schema name, separated by a period) Thus, if you need to invoke the same routine in more than one node, define it in a schema. For any language or routine type, the method of invocation of the routine must match the manner of declaration of the routine. If the routine has a RETURNS clause, use either the FUNCTION invocation syntax or a CALL statement with an INTO clause. Conversely, if a routine has no RETURNS clause, you must use a CALL statement without an INTO clause.
Parameter directions Parameters that are passed to routines always have a direction associated with them, which is one of the following types: IN The value of the parameter cannot be changed by the routine. A NULL value for the parameter is allowed, and can be passed to the routine. OUT When it is received by the called routine, the parameter that is passed into the routine always has a NULL value of the correct data type. This value is set irrespective of its value before the routine is called. The routine is allowed to change the value of the parameter.
1542
Message Flows
INOUT INOUT is both an IN and an OUT parameter. It passes a value into the routine, and the value that is passed in can be changed by the routine. A NULL value for the parameter is allowed, and can be passed both into and out of the routine. If the routine type is FUNCTION, the direction indicator (IN, OUT, INOUT) is optional for each parameter. However, it is good programming practice to specify a direction indicator for all new routines of any type for documentation purposes. ESQL variables that are declared to be CONSTANT (or references to variables declared to be CONSTANT) are not allowed to have the direction OUT or INOUT.
ESQL routines ESQL routines are written in ESQL, and have a LANGUAGE clause of ESQL. The body of an ESQL routine is typically a compound statement of the form BEGIN ... END, that contains multiple statements for processing the parameters that are passed to the routine.
ESQL example 1 The following example shows the same procedure as in “Database routine example 1” on page 1550, but is implemented as an ESQL routine and not as a stored procedure. The CALL syntax and results of this routine are the same as those in “Restrictions on Java routines” on page 1536. CREATE PROCEDURE swapParms ( IN parm1 CHARACTER, OUT parm2 CHARACTER, INOUT parm3 CHARACTER ) BEGIN SET parm2 = parm3; SET parm3 = parm1; END;
ESQL example 2 This example procedure shows the recursive use of an ESQL routine. It parses a tree, visiting all places at and below the specified starting point, and reports what it has found: SET OutputRoot.MQMD = InputRoot.MQMD; DECLARE answer CHARACTER; SET answer = ''; CALL navigate(InputRoot.XMLNS, answer); SET OutputRoot.XMLNS.Data.FieldNames = answer; CREATE PROCEDURE navigate (IN root REFERENCE, INOUT answer CHARACTER) BEGIN SET answer = answer || 'Reached Field... Type:' || CAST(FIELDTYPE(root) AS CHAR)|| ': Name:' || FIELDNAME(root) || ': Value :' || root || ': '; DECLARE cursor REFERENCE TO root; MOVE cursor FIRSTCHILD; IF LASTMOVE(cursor) THEN SET answer = answer || 'Field has children... drilling down '; ELSE ESQL reference
1543
SET answer = answer || 'Listing siblings... '; END IF; WHILE LASTMOVE(cursor) DO CALL navigate(cursor, answer); MOVE cursor NEXTSIBLING; END WHILE; SET answer = answer || 'Finished siblings... Popping up '; END;
When given the following input message: John Smith <Salary period='monthly' taxable='yes'>-1200
the procedure produces the following output, which has been manually formatted: Reached Field... Type:16777232: Name:XML: Value :: Field has children... drilling down Reached Field... Type:16777216: Name:Person: Value :: Field has children... drilling down Reached Field... Type:16777216: Name:Name: Value :John Smith: Field has children... drilling down Reached Field... Type:33554432: Name:: Value :John Smith: Listing siblings... Finished siblings... Popping up Finished siblings... Popping up Reached Field... Type:16777216: Name:Salary: Value :-1200: Field has children... drilling down Reached Field... Type:50331648: Name:period: Value :monthly: Listing siblings... Finished siblings... Popping up Reached Field... Type:50331648: Name:taxable: Value :yes: Listing siblings... Finished siblings... Popping up Reached Field... Type:33554432: Name:: Value :-1200: Listing siblings... Finished siblings... Popping up Finished siblings... Popping up Finished siblings... Popping up Finished siblings... Popping up
Java routines A Java routine is implemented as a Java method, and has a LANGUAGE clause of JAVA. For Java routines, the ExternalRoutineName must contain the class name and method name of the Java method to be called. Specify the ExternalRoutineName like this: >>--"-- className---.---methodName--"--------------><
where className identifies the class that contains the method and methodName identifies the method to invoke. If the class is part of a package, the class identifier part must include the complete package prefix; for example, “com.ibm.broker.test.MyClass.myMethod”. To find the Java class, the broker uses the search method that is described in “Deploying Java classes” on page 1536. Any Java method that you want to invoke must have the following basic signature: public static <method-name> (< 0 - N parameters>)
where must be in the list of Java IN data types in the table in “ESQL to Java data type mapping” on page 1535 (excluding the REFERENCE type, which is not permitted as a return value), or the Java void data type. The
1544
Message Flows
parameter data types must also be in the “ESQL to Java data type mapping” on page 1535 table. In addition, the Java method is not allowed to have an exception throws clause in its signature. The Java method’s signature must match the ESQL routine’s declaration of the method. You must also observe the following rules: v Ensure that the Java method name, including the class name and any package qualifiers, matches the procedure’s EXTERNAL NAME. v If the Java return type is void, do not put a RETURNS clause on the ESQL routine’s definition. Conversely, if the Java return type is not void, you must put a RETURNS clause on the ESQL routine’s definition. v Ensure that every parameter’s type and direction matches the ESQL declaration, according to the rules listed in the table in “ESQL to Java data type mapping” on page 1535. v Ensure that the method’s return type matches the data type of the RETURNS clause. v Enclose EXTERNAL NAME in quotation marks because it must contain at least ″class.method″. v If you want to invoke an overloaded Java method, you must create a separate ESQL definition for each overloaded method and give each ESQL definition a unique routine name. You can use the Java user-defined node API in your Java method, provided that you observe the restrictions documented in “Restrictions on Java routines” on page 1536. For more information about using the Java API, see Compiling a Java user-defined node.
Java routine example 1 This routine contains three parameters of varying directions, and returns an integer, which maps to a Java return type of java.lang.Long. CREATE FUNCTION myProc1( IN P1 INTEGER, OUT P2 INTEGER, INOUT P3 INTEGER ) RETURNS INTEGER LANGUAGE JAVA EXTERNAL NAME "com.ibm.broker.test.MyClass.myMethod1";
You can use the following ESQL to invoke myProc1: CALL myProc1( intVar1, intVar2, intVar3) INTO intReturnVar3; -- or SET intReturnVar3 = myProc1( intVar1, intVar2, intVar3);
Java routine example 2 This routine contains three parameters of varying directions and has a Java return type of void. CREATE PROCEDURE myProc2( IN P1 INTEGER, OUT P2 INTEGER, INOUT P3 INTEGER ) LANGUAGE JAVA EXTERNAL NAME "com.ibm.broker.test.MyClass.myMethod2";
You must use the following ESQL to invoke myProc2: CALL myProc2(intVar1, intVar2, intVar3);
The following Java class provides a method for each of the preceding Java examples:
ESQL reference
1545
package com.ibm.broker.test; class MyClass { public static Long myMethod1( Long P1, Long[] P2 Long[] P3) { ... } public static void myMethod2( Long P2, Long[] P2 Long[] P3) { ... } /* When either of these methods is called: P1 may or may not be NULL (depending on the value of intVar1). P2[0] is always NULL (whatever the value of intVar2). P3[0] may or may not be NULL (depending on the value of intVar3). This is the same as with LANGUAGE ESQL routines. When these methods return: intVar1 is unchanged intVar2 may still be NULL or may have been changed intVar3 may contain the same value or may have been changed. This is the same as with LANGUAGE ESQL routines. When myMethod1 returns: intReturnVar3 is either NULL (if the method returns NULL) or it contains the value returned by the method. */ }
ESQL to Java data type mapping The following table summarizes the mappings from ESQL to Java. Notes: v Only the Java scalar wrappers are passed to Java. v The ESQL scalar types are mapped to Java data types as object wrappers, or object wrapper arrays, depending upon the direction of the procedure parameter. Each wrapper array contains exactly one element. v Scalar object wrappers are used to allow NULL values to be passed to and from Java methods. ESQL data types
1
Java IN data types
Java INOUT and OUT data types
INTEGER, INT
java.lang.Long
java.lang.Long []
FLOAT
java.lang.Double
java.lang.Double[]
DECIMAL
java.math.BigDecimal
java.math.BigDecimal[]
CHARACTER, CHAR
java.lang.String
java.lang.String[]
BLOB
byte[]
byte[][]
BIT
java.util.BitSet
java.util.BitSet[]
com.ibm.broker.plugin.MbDate
com.ibm.broker.plugin.MbDate[]
com.ibm.broker.plugin.MbTime
com.ibm.broker.plugin.MbTime[]
com.ibm.broker.plugin.MbTime
com.ibm.broker.plugin.MbTime[]
com.ibm.broker.plugin.MbTimestamp
com.ibm.broker.plugin.MbTimestamp[]
com.ibm.broker.plugin.MbTimestamp
com.ibm.broker.plugin.MbTimestamp[]
Not supported
Not supported
java.lang.Boolean
java.lang.Boolean[]
com.ibm.broker.plugin.MbElement
com.ibm.broker.plugin.MbElement[] (Supported for INOUT. Not supported for OUT)
Not supported
Not supported
DATE TIME
2
GMTTIME
2
TIMESTAMP
2
GMTTIMESTAMP
2
INTERVAL BOOLEAN REFERENCE (to a message tree)
3 4
5 6
ROW
1546
Message Flows
LIST
Not supported
Not supported
1. Variables that are declared to be CONSTANT (or references to variables that are declared to be CONSTANT) are not allowed to have the direction INOUT or OUT. 2. The time zone set in the Java variable is not important; you obtain the required time zone in the output ESQL. 3. The reference parameter cannot be NULL when passed into a Java method. 4. The reference cannot have the direction OUT when passed into a Java method. 5. If an MbElement is passed back from Java to ESQL as an INOUT parameter, it must point to a location in the same message tree as that pointed to by the MbElement that was passed into the called Java method. For example, if an ESQL reference to OutputRoot.XML.Test is passed into a Java method as an INOUT MbElement, but a different MbElement is passed back to ESQL when the call returns, the different element must also point to somewhere in the OutputRoot tree. 6. An MbElement cannot be returned from a Java method with the RETURNS clause, because no ESQL routine can return a reference. However, an MbElement can be returned as an INOUT direction parameter, subject to the conditions described in point 5. A REFERENCE to a scalar variable can be used in the CALL of a Java method, provided that the data type of the variable to which the reference refers matches the corresponding data type in the Java program signature.
Restrictions on Java routines The following restrictions apply to Java routines that are called from ESQL: v The Java method must be threadsafe (reentrant). v Database connections must be JDBC type 2 or type 4. Furthermore, database operations are not part of a broker transaction and therefore cannot be controlled by an external resource coordinator (as is the case in an XA environment). v The Java user-defined node API must be used only by the same thread that invoked the Java method. You can create threads inside your method. However, created threads must not use the Java APIs, and you must return control back to the broker. All restrictions that apply to the usage of the Java API also apply to Java methods that are called from ESQL. v Java methods that are called from ESQL must not use the MbNode class. Therefore, they cannot create objects of type MbNode, or call any of the methods on an existing MbNode object. v WebSphere MQ or JMS work done inside a Java method that is called from ESQL must be done in accordance with the guidelines for performing WebSphere MQ and JMS work in a user-defined node. See Planning user-defined input nodes.
Deploying Java classes You can deploy your Java classes to a broker within a Java Archive (JAR) file, using one of the following two methods: 1. Add the JAR file to the broker archive (BAR) file
ESQL reference
1547
The most efficient and flexible method of deploying to the broker is to add your JAR file to the BAR file. You can do this manually or automatically using the workbench. If the workbench finds the correct Java class inside a referenced Java project open in the workspace, it automatically compiles the Java class into a JAR file and adds it to the BAR file. This procedure is the same procedure that you follow to deploy a JavaCompute node inside a JAR, as described in User-defined node classloading. When you deploy a JAR file from the workbench, the flow that has been redeployed reloads the JAR file contained in the BAR file. The files are also reloaded if the message flow that references a Java class is stopped and restarted. Ensure that you stop and restart (or redeploy) all flows that reference the JAR file that you want to update. This action avoids the problem of some flows running with the old version of the JAR file and other flows running with the new version. The workbench deploys only JAR files; it does not deploy standalone Java class files. 2. Store the JAR file in either of the following locations: a. The workpath/shared-classes/ folder on the machine running the broker b. The CLASSPATH environment variable on the computer running the broker You must complete this action manually; you cannot use the workbench. In this method, redeploying the message flow does not reload the referenced Java classes; neither does stopping and restarting the message flow. The only way to reload the classes in this case is to stop and restart the broker itself. To enable the broker to find a Java class, ensure that it is in one of the preceding locations. If the broker cannot find the specified class, it generates an exception. Although you have the choices shown previously when you deploy the JAR file, using the workbench to deploy the BAR file provides the greatest flexibility when redeploying the JAR file.
Database routines Database routines are implemented as database stored procedures. Database routines have a LANGUAGE clause of DATABASE, and must have a routine type of PROCEDURE. When writing stored procedures in languages like C, you must use NULL indicators to ensure that your procedure can process the data correctly. Although the database definitions of a stored procedure vary between the databases, the ESQL used to invoke them does not. The names given to parameters in the ESQL do not have to match the names they are given on the database side. However, the external name of the routine, including any package or container specifications, must match its defined name in the database. The DYNAMIC RESULT SETS clause is allowed only for database routines. It is required only if a stored procedure returns one or more result sets. The integer parameter to this clause must be 0 (zero) or more, and specifies the number of result sets to be returned. The optional RETURNS clause is required if a stored procedure returns a single scalar value.
1548
Message Flows
The EXTERNAL NAME clause specifies the name by which the database knows the routine. This can be either a qualified or an unqualified name, where the qualifier is the name of the database schema in which the procedure is defined. If you do not provide a schema name, the database connection user name is used as the schema in which to locate the procedure. If the required procedure does not exist in this schema, you must provide an explicit schema name, either on the routine definition or on the CALL to the routine at runtime. For more information about dynamically choosing the schema that contains the routine, see the “CALL statement” on page 1515. When a qualified name is used, the name must be in quotation marks. A fully qualified routine typically takes the form: EXTERNAL NAME "mySchema.myProc";
However, if the procedure belongs to an Oracle package, the package is treated as part of the procedure’s name. Therefore you must provide a schema name and the package name, in the form: EXTERNAL NAME "mySchema.myPackage.myProc";
This form allows the schema, but not the package name, to be chosen dynamically in the CALL statement. If the name of the procedure contains SQL wildcards (which are the percent (%) character and the underscore (_) character), the procedure name is modified by the broker to include the database escape character immediately before each wildcard character. This technique ensures that the database receives the wildcards as literal characters. For example, assuming that the database escape character is a backslash, the following clause is modified by the broker so that “mySchema.Proc\_” is passed to the database. EXTERNAL NAME "mySchema.Proc_";
All external procedures have the following restrictions: v A stored procedure cannot be overloaded on the database side. A stored procedure is considered overloaded if there is more than one procedure of the same name in the same database schema. If the broker detects that a procedure has been overloaded, it raises an exception. v Parameters cannot be of the ESQL REFERENCE, ROW, LIST, or INTERVAL data types. v User-defined types cannot be used as parameters or as return values. For LANGUAGE routines, the ExternalRoutineName is optional and contains the schema name, package name and procedure name of the routine to be called. Specify the ExternalRoutineName like this: >>--"schemaName---.---packageName---,---procedureName--"--------------><
where: v schemaName is optional. v packageName is optional and applies only to Oracle data sources. If you supply a packageName you must supply a schemaName. v procedureName is optional.
ESQL reference
1549
Database routine example 1 The following example shows an ESQL definition of a stored procedure that returns a single scalar value and an OUT parameter: CREATE PROCEDURE myProc1(IN P1 INT, OUT P2 INT) LANGUAGE DATABASE RETURNS INTEGER EXTERNAL NAME "myschema.myproc";
Use this ESQL to invoke the myProc1 routine: /*using CALL statement invocation syntax*/ CALL myProc1(intVar1, intVar2) INTO intReturnVar3; /*or using function invocation syntax*/ SET intReturnVar3 = myProc1(intVar1, intVar2);
Database routine example 2 The following ESQL code demonstrates how to define and call DB2 stored procedures: ESQL Definition: DECLARE inputParm CHARACTER; DECLARE outputParm CHARACTER; DECLARE inputOutputParm CHARACTER; SET inputParm = 'Hello'; SET inputOutputParm = 'World'; CALL swapParms( inputParm, outputParm, inputOutputParm ); CREATE PROCEDURE swapParms ( IN parm1 CHARACTER, OUT parm2 CHARACTER, INOUT parm3 CHARACTER ) EXTERNAL NAME dbSwapParms;
To register this stored procedure with DB2, copy the following script to a file (for example, test1.sql) -- DB2 Example Stored Procedure DROP PROCEDURE dbSwapParms @ CREATE PROCEDURE dbSwapParms ( IN in_param CHAR(32), OUT out_param CHAR(32), INOUT inout_param CHAR(32)) LANGUAGE SQL BEGIN SET out_param = inout_param; SET inout_param = in_param; END @
Now run it from the DB2 command prompt: db2 -td@ -vf test1.sql
Expect the following results from running this code: v The value of the IN parameter does not (and cannot, by definition) change. v The value of the OUT parameter becomes “World”. v The value of the INOUT parameter changes to “Hello”.
1550
Message Flows
Database routine example 3 The following ESQL code demonstrates how to define and call Oracle stored procedures: ESQL Definition: DECLARE inputParm CHARACTER; DECLARE outputParm CHARACTER; DECLARE inputOutputParm CHARACTER; SET inputParm = 'Hello'; SET inputOutputParm = 'World'; CALL swapParms( inputParm, outputParm, inputOutputParm ); CREATE PROCEDURE swapParms ( IN parm1 CHARACTER, OUT parm2 CHARACTER, INOUT parm3 CHARACTER ) EXTERNAL NAME dbSwapParms;
To register this stored procedure with Oracle, copy the following script to a file (for example, test1.sql) CREATE OR REPLACE PROCEDURE dbSwapParms ( in_param IN VARCHAR2, out_param OUT VARCHAR2, inout_param IN OUT VARCHAR2 ) AS BEGIN out_param := inout_param; inout_param := in_param; END; /
Now run it: sqlplus userID/password
@test1.sql
Expect the following results from running this code: v The value of the IN parameter does not (and cannot, by definition) change. v The value of the OUT parameter becomes “World”. v The value of the INOUT parameter changes to “Hello”.
Database routine example 4 The following ESQL code demonstrates how to define and call SQL Server stored procedures: ESQL Definition: DECLARE inputParm CHARACTER; DECLARE outputParm CHARACTER; DECLARE inputOutputParm CHARACTER; SET inputParm = 'Hello'; SET inputOutputParm = 'World'; CALL swapParms( inputParm, outputParm, inputOutputParm ); CREATE PROCEDURE swapParms ( IN parm1 CHARACTER, INOUT parm2 CHARACTER, INOUT parm3 CHARACTER ) EXTERNAL NAME dbSwapParms;
To register this stored procedure with SQL Server, copy the following script to a file (for example, test1.sql) ESQL reference
1551
-- SQLServer Example Stored Procedure DROP PROCEDURE dbSwapParms go CREATE PROCEDURE dbSwapParms @in_param CHAR(32), @out_param CHAR(32) OUT, @inout_param CHAR(32) OUT AS SET NOCOUNT ON SET @out_param = @inout_param SET @inout_param = @in_param go
Now run it: isql -UuserID -Ppassword -Sserver -ddatasource -itest1.sql
SQL Server considers OUTPUT parameters from stored procedures as INPUT/OUTPUT parameters. If you declare these as OUT parameters in your ESQL you encounter a type mismatch error at run time. To avoid that mismatch you must declare SQL Server OUTPUT parameters as INOUT in your ESQL. Use the SET NOCOUNT ON option, as shown in the preceding example, with SQL stored procedures for the following reasons: 1. To limit the amount of data returned from SQL Server to the broker. 2. To allow result sets to be returned correctly. Expect the following results from running this code: v The value of the IN parameter does not (and cannot, by definition) change. v The value of the OUT parameter becomes “World”. v The value of the INOUT parameter changes to “Hello”.
Database routine example 5 The following ESQL code demonstrates how to define and call Sybase stored procedures: ESQL Definition: DECLARE inputParm CHARACTER; DECLARE outputParm CHARACTER; DECLARE inputOutputParm CHARACTER; SET inputParm = 'Hello'; SET inputOutputParm = 'World'; CALL swapParms( inputParm, outputParm, inputOutputParm ); CREATE PROCEDURE swapParms ( IN parm1 CHARACTER, INOUT parm2 CHARACTER, INOUT parm3 CHARACTER ) EXTERNAL NAME dbSwapParms;
To register this stored procedure with Sybase, copy the following script to a file (for example, test1.sql) -- SYBASE Example Stored Procedure DROP PROCEDURE dbSwapParms go CREATE PROCEDURE dbSwapParms @in_param CHAR(32), @out_param CHAR(32) OUT, @inout_param CHAR(32) OUT
1552
Message Flows
AS SET @out_param = @inout_param SET @inout_param = @in_param go
Now run it: isql -U<userID> -P<password> -S<server> -D -itest1.sql
Sybase considers OUTPUT parameters from stored procedures as INPUT/OUTPUT parameters. If you declare these as OUT parameters in your ESQL, you encounter a type mismatch error at run time. To avoid that mismatch, declare Sybase OUTPUT parameters as INOUT in your ESQL. Expect the following results from running this code: v The value of the IN parameter does not (and cannot, by definition) change. v The value of the OUT parameter becomes “World”. v The value of the INOUT parameter changes to “Hello”.
Database routine example 6 This example shows how to call a stored procedure that returns two result sets, in addition to an out parameter: CREATE PROCEDURE myProc1 (IN P1 INT, OUT P2 INT) LANGUAGE DATABASE DYNAMIC RESULT SETS 2 EXTERNAL NAME "myschema.myproc";
Use the following ESQL to invoke myProc1: /* using a field reference */ CALL myProc1(intVar1, intVar2, Environment.RetVal[], OutputRoot.XMLNS.A[]) /* using a reference variable*/ CALL myProc1(intVar1, intVar2, myReferenceVariable.RetVal[], myRef2.B[])
DECLARE statement The DECLARE statement defines a variable, the data type of the variable and, optionally, its initial value. The three types of variable that you can define with the DECLARE statement are: v External v Normal v Shared See “ESQL variables” on page 1493 for further information.
ESQL reference
1553
Syntax
<<-,-<< DECLARE
-Name
SHARED (1) (2) EXTERNAL (3) (4)
DataType (5)
CONSTANT NAMESPACE (6) NAME
InitialValueExpression
Notes: 1. The SHARED keyword is not valid within a function or procedure. 2. You cannot specify SHARED with a DataType of REFERENCE TO. To store a message tree in a shared variable, use the ROW data type. 3. EXTERNAL variables are implicitly constant. 4. It is good programming practice to give an EXTERNAL variable an initial value. 5. If you specify a DataType of REFERENCE TO, you must specify an initial value (of either a variable or a tree) in InitialValueExpression. 6. When you use the NAMESPACE and NAME clauses, their values are implicitly constant and of type CHARACTER.
CONSTANT Use CONSTANT to define a constant. You can declare constants within schemas, modules, routines, or compound statements (both implicit and explicit). The behavior of these cases is shown in the following list: v Within a compound statement, constants and variables occupy the same namespace. v Within expressions, a constant or variable that is declared within a compound statement overlays all constants and variables of the same name that are declared in containing compound statements, modules and schemas. v Within field reference namespace fields, a namespace constant that is declared within a compound statement overlays all namespace constants of the same name that are declared in containing compound statements. A constant or variable that is declared within a routine overlays any parameters of the same name, as well as all constants and variables of the same name that are declared in a containing module or schema.
DataType The possible values that you can specify for DataType are: v BOOL v BOOLEAN v INT
1554
Message Flows
v v v v v v v v v v v v v v v v v
INTEGER FLOAT DEC DECIMAL DATE TIME TIMESTAMP GMTTIME GMTTIMESTAMP INTERVAL. This does not apply to external variables (EXTERNAL keyword specified). CHAR CHARACTER BLOB BIT ROW. This does not apply to external variables (EXTERNAL keyword specified). REF. This does not apply to external or shared variables (EXTERNAL or SHARED keyword specified). REFERENCE TO. This does not apply to external or shared variables (EXTERNAL or SHARED keyword specified).
EXTERNAL Use EXTERNAL to denote a user-defined property (UDP). A UDP is a user-defined constant whose initial value (optionally set by the DECLARE statement) can be modified, at design time, by the Message Flow editor (see Message Flow editor) or overridden, at deployment time, by the Broker Archive editor (see Broker Archive editor). The value of a UDP cannot be modified by ESQL. When a UDP is given an initial value on the DECLARE statement, this becomes its default. However, any value that you specify in the Message Flow editor at design time, or in the BAR editor at deployment time (even a zero length string) overrides any initial value that was coded on the DECLARE statement. For example, if you code: DECLARE deployEnvironment EXTERNAL CHARACTER 'Dev';
you have defined a UDP variable of deployEnvironment with an initial value Dev. Add the UDP to the message flow by using the UDP tab in the message flow editor. When you add the flow to the BAR file, the UDP is there as an attribute of the flow; you must name the attribute to be the same as the ESQL variable in the DECLARE statement (in this case, deployEnvironment) to ensure that the initial value that you set is unchanged. All UDPs in a message flow must have a value, given either on the DECLARE statement or by the Message Flow or BAR editor; otherwise a deployment-time error occurs. At run time, after the UDP has been declared, its value can be queried by subsequent ESQL statements.
| |
The advantage of UDPs is that their values can be changed at deployment time. If, for example, you use the UDPs to hold configuration data, it means that you can configure a message flow for a particular computer, task, or environment at deployment time, without having to change the code at the node level. UDPs can also be modified at run time using the Configuration Manager Proxy (CMP) API.
ESQL reference
1555
You can declare UDPs only in modules or schemas; that is, you can use the DECLARE statement with the EXTERNAL keyword only at the MODULE or SCHEMA level. If you use a DECLARE statement with the EXTERNAL keyword within a PROCEDURE or FUNCTION, a BIP2402E exception occurs when you deploy the message flow. The following types of broker node can access UDPs: v Compute node v Database node v Filter node v Nodes that are derived from these node types Take care when specifying the data type of a UDP, because a CAST is used to change the value to the requested DataType. For an overview of UDPs, see “User-defined properties in ESQL” on page 286.
Example 1 DECLARE mycolour EXTERNAL CHARACTER 'blue';
Example 2 DECLARE TODAYSCOLOR EXTERNAL CHARACTER; SET COLOR = TODAYSCOLOR;
where TODAYSCOLOR is a user-defined property that has a TYPE of CHARACTER and a VALUE set by the Message Flow Editor.
NAME Use NAME to define an alias (an alternative name) by which a variable can be known.
Example 1 -- The following statement gives Schema1 an alias of 'Joe'. DECLARE Schema1 NAME 'Joe'; -- The following statement produces a field called 'Joe'. SET OutputRoot.XMLNS.Data.Schema1 = 42; -- The following statement inserts a value into a table called Table1 -- in the schema called 'Joe'. INSERT INTO Database.Schema1.Table1 (Answer) VALUES 42;
Example 2 DECLARE Schema1 EXTERNAL NAME; CREATE FIRSTCHILD OF OutputRoot.XMLNS.TestCase.Schema1 Domain('XMLNS') NAME 'Node1' VALUE '1'; -- If Schema1 has been given the value 'red', the result would be: <xml version="1.0"?> 1
1556
Message Flows
NAMESPACE Use NAMESPACE to define an alias (an alternative name) by which a namespace can be known.
Example This example illustrates a namespace declaration, its use as a SpaceId in a path, and its use as a character constant in a namespace expression: DECLARE prefixOne NAMESPACE 'http://www.example.com/PO1'; -- On the right hand side of the assignment a namespace constant -- is being used as such while, on the left hand side, one is -- being used as an ordinary constant (that is, in an expression). SET OutputRoot.XMLNS.{prefixOne}:{'PurchaseOrder'} = InputRoot.XMLNS.prefixOne:PurchaseOrder;
SHARED Use SHARED to define a shared variable. Shared variables are private to the flow (if declared within a schema) or node (if declared within a module), but are shared between instances of the flow (threads). No type of variable is visible beyond the flow level; for example, you cannot share variables across execution groups. You can use shared variables to implement an in-memory cache in the message flow; see “Optimizing message flow response times” on page 180. Shared variables have a long lifetime and are visible to multiple messages passing through a flow; see “Long-lived variables” on page 287. Shared variables exist for the lifetime of the: v Execution group process v Flow or node, or v Node’s SQL that declares the variable (whichever is the shortest). They are initialized when the first message passes through the flow or node after each broker startup. You cannot define a shared variable within a function or procedure. The advantages of shared variables, relative to databases, are that: v Write access is very much faster. v Read access to small data structures is faster. v Access is direct; that is, there is no need to use a special function (SELECT) to get data, or special statements (INSERT, UPDATE, or DELETE) to modify data. You can refer to the data directly in expressions. The advantages of databases, relative to shared variables, are that: v The data is persistent. v The data is changed transactionally. These read-write variables are ideal for users who are prepared to sacrifice the persistence and transactional advantages of databases in order to obtain better performance, because they have a longer life than only one message and perform better than a database. ESQL reference
1557
Because shared variables can be updated by multiple additional instances, you must ensure that you do not make changes to shared variables that might cause unexpected results, for example, if the variable is being used as a counter.
| | |
You can prevent other instances seeing the intermediate stages of the data by using a BEGIN ATOMIC construct, see “BEGIN ... END statement” on page 1510. Your user program can make an efficient read, or write, copy of an input node’s message using shared-row variables. This is generally useful and, in particular, simplifies the technique for handling large messages. Restriction: There is a restriction that subtrees cannot be copied directly from one shared row variable to another shared row variable. Subtrees can be copied indirectly by using a non-shared row variable. Scalar values extracted from one shared row variable (using the FIELDVALUE function) can be copied to another shared row variable. The following sample shows how to use both shared and external variables: v Message Routing sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit.
DECLARE HANDLER statement The DECLARE HANDLER statement creates an error handler for handling exceptions.
Syntax
DECLARE
CONTINUE EXIT
HANDLER FOR
State
Stmt
State: <<-- , --<<
SQLSTATE
’ Text ’ VALUE LIKE ’ Text ’ ESCAPE
’ Text ’
You can declare handlers in both explicitly declared (BEGIN...END) scopes and implicitly declared scopes (for example, the ELSE clause of an IF statement). However, all handler declarations must be together at the top of the scope, before any other statements. If there are no exceptions, the presence of handlers has no effect on the behavior or performance of an SQL program. If an exception occurs, WebSphere Message Broker compares the SQL state of the exception with the SQL states associated with any relevant handlers, until either the exception leaves the node (just as it would if
1558
Message Flows
there were no handlers) or a matching handler is found. Within any one scope, handlers are searched in the order they are declared; that is, first to last. Scopes are searched from the innermost to outermost. The SQL state values provided in DECLARE... HANDLER... statements can be compared directly with the SQL state of the exception or can be compared using wild card characters. To compare the state values directly, specify either VALUE or no condition operator. To make a wild card comparison, use the underscore and percent characters to represent single and multiple character wild cards, respectively, and specify the LIKE operator. The wild card method allows all exceptions of a general type to be handled without having to list them exhaustively. If a matching handler is found, the SQLSTATE and other special registers are updated (according to the rules described below) and the handler’s statement is processed. As the handler’s statement must be a single statement, it is typically a compound statement (such as BEGIN...END) that contains multiple other statements. There is no special behavior associated with these inner statements and there are no special restrictions. They can, for example, include RETURN, ITERATE, or LEAVE; these affect their containing routines and looping constructs in the same way as if they were contained in the scope itself. Handlers can contain handlers for exceptions occurring within the handler itself If processing of the handler’s code completes without throwing further unhandled exceptions, execution of the normal code is resumed as follows: v For EXIT handlers, the next statement processed is the first statement after the handler’s scope. v For CONTINUE handlers, it is the first directly-contained statement after the one that produced the exception. Each handler has its own SQLCODE, SQLSTATE, SQLNATIVEERROR, and SQLERRORTEXT special registers. These come into scope and their values are set just before the handler’s first statement is executed. They remain valid until the handler’s last statement has been executed. Because there is no carry over of SQLSTATE values from one handler to another, handlers can be written independently. Handlers absorb exceptions, preventing their reaching the input node and thus causing the transaction to be committed rather than rolled back. A handler can use a RESIGNAL or THROW statement to prevent this.
Example -- Drop the tables so that they can be recreated with the latest definition. -- If the program has never been run before, errors will occur because you -- can't drop tables that don't exist. We ignore these. BEGIN DECLARE CONTINUE HANDLER FOR SQLSTATE LIKE'%' BEGIN END; PASSTHRU PASSTHRU PASSTHRU PASSTHRU END;
'DROP 'DROP 'DROP 'DROP
TABLE TABLE TABLE TABLE
Shop.Customers' Shop.Invoices' Shop.Sales' Shop.Parts'
TO TO TO TO
Database.DSN1; Database.DSN1; Database.DSN1; Database.DSN1;
ESQL reference
1559
DELETE FROM statement The DELETE FROM statement deletes rows from a table in an external database, based on a search condition.
Syntax
DELETE FROM
TableReference
AS
CorrelationName
WHERE Expression
WHERE: TableReference =
Database
. . .
TableClause
SchemaClause
DataSourceClause
DataSourceClause =
SchemaClause =
TableClause =
DataSourceName { DataSourceExpression
SchemaName { SchemaExpression
TableName { TableExpression
}
}
}
All rows for which the WHERE clause expression evaluates to TRUE are deleted from the table identified by TableReference. Each row is examined in turn and a variable is set to point to the current row. Typically, the WHERE clause expression uses this variable to access column values and thus cause rows to be retained or deleted according to their contents. The variable is referred to by CorrelationName or, in the absence of an AS clause, by TableName.
Table reference A table reference is a special case of the field references that are used to refer to message trees. It always starts with the word “Database” and may contain any of the following: v A table name only v A schema name and a table name v A data source name (that is, the name of a database instance), a schema name, and a table name
1560
Message Flows
In each case, the name may be specified directly or by an expression enclosed in braces ({...}). A directly-specified data source, schema, or table name is subject to name substitution. That is, if the name used has been declared to be a known name, the value of the declared name is used rather than the name itself (see “DECLARE statement” on page 1553). If a schema name is not specified, the default schema for the broker’s database user is used. If a data source name is not specified, the database pointed to by the node’s data source attribute is used.
The WHERE clause The WHERE clause expression can use any of the broker’s operators and functions in any combination. It can refer to table columns, message fields, and any declared variables or constants. However, be aware that the broker treats the WHERE clause expression by examining the expression and deciding whether the whole expression can be evaluated by the database. If it can, it is given to the database. In order to be evaluated by the database, it must use only those functions and operators supported by the database. The WHERE clause can, however, refer to message fields, correlation names declared by containing SELECT functions, and to any other declared variables or constants within scope. If the whole expression cannot be evaluated by the database, the broker looks for top-level AND operators and examines each sub-expression separately. It then attempts to give the database those sub-expressions that it can evaluate, leaving the broker to evaluate the rest. You need to be aware of this situation for two reasons: 1. Apparently trivial changes to WHERE clause expressions can have large effects on performance. You can determine how much of the expression was given to the database by examining a user trace. 2. Some databases’ functions exhibit subtle differences of behavior from those of the broker.
Handling errors It is possible for errors to occur during delete operations. For example, the database may not be operational. In these cases, an exception is thrown (unless the node has its throw exception on database error property set to FALSE). These exceptions set appropriate SQL code, state, native error, and error text values and can be dealt with by error handlers (see the DECLARE HANDLER statement). For further information about handling database errors, see “Capturing database state” on page 365.
Examples The following example assumes that the dataSource property has been configured and that the database it identifies has a table called SHAREHOLDINGS, with a column called ACCOUNTNO. ESQL reference
1561
DELETE FROM Database.SHAREHOLDINGS AS S WHERE S.ACCOUNTNO = InputBody.AccountNumber;
This removes all the rows from the SHAREHOLDINGS table where the value in the ACCOUNTNO column (in the table) is equal to that in the AccountNumber field in the message. This may delete zero, one, or more rows from the table. The next example shows the use of calculated data source, schema, and table names: -- Declare variables to hold the data source, schema, and table names and -- set their default values DECLARE Source CHARACTER 'Production'; DECLARE Schema CHARACTER 'db2admin'; DECLARE Table CHARACTER 'DynamicTable1'; -- Code which calculates their actual values comes here -- Delete rows from the table DELETE FROM Database.{Source}.{Schema}.{Table} As R WHERE R.Name = 'Joe';
DELETE statement The DELETE statement detaches and destroys a portion of a message tree, allowing its memory to be reused. This statement is particularly useful when handling very large messages.
Syntax
DELETE
FIELD FIRSTCHILD LASTCHILD PREVIOUSSIBLING NEXTSIBLING
FieldReference
OF
If the target field does not exist, the statement does nothing and normal processing continues. If any reference variables point into the deleted portion, they are disconnected from the tree so that no action involving them has any effect, and the LASTMOVE function returns FALSE. Disconnected reference variables can be reconnected by using a MOVE... TO... statement.
Example DELETE FIELD OutputRoot.XMLNS.Data.Folder1.Folder12; DELETE LASTCHILD OF Cursor;
DETACH statement The DETACH statement detaches a portion of a message tree without deleting it. This portion can be reattached using the ATTACH statement.
1562
Message Flows
Syntax
DETACH dynamic_reference
For information about dynamic references, see “Creating dynamic field references” on page 316. For an example of DETACH, see the example in “ATTACH statement” on page 1508.
EVAL statement The EVAL statement takes a character value, interprets it as an SQL statement, and processes it. The EVAL function (also described here) takes a character value, but interprets it as an ESQL expression that returns a value. Note: User defined functions and procedures cannot be defined within an EVAL statement or EVAL function.
Syntax
EVAL ( SQL_character_value )
EVAL takes one parameter in the form of an expression, evaluates this expression, and casts the resulting value to a character string if it is not one already. The expression that is passed to EVAL must therefore be able to be represented as a character string. After this first stage evaluation is complete, the behavior of EVAL depends on whether it is being used as a complete ESQL statement, or in place of an expression that forms part of an ESQL statement: v If it is a complete ESQL statement, the character string derived from the first stage evaluation is executed as if it were an ESQL statement. v If it is an expression that forms part of an ESQL statement, the character string is evaluated as if it were an ESQL expression and EVAL returns the result. In the following examples, A and B are integer scalar variables, and scalarVar1 and OperatorAsString are character string scalar variables. The following examples are valid uses of EVAL: v SET OutputRoot.XMLNS.Data.Result = EVAL(A+B); The expression A+B is acceptable because, although it returns an integer value, integer values are representable as character strings, and the necessary cast is performed before EVAL continues with its second stage of evaluation.
ESQL reference
1563
v SET OutputRoot.XMLNS.Data.Result = EVAL('A' || operatorAsString || 'B'); v EVAL('SET ' || scalarVar1 || ' = 2;'); The semicolon included at the end of the final string literal is necessary, because if EVAL is being used in place of an ESQL statement, its first stage evaluation must return a string that represents a valid ESQL statement, including the terminating semicolon. Variables declared within an EVAL statement do not exist outside that EVAL statement. In this way EVAL is similar to a function, in which locally-declared variables are local only, and go out of scope when the function is exited. The real power of EVAL is that it allows you to dynamically construct ESQL statements or expressions. In the second and third examples above, the value of scalarVar1 or operatorAsString can be set according to the value of an incoming message field, or other dynamic value, allowing you to effectively control what ESQL is executed without requiring a potentially lengthy IF THEN ladder. However, consider the performance implications in using EVAL. Dynamic construction and execution of statements or expressions is necessarily more time-consuming than simply executing pre-constructed ones. If performance is vital, you might prefer to write more specific, but faster, ESQL. The following are not valid uses of EVAL: v SET EVAL(scalarVar1) = 2; In this example, EVAL is being used to replace a field reference, not an expression. v SET OutputRoot.XMLNS.Data.Result[] = EVAL((SELECT T.x FROM Database.y AS T)); In this example, the (SELECT T.x FROM Database.y) passed to EVAL returns a list, which is not representable as a character string. The following example is acceptable because (SELECT T.x FROM Database.y AS T) is a character string literal, not an expression in itself, and therefore is representable as a character string. SET OutputRoot.XMLNS.Data.Result[] = EVAL('(SELECT T.x FROM Database.y AS T)');
FOR statement The FOR statement iterates through a list (for example, a message array).
Syntax
FOR correlation_name AS field_reference DO statements END FOR
For each iteration, the FOR statement makes the correlation variable (correlation_name in the syntax diagram) equal to the current member of the list (field_reference) and then executes the block of statements. The advantage of the
1564
Message Flows
FOR statement is that it iterates through a list without your having to write any sort of loop construct (and eliminates the possibility of infinite loops). For example the following ESQL: SET OutputRoot.MQMD=InputRoot.MQMD; SET SET SET SET
Environment.SourceData.Folder[1].Field1 Environment.SourceData.Folder[1].Field2 Environment.SourceData.Folder[2].Field1 Environment.SourceData.Folder[2].Field2
= = = =
'Field11Value'; 'Field12Value'; 'Field21Value'; 'Field22Value';
DECLARE i INTEGER 1; FOR source AS Environment.SourceData.Folder[] DO CREATE LASTCHILD OF OutputRoot.XMLNSC.Data.ResultData.MessageArrayTest.Folder[i] NAME 'FieldA' VALUE '\' || source.Field1 || '\' || CAST(i AS CHAR); CREATE LASTCHILD OF OutputRoot.XMLNSC.Data.ResultData.MessageArrayTest.Folder[i] NAME 'FieldB' VALUE '\' || source.Field2 || '\' || CAST(i AS CHAR); SET i = i + 1; END FOR;
generates the output message: <MessageArrayTest> Field11Value\1 Field12Value\1 Field21Value\2 Field22Value\2
IF statement The IF statement executes one set of statements based on the result of evaluating condition expressions.
Syntax
ELSEIF IF expression THEN
statements
END IF ELSE
statements
Each expression is evaluated in turn until one results in TRUE; the corresponding set of statements is then executed. If none of the expressions returns TRUE, and the optional ELSE clause is present, the ELSE clause’s statements are executed.
ESQL reference
1565
UNKNOWN and FALSE are treated the same: the next condition expression is evaluated. ELSEIF is one word with no space between the ELSE and the IF. However, you can nest an IF statement within an ELSE clause: if you do, you can terminate both statements with END IF.
Example IF i = 0 THEN SET size = 'small'; ELSEIF i = 1 THEN SET size = 'medium'; ELSEIF j = 4 THEN SET size = 'large'; ELSE SET size = 'unknown'; END IF; IF J> MAX THEN SET J = MAX; SET Limit = TRUE; END IF;
INSERT statement The INSERT statement inserts a row into a database table.
1566
Message Flows
Syntax
INSERT INTO
TableReference
, ( ColumnName
)
, VALUES (
Expression
)
Database
WHERE: TableReference =
. . .
TableClause
SchemaClause
DataSourceClause
DataSourceClause =
SchemaClause =
TableClause =
DataSourceName { DataSourceExpression
SchemaName { SchemaExpression
TableName { TableExpression
}
}
}
A single row is inserted into the table identified by TableReference. The ColumnName list identifies those columns in the target table that are to be given specific values. These values are determined by the expressions within the VALUES clause (the first expression gives the value of the first named column, and so on). The number of expressions in the VALUES clause must be the same as the number of named columns. Any columns present in the table but not mentioned in the list are given their default values.
Table reference A table reference is a special case of the field references that are used to refer to message trees. It always starts with the word “Database” and may contain any of the following: v A table name only v A schema name and a table name v A data source name (that is, the name of a database instance), a schema name, and a table name In each case, the name may be specified directly or by an expression enclosed in braces ({...}). A directly-specified data source, schema, or table name is subject to ESQL reference
1567
name substitution. That is, if the name used has been declared to be a known name, the value of the declared name is used rather than the name itself (see “DECLARE statement” on page 1553). If a schema name is not specified, the default schema for the broker’s database user is used. If a data source name is not specified, the database pointed to by the node’s data source attribute is used.
Handling errors It is possible for errors to occur during insert operations. For example, the database may not be operational, or the table may have constraints defined that the new row would violate. In these cases, an exception is thrown (unless the node has its throw exception on database error property set to FALSE). These exceptions set appropriate values for: v SQL code v state v native error v error text and can be dealt with by error handlers (see the DECLARE HANDLER statement). For further information about handling database errors, see “Capturing database state” on page 365.
Examples The following example assumes that the data source property of the Database node has been configured, and that the database it identifies has a table called TABLE1 with columns A, B, and C. Given a message with the following generic XML body: 1 2 3
The following INSERT statement inserts a new row into the table with the values 1, 2, and 3 for the columns A, B, and C: INSERT INTO Database.TABLE1(A, B, C) VALUES (Body.A.B, Body.A.C, Body.A.D);
The next example shows the use of calculated data source, schema, and table names: -- Declare variables to hold the data source, schema, and table names -- and set their default values DECLARE Source CHARACTER 'Production'; DECLARE Schema CHARACTER 'db2admin'; DECLARE Table CHARACTER 'DynamicTable1'; -- Code which calculates their actual values comes here -- Insert the data into the table INSERT INTO Database.{Source}.{Schema}.{Table} (Name, Value) values ('Joe', 12.34);
1568
Message Flows
Inserting a bitstream into a database If the database column into which you want to insert data is set to a binary data type such as BLOB, the input message must be represented in bitstream form. If the input message is in the BLOB domain, use the following ESQL code: DECLARE msgBitStream BLOB InputRoot.BLOB.BLOB; INSERT INTO Database.TABLE1(MSGDATA) VALUES (msgBitStream);
Alternatively, if the input message is in an XML domain such as XMLNS, then the message tree must be serialized before the INSERT statement. To serialize the message tree and insert the contents into the database, use the following ESQL code: DECLARE propRef REFERENCE TO InputRoot.Properties; DECLARE msgBitStream BLOB ASBITSTREAM(InputRoot.XMLNS, propRef.Encoding, propRef.CodedCharSetId); INSERT INTO Database.TABLE1(MSGDATA) VALUES (msgBitStream);
If the input messages received by your message flow come from different code pages, the CodedCharSetID and Encoding information is lost if you use the previous example. To capture CodedCharSetID and Encoding information, you can extend the table with two numeric columns to store the CodedCharSetID and Encoding data. To do this modify the ESQL from the previous example to insert the CodedCharSetID and Encoding data into separate database columns: DECLARE propRef REFERENCE TO InputRoot.Properties; DECLARE inCCSID INT propRef.CodedCharSetId; DECLARE inEncoding INT propRef.Encoding; DECLARE msgBitStream BLOB ASBITSTREAM(InputRoot.XMLNS, inEncoding, inCCSID); INSERT INTO Database.TABLE1(MSGDATA, MSGENCODING, MSGCCSID) VALUES (msgBitStream, inEncoding, inCCSID);
As an extension to the above example, if you require the entire message to be stored along with its MQMD header, and use it later for reconstructing the entire message in another message flow on a different platform using a different codepage and encoding, the database table can be extended to hold all the numeric fields of MQMD header. For example, a message flow running on AIX inserts a message bitstream into the database table and another message flow running on Windows retrieves it and attempts to reconstruct the message along with the stored MQMD header. The set of numeric fields in the MQMD header is listed below: BackoutCount (MQLONG) CodedCharSetId (MQLONG) Encoding (MQLONG) Expiry (MQLONG) Feedback (MQLONG) MsgFlags (MQLONG) MsgSeqNumber (MQLONG) MsgType (MQLONG) Offset (MQLONG) OriginalLength (MQLONG) Persistence (MQLONG) Priority (MQLONG) PutApplType (MQLONG) Report (MQLONG) Version (MQLONG)
The following example uses CodedCharSetID, Encoding, Priority, and MsgSeqNumber:.
ESQL reference
1569
DECLARE DECLARE DECLARE DECLARE
propRef REFERENCE TO InputRoot.Properties; mqmdRef REFERENCE TO InputRoot.MQMD; inCCSID INT propRef.CodedCharSetId; inEncoding INT propRef.Encoding;
DECLARE inPriority INT mqmdRef.Priority; DECLARE inMsgSeqNumber INT mqmdRef.MsgSeqNumber; DECLARE msgBitStream BLOB ASBITSTREAM(InputRoot, inEncoding, inCCSID); INSERT INTO Database.TABLE1(MSGDATA, MSGENCODING, MSGCCSID, MSGPRIORITY,MSGSEQNUMBER) VALUES (msgBitStream, inEncoding, inCCSID, inPriority, inMsgSeqNumber);
If you want to insert an XML message into a database column that has a CHAR or VARCHAR data type, the ESQL must be modified to convert the input message to the CHAR data type before the INSERT statement. In the following example a CAST is used to transform the serialized message to the CHAR data type. The CodedCharSetID and Encoding data are inserted into separate database columns. DECLARE propRef REFERENCE TO InputRoot.Properties; DECLARE inCCSID INT propRef.CodedCharSetId; DECLARE inEncoding INT propRef.Encoding; DECLARE msgBitStream BLOB ASBITSTREAM(InputRoot.XMLNS, inEncoding, inCCSID); DECLARE msgChar CHAR CAST(msgBitStream AS CHAR CCSID inCCSID); INSERT INTO Database.TABLE1(MSGDATA, MSGENCODING, MSGCCSID) VALUES (msgChar, inEncoding, inCCSID);
For examples of how to extract a message bitstream from a database, based on the two previous examples, see “Selecting bitstream data from a database” on page 353.
ITERATE statement The ITERATE statement stops the current iteration of the containing WHILE, REPEAT, LOOP, or BEGIN statement identified by Label. The containing statement evaluates its loop condition (if any), and either starts the next iteration or stops looping, as the condition dictates.
Syntax
ITERATE Label
Example In the following example, the loop iterates four times; that is the line identified by the comment Some statements 1 is passed through four times. However, the line identified by the comment Some statements 2 is passed through twice only because of the action of the IF and ITERATE statements. The ITERATE statement does not bypass testing the loop condition. Take particular care that the action of the ITERATE does not bypass the logic that makes the loop advance and eventually terminate. The loop count is incremented at the start of the loop in this example: DECLARE i INTEGER; SET i = 0; X : REPEAT SET i = i + 1;
1570
Message Flows
-- Some statements 1 IF i IN(2, 3) THEN ITERATE X; END IF; -- Some statements 2 UNTIL i>= 4 END REPEAT X;
ITERATE statements do not have to be directly contained by their labelled statement, making ITERATE statements particularly powerful.
LEAVE statement The LEAVE statement stops the current iteration of the containing WHILE, REPEAT, LOOP, or BEGIN statement identified by Label. The containing statement’s evaluation of its loop condition (if any) is bypassed and looping stops.
Syntax
LEAVE Label
Examples In the following example, the loop iterates four times: DECLARE i INTEGER; SET i = 1; X : REPEAT ... IF i>= 4 THEN LEAVE X; END IF; SET i = i + 1; UNTIL FALSE END REPEAT;
LEAVE statements do not have to be directly contained by their labelled statement, making LEAVE statements particularly powerful. DECLARE i INTEGER; SET i = 0; X : REPEAT -- Outer loop ... DECLARE j INTEGER; SET j = 0; REPEAT -- Inner loop ... IF i>= 2 AND j = 1 THEN LEAVE X; -- Outer loop left from within inner loop END IF; ... ESQL reference
1571
SET j = j + 1; UNTIL j>= 3 END REPEAT; SET i = i + 1; UNTIL i>= 3 END REPEAT X; -- Execution resumes here after the leave
LOG statement Use the LOG statement to write a record to the event log or to the user trace.
Syntax
LOG
EVENT USER TRACE
EXCEPTION
Options
,
FULL VALUES (
Expression
)
WHERE: Options = SEVERITY Expression
CATALOG Expression
MESSAGE Expression
CATALOG CATALOG is an optional clause; if you omit it, CATALOG defaults to the WebSphere Message Broker current version catalog. To use the current version message catalog explicitly, use BIPv610 on all operating systems. EVENT A record is written to the event log, and also to the user trace, if user tracing is enabled. EXCEPTION The current exception, if any, is logged. For more information on exceptions, see Errors and exception handling. FULL The complete nested exception report is logged, just as if the exception had reached the input node. If FULL is not specified, any wrapping exceptions are ignored, and only the original exception is logged. Therefore, you can have either a full report or simply the actual error report without the extra information regarding what was going on at the time. A current exception only exists within handler blocks (see “Handling errors in message flows” on page 227). MESSAGE The number of the message to be used. If specified, the MESSAGE clause can contain any expression that returns a non-NULL, integer, value. If you omit MESSAGE, its value defaults to the first message number (2951) in a block of messages that is provided for use by the LOG and THROW statements in the WebSphere Message Broker catalog. If you specify a message number, you can use message numbers 2951 through 2999. Alternatively, you can generate your own catalog.
1572
Message Flows
SEVERITY The severity associated with the message. If specified, the SEVERITY clause can contain any expression that returns a non-NULL, integer, value. If you omit the clause, its value defaults to 1. USER TRACE A record is written to the user trace, whether user trace is enabled or not. VALUES Use the optional VALUES clause to provide values for the data inserts in your message. You can insert any number of pieces of information, but the messages supplied (2951 - 2999) cater for a maximum of ten data inserts. Note the general similarity of the LOG statement to the THROW statement. -- Write a message to the event log specifying the severity, catalog and message -- number. Four inserts are provided LOG EVENT SEVERITY 1 CATALOG 'BIPv610' MESSAGE 2951 VALUES(1,2,3,4); -- Write to BEGIN DECLARE a DECLARE b DECLARE r
the trace log whenever a divide by zero occurs INT 42; INT 0; INT;
BEGIN DECLARE EXIT HANDLER FOR SQLSTATE LIKE 'S22012' BEGIN LOG USER TRACE EXCEPTION VALUES(SQLSTATE, 'DivideByZero'); SET r = 0x7FFFFFFFFFFFFFFFF; END; SET r = a / b; END; SET OutputRoot.XMLNS.Data.Result = r; END;
LOOP statement The LOOP statement executes the sequence of statements repeatedly and unconditionally. Ensure that the logic of the program provides some means of terminating the loop. You can use either LEAVE or RETURN statements.
Syntax
LOOP statements END LOOP Label : LOOP statements END
LOOP
Label
If present, Label gives the statement a name. This has no effect on the behavior of the LOOP statement, but allows statements to include ITERATE and LEAVE statements or other labelled statements, which in turn include ITERATE and LEAVE. The second Label can be present only if the first Label is present and, if it is, the labels must be identical.
ESQL reference
1573
Two or more labelled statements at the same level can have the same Label but this partly negates the advantage of the second Label. The advantage is that it unambiguously and accurately matches each END with its LOOP. However, a labelled statement within statements cannot have the same label, because this makes the behavior of the ITERATE and LEAVE statements ambiguous. The LOOP statement is useful in cases where the required logic dictates that a loop is always exited part way through. This is because, in these cases, the testing of a loop condition that occurs in REPEAT or WHILE statements is both unnecessary and wasteful.
Example DECLARE i INTEGER; SET i = 1; X : LOOP ... IF i>= 4 THEN LEAVE X; END IF; SET i = i + 1; END LOOP X;
MOVE statement The MOVE statement changes the field to which the Target reference variable points.
Syntax
MOVE Target
TO SourceFieldReference PARENT FIRSTCHILD NAME clauses LASTCHILD PREVIOUSSIBLING NEXTSIBLING
NAME clauses:
TYPE
Expression
NAMESPACE
Expression *
NAME
Expression
IDENTITY PathElement (1) REPEAT TYPE NAME TYPE-NAME
Notes: 1
The RepeatClause can be used only with the PREVIOUSSIBLING and NEXTSIBLING qualifiers.
If you include a TO clause, this clause changes the target reference to point to the same entity as that pointed to by source; this can either be a message field or a declared variable.
1574
Message Flows
If you include a PARENT, PREVIOUSSIBLING, NEXTSIBLING, FIRSTCHILD, or LASTCHILD clause, the MOVE statement attempts to move the target reference variable in the direction specified relative to its current position. If any field exists in the given direction, the move succeeds. If there is no such field, the move fails; that is the reference variable continues to point to the same field or variable as before, and the LASTMOVE function returns false. You can use the LASTMOVE function to determine the success or failure of a move. If a TYPE clause, NAME clause, or both are present, the target is again moved in the direction specified (PREVIOUSSIBLING or NEXTSIBLING, or FIRSTCHILD or LASTCHILD) but to a field with the given type, name, or both. This is particularly useful when the name or type (or both) of the target field is known, because this reduces the number of MOVE statements required to navigate to a field. This is because fields that do not match the criteria are skipped over; this can also include unexpected message tree fields, for example, those representing whitespace. If the specified move cannot be made (that is, a field with the given type or name does not exist), the target remains unchanged and the LASTMOVE function returns false. The TYPE clause, NAME clause, or both clauses can contain any expression that returns a value of a suitable data type (INTEGER for type and CHARACTER for name). An exception is thrown if the value supplied is NULL. Two further clauses, NAMESPACE and IDENTITY enhance the functionality of the NAME clause. The NAMESPACE clause takes any expression that returns a non-null value of type character. It also takes an * indicating any namespace. Note that this cannot be confused with an expression because * is not a unary operator in ESQL. The meaning depends on the presence of NAME and NAMESPACE clauses as follows: NAMESPACE
NAME
Element located by...
No
No
Type, index, or both
No
Yes
Name in the default namespace
*
Yes
Name
Yes
No
Namespace
Yes
Yes
Name and namespace
The IDENTITY clause takes a single path element in place of the TYPE, NAMESPACE, and NAME clauses and follows all the rules described in the topic for field references (see “ESQL field reference overview” on page 1493). When using MOVE with PREVIOUSSIBLING or NEXTSIBLING, you can specify REPEAT, TYPE, and NAME keywords that move the target to the previous or next field with the same type and name as the current field. The REPEAT keyword is particularly useful when moving to a sibling of the same kind, because you do not have to write expressions to define the type and name.
Example MOVE cursor FIRSTCHILD TYPE XML.Name 'Field1';
ESQL reference
1575
This example moves the reference variable cursor to the first child field of the field to which the cursor is currently pointing, that has the type XML.Name and the name Field1. See “FIELDTYPE function” on page 1638 for a list of the types you can use. The MOVE statement never creates new fields. A common usage of the MOVE statement is to step from one instance of a repeating structure to the next. The fields within the structure can then be accessed by using a relative field reference. For example: WHILE LASTMOVE(sourceCursor) DO SET targetCursor.ItemNumber = sourceCursor.item; SET targetCursor.Description = sourceCursor.name; SET targetCursor.Price = sourceCursor.prc; SET targetCursor.Tax = sourceCursor.prc * 0.175; SET targetCursor.quantity = 1; CREATE NEXTSIBLING OF targetCursor AS targetCursor REPEAT; MOVE sourceCursor NEXTSIBLING REPEAT TYPE NAME; END WHILE;
For more information about reference variables, and an example of moving a reference variable, see “Creating dynamic field references” on page 316.
PASSTHRU statement The PASSTHRU statement evaluates an expression and runs the resulting character string as a database statement.
PASSTHRU
Expression
TO
DatabaseReference
, VALUES
( Expression
)
(1) (
Expression
) , , Expression
WHERE: DatabaseReference =
Database .
DataSourceClause
Notes: 1
The lower half of the main syntax diagram (the second of the two ways of coding the Expression to be passed to PASSTHRU) describes syntax retained for backward compatability.
Usage The main use of the PASSTHRU statement is to issue administrative commands to databases (for example, to create a table).
1576
Message Flows
Note: Do not use PASSTHRU to call stored procedures; instead, use the CALL statement because PASSTHRU imposes limitations (you cannot use output parameters, for example). The first expression is evaluated and the resulting character string is passed to the database pointed to by DatabaseReference (in the TO clause) for execution. If the TO clause is not specified, the database pointed to by the node’s data source attribute is used. Use question marks (?) in the database string to denote parameters. The parameter values are supplied by the VALUES clause. If the VALUES clause is specified, its expressions are evaluated and passed to the database as parameters; (that is, the expressions’ values are substituted for the question marks in the database statement). If only one VALUE expression exists, the result might or might not be a list. If it is a list, the list’s scalar values are substituted sequentially for the question marks. If it is not a list, the single scalar value is substituted for the (single) question mark in the database statement. If more than one VALUE expression exists, none of the expressions evaluate to a list; their scalar values are substituted sequentially for the question marks instead. Because the database statement is constructed by the user program, it is not essential to use parameter markers (that is, the question marks) or the VALUES clause, because the whole of the database statement could be supplied, as a literal string, by the program. However, use parameter markers whenever possible because this reduces the number of different statements that need to be prepared and stored in the database and the broker.
Database reference A database reference is a special instance of the field references that is used to refer to message trees. It consists of the word Database followed by the name of a data source (that is, the name of a database instance). You can specify the data source name directly or by an expression enclosed in braces ({...}). A directly-specified data source name is subject to name substitution. That is, if the name used has been declared to be a known name, the value of the declared name is used rather than the name itself (see “DECLARE statement” on page 1553). If you have created a message flow that contains one of the following nodes, and the ESQL that is associated with this node includes a PASSTHRU statement and a database reference, you must specify a value for the Data source property of the relevant node: v Compute v Database v Filter
Handling errors It is possible for errors to occur during PASSTHRU operations. For example, the database might not be operational or the statement might be invalid. In these cases, an exception is thrown (unless the node has its Throw exception on database
ESQL reference
1577
error property cleared). These exceptions set appropriate SQL code, state, native error, and error text values and can be dealt with by error handlers (see the DECLARE HANDLER statement). For further information about handling database errors, see “Capturing database state” on page 365.
Examples The following example creates the table Customers in schema Shop in database DSN1: PASSTHRU 'CREATE TABLE Shop.Customers ( CustomerNumber INTEGER, FirstName VARCHAR(256), LastName VARCHAR(256), Street VARCHAR(256), City VARCHAR(256), Country VARCHAR(256) )' TO Database.DSN1;
If, as in the last example, the ESQL statement is specified as a string literal, you must put single quotes around it. If, however, it is specified as a variable, omit the quotation marks. For example: SET myVar = 'SELECT * FROM user1.stocktable'; SET OutputRoot.XMLNS.Data[] = PASSTHRU(myVar);
The following example “drops” (that is, deletes) the table Customers from schema Shop in database DSN1: PASSTHRU 'DROP TABLE Shop.Customers' TO Database.DSN1;
PROPAGATE statement The PROPAGATE statement propagates a message to the downstream nodes.
Syntax
PROPAGATE
TO
TERMINAL TerminalExpression LABEL LabelExpression
MessageSources
Controls
WHERE: MessageSources = ENVIRONMENT
Expression
MESSAGE
Expression
EXCEPTION
Expression
Controls = FINALIZE
DEFAULT NONE
DELETE
DEFAULT NONE
You can use the PROPAGATE statement in Compute and Database nodes, but not in Filter nodes. The additions to this statement assist in error handling - see “Coding ESQL to handle errors” on page 360.
1578
Message Flows
TO TERMINAL clause If the TO TERMINAL clause is present, TerminalExpression is evaluated. If the result is of type CHARACTER, a message is propagated to a terminal according to the rule: 'nowhere' 'failure' 'out' 'out1' 'out2' 'out3' 'out4'
: : : : : : :
no propagation Failure Out Out1 Out2 Out3 Out4
Tip: Terminal names are case sensitive so, for example, Out1 does not match any terminal. If the result of TerminalExpression is of type INTEGER, a message is propagated to a terminal according to the rule: -2 -1 0 1 2 3 4
: : : : : : :
no propagation Failure Out Out1 Out2 Out3 Out4
If the result of TerminalExpression is neither a CHARACTER nor an INTEGER, the broker throws an exception. If there is neither a TO TERMINAL nor a TO LABEL clause, the broker propagates a message to the Out terminal. Tip: Using character values in terminal expressions leads to the most natural and readable code. Integer values, however, are easier to manipulate in loops and marginally faster. TO LABEL clause If the TO LABEL clause is present, LabelExpression is evaluated. If the result is of type CHARACTER and there is a Label node with a Label property that matches LabelExpression, in the same flow, the broker propagates a message to that node. Tip: Labels, like terminals, are case sensitive. Also, note that, as with route to Label nodes, it is the Label Name property of the Label node that defines the target, not the node’s label itself. If the result of LabelExpression is NULL or not of type CHARACTER, or there is no matching Label node in the flow, the broker throws an exception. If there is neither a TO TERMINAL nor a TO LABEL clause, the broker propagates a message to the out terminal. MessageSources clauses The MessageSources clauses select the message trees to be propagated. This clause is only applicable to the Compute node (it has no effect in the Database node). The values that you can specify in MessageSources clauses are: ENVIRONMENT : InputLocalEnvironment OutputLocalEnvironment Message : ESQL reference
1579
InputRoot OutputRoot ExceptionList : InputExceptionList OutputExceptionList
If there is no MessageSources clause, the node’s Compute mode property is used to determine which messages are propagated. FINALIZE clause Finalization is a process that fixes header chains and makes the Properties folder match the headers. If present, the FINALIZE clause allows finalization to be controlled. This clause is only applicable to the Compute node (it has no effect in a Database node). The Compute node allows its output message to be changed by other nodes (by the other nodes changing their input message). However, a message created by a Compute node cannot be changed by another node after: v It has been finalized v It has reached any output or other node which generates a bit-stream If FINALIZE is set to DEFAULT, or the FINALIZE clause is absent, the output message (but not the Environment, Local Environment or Exception List) is finalized before propagation. If FINALIZE is set to NONE, no finalization takes place. This option is required if you want to preserve and allow updates of the entire output message tree by the nodes downstream in the message flow and is used with DELETE NONE as described in the next section. DELETE clause The DELETE clause allows the clearing of the output local environment, message, and exception list to be controlled. The DELETE clause is only applicable to the Compute node (it has no effect in a Database node). If DELETE is set to DEFAULT, or the DELETE clause is absent, the output local environment, message, and exception list are all cleared and their memory recovered immediately after propagation. If DELETE is set to NONE, nothing is cleared. Use DELETE NONE if you want the downstream nodes to be able to see a single instance of output local environment message, and exception list trees. Each propagate starts with the content of these trees as created by the previous propagate rather than starting with empty trees. If you also want these nodes to update the output tree, DELETE NONE must be used with the FINALIZE NONE option described in the previous section. Note that the output trees that are finalized are cleared, regardless of which ones are propagated. Propagation is a synchronous process. That is, the next statement is not executed until all the processing of the message in downstream nodes has completed. Be aware that this processing might throw exceptions and that, if these exceptions are not caught, they will prevent the statement following the PROPAGATE call being reached. This may be what the logic of your flow requires but, if it is not, you can use a handler to catch the exception and perform the necessary actions. Note that exceptions thrown downstream of a propagate, if not caught, will also prevent the
1580
Message Flows
final automatic actions of a Compute or Database node (for example, issuing a COMMIT Transaction set to Commit) from taking place. DECLARE i INTEGER 1; DECLARE count INTEGER; SET count = CARDINALITY(InputRoot.XMLNS.Invoice.Purchases."Item"[]) WHILE i <= count DO --use the default tooling-generated procedure for copying message headers CALL CopyMessageHeaders(); SET OutputRoot.XMLNS.BookSold.Item = InputRoot.XMLNS.Invoice.Purchases.Item[i]; PROPAGATE; SET i = i+1; END WHILE; RETURN FALSE;
The following messages are produced on the Out terminal by the PROPAGATE statement: - <Title Category="Computer" Form="Paperback" Edition="2">The XML Companion
0201674866 Neil Bradley Addison-Wesley October 1999 27.95 2 - <Title Category="Computer" Form="Paperback" Edition="2">A Complete Guide to DB2 Universal Database
1558604820 Don Chamberlin Morgan Kaufmann Publishers April 1998 42.95 1 - <Title Category="Computer" Form="Hardcover" Edition="0">JAVA 2 Developers Handbook
0782121799 Phillip Heller, Simon Roberts Sybex, Inc. September 1998 59.99 1
REPEAT statement The REPEAT statement processes a sequence of statements and then evaluates the condition expression.
ESQL reference
1581
Syntax
RepeatUntil Label : RepeatUntil
Label
RepeatUntil: REPEAT statements UNTIL condition END REPEAT
The REPEAT statement repeats the steps until condition is TRUE. Ensure that the logic of the program is such that the loop terminates. If the condition evaluates to UNKNOWN, the loop does not terminate. If present, the Label gives the statement a name. This has no effect on the behavior of the REPEAT statement, but allows statements to include ITERATE and LEAVE statements or other labelled statements, which in turn include ITERATE and LEAVE. The second Label can be present only if the first Label is present and, if it is, the labels must be identical. Two or more labelled statements at the same level can have the same label, but this partly negates the advantage of the second Label. The advantage is that it unambiguously and accurately matches each END with its REPEAT. However, a labelled statement within statements cannot have the same label because this makes the behavior of the ITERATE and LEAVE statements ambiguous.
Example DECLARE i INTEGER; SET i = 1; X : REPEAT ... SET i = i + 1; UNTIL i>= 3 END REPEAT X;
RESIGNAL statement The RESIGNAL statement re-throws the current exception (if there is one).
Syntax
RESIGNAL
RESIGNAL re-throws the current exception (if there is one). You can use it only in error handlers.. Typically, RESIGNAL is used when an error handler catches an exception that it can’t handle. The handler uses RESIGNAL to re-throw the original exception so that a handler in higher-level scope has the opportunity to handle it.
1582
Message Flows
Because the handler throws the original exception, rather than a new (and therefore different) one: 1. The higher-level handler is not affected by the presence of the lower-level handler. 2. If there is no higher-level handler, you get a full error report in the event log.
Example RESIGNAL;
RETURN statement The RETURN statement ends processing. What happens next depends on the programming context in which the RETURN statement is issued.
Syntax
RETURN
expression
Main Function When used in the Main function, the RETURN statement stops processing of the module and returns control to the next node in a message flow. In the Main function the return statement must contain an expression of BOOLEAN type. The behavior of the RETURN statement in the Main function is dependant on the node. In the Compute node for example, if expression is anything other than TRUE, propagation of the message is stopped. In the Filter node, however, the message is propagated to the terminal matching the value of expression: TRUE, FALSE and UNKNOWN. The following table describes the differences between the RETURN statement when used in the Main function of the Compute, Filter, and Database nodes. Node
RETURN TRUE; RETURN FALSE;
RETURN RETURN; UNKNOWN (if BOOLEAN type) or RETURN NULL;
Compute
Propagate message to Out terminal.
Stop propagation Stop propagation Deploy failure (BIP2912E: Type mismatch on RETURN)
Database
Propagate message to Out terminal.
Stop propagation Stop propagation Deploy failure (BIP2912E: Type mismatch on RETURN)
Filter
Propagate message to True terminal
Propagate Propagate message to False message to terminal Unknown terminal
Deploy failure (BIP2912E: Type mismatch on RETURN)
User defined functions and procedures ESQL reference
1583
When used in a function or a procedure, the RETURN statement stops processing of that function and returns control to the calling expression. The expression, which must be present if the function or procedure has been declared with a RETURNS clause, is evaluated and acts as the return value of the function. The data type of the returned value must be the same as that in the function’s declaration. The following table describes the differences between the RETURN statement when used in user defined functions and procedures. RETURN expression;
RETURN NULL; RETURN; (or return expression that evaluates to NULL)
No RETURN statement
User defined function or procedure with a RETURNS clause
Returns control to the calling expression with the value of expression
Returns control to the calling expression with NULL
Deploy failure (BIP2912E: Type mismatch on RETURN)
Returns control to the calling expression with NULL after all the statements in the function or procedure have been run
User defined function or procedure without a RETURNS clause
Deploy failure (BIP2401E: Syntax error: expected ; but found expression)
Deploy failure (BIP2401E: Syntax error: expected ; but found NULL)
Returns control to the calling expression
Returns control to the calling expression after all the statements in the function or procedure have been run
The RETURN statement must be used within the body of a function or procedure that has the RETURNS statement in its declaration. This function can be invoked using the CALL ... INTO statement. The RETURNS statement provides the datatype that the function or procedure returns to the “CALL statement” on page 1515. The CALL ... INTO statement specifies the variable to which the return value is assigned. The example in this topic shows an example of how a RETURNS and CALL ... INTO statement are used together to assign the return statement. If you use the CALL ... INTO statement to call a function or procedure that does not have a RETURNS statement declared, a BIP2912E error message is generated.
Example The following example, which is based on “Example message” on page 1701, illustrates how the RETURN, RETURNS and CALL...INTO statements can be used: CREATE FILTER MODULE ProcessOrder CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN DECLARE SpecialOrder BOOLEAN; SET OutputRoot.MQMD = InputRoot.MQMD; CALL IsBulkOrder(InputRoot.XMLNS.Invoice.Purchases) INTO SpecialOrder; --- more processing could be inserted here -- before routing the order to the appropriate terminal -RETURN SpecialOrder;
1584
Message Flows
END; CREATE FUNCTION IsBulkOrder (P1 REFERENCE) RETURNS BOOLEAN BEGIN -- Declare and initialize variables-DECLARE a INT 1; DECLARE PriceTotal FLOAT 0.0; DECLARE NumItems INT 0; DECLARE iroot REFERENCE TO P1; -- Calculate value of order, however if this is a bulk purchase, the -- order will need to be handled differently (discount given) so return TRUE -- or FALSE depending on the size of the order WHILE a <= CARDINALITY(iroot.Item[]) DO SET NumItems = NumItems + iroot.Item[a].Quantity; SET PriceTotal = PriceTotal + iroot.Item[a].UnitPrice; SET a = a + 1; END WHILE; RETURN (PriceTotal/NumItems> 42);
----
END; END MODULE;
In the example, if the average price of items is greater than 42, TRUE is returned; otherwise FALSE is returned. Thus, a Filter node could route messages describing expensive items down a different path from messages describing inexpensive items. From the example, the CALL IsBulkOrder(InputRoot.XMLNS.Invoice.Purchases) INTO SpecialOrder; statement can also be written as SpecialOrder = IsBulkOrder(InputRoot.XMLNS.Invoice.Purchases); If you are using the PROPAGATE statement in your node it is important that you use a RETURN FALSE; to prevent automatic propagation of the message to the next node in the message flow. See “PROPAGATE statement” on page 1578 for an example of preventing the implicit propagate at the end of processing in a Compute node.
SET statement The SET statement assigns a value to a variable.
Syntax
SET TargetFieldReference
=
SourceExpression
TYPE NAMESPACE NAME VALUE
Introduction TargetFieldReference identifies the target of the assignment. The target can be any of the following: v A declared scalar variable ESQL reference
1585
v v v v v
A declared row variable One of the predefined row variables (for example, InputRoot) A field within any kind of row variable (that is, a sub tree or conceptual row) A list of fields within any kind of row variable (that is, a conceptual list) A declared reference variable that points to any of the above
The target cannot be any kind of database entity. SourceExpression is an expression which supplies the value to be assigned. It may be any kind of expression and may return a scalar, row or list value.
Assignment to scalar variables If the target is a declared scalar variable, SourceExpression is evaluated and assigned to the variable. If need be, its value is converted to the data type of the variable. If this conversion is not possible, there will be either an error at deploy time or an exception at run time. Null values are handled in exactly the same way as any other value. That is, if the expression evaluates to null, the value “null” is assigned to the variable. For scalar variables the TYPE, NAME, NAMESPACE, and VALUE clauses are meaningless and are not allowed.
Assignment to rows, lists, and fields If the target is a declared row variable, one of the predefined row variables, a field within any kind of row variable, a list of fields within any kind of row variable, or a declared reference variable that points to any of these things, the ultimate target is a field. In these cases, the target field is navigated to (creating the fields if necessary). If array indices are used in TargetFieldReference, the navigation to the target field can only create fields on the direct path from the root to the target field. For example, the following SET statement requires that at least one instance of Structure already exists in the message: SET OutputRoot.XMLNS.Message.Structure[2].Field = ...
The target field’s value is set according to a set of rules, based on: 1. The presence or absence of the TYPE, NAME, NAMESPACE, or VALUE clauses 2. The data type returned by the source expression 1. If no TYPE, NAME, NAMESPACE, or VALUE clause is present (which is the most common case) the outcome depends on whether SourceExpression evaluates to a scalar, a row, or a list: v If SourceExpression evaluates to a scalar, the value of the target field is set to the value returned by SourceExpression, except that, if the result is null, the target field is discarded. Note that the new value of the field may not be of the same data type as its previous value. v If SourceExpression evaluates to a row: a. The target field is identified. b. The target field’s value is set. c. The target field’s child fields are replaced by a new set, dictated by the structure and content of the list. v If SourceExpression evaluates to a list: a. The set of target fields in the target tree are identified.
1586
Message Flows
b. If there are too few target fields, more are created; if there are too many, the extra ones are removed. c. The target fields’ values are set. d. The target fields’ child fields are replaced by a new set, dictated by the structure and content of the list. For further information on working with elements of type list see “Working with elements of type list” on page 326 2. If a TYPE clause is present, the type of the target field is set to the value returned by SourceExpression. An exception is thrown if the returned value is not scalar, is not of type INTEGER, or is NULL. 3. If a NAMESPACE clause is present, the namespace of the target field is set to the value returned by SourceExpression. An exception is thrown if the returned value is not scalar, is not of type CHARACTER, or is NULL. 4. If a NAME clause is present, the name of the target field is set to the value returned by SourceExpression. An exception is thrown if the returned value is not scalar, is not of type CHARACTER, or is NULL. 5. If a VALUE clause is present, the value of the target field is changed to that returned by SourceExpression. An exception is thrown if the returned value is not scalar.
Notes SET statements are particularly useful in Compute nodes that modify a message, either changing a field or adding a new field to the original message. SET statements are also useful in Filter and Database nodes, to set declared variables or the fields in the Environment tree or Local Environment trees. You can use statements such as the following in a Compute node that modifies a message: SET OutputRoot = InputRoot; SET OutputRoot.XMLNS.Order.Name = UPPER(InputRoot.XMLNS.Order.Name);
This example puts one field in the message into uppercase. The first statement constructs an output message that is a complete copy of the input message. The second statement sets the value of the Order.Name field to a new value, as defined by the expression on the right. If the Order.Name field does not exist in the original input message, it does not exist in the output message generated by the first statement. The expression on the right of the second statement returns NULL (because the field referenced inside the UPPER function call does not exist). Assigning the NULL value to a field has the effect of deleting it if it already exists, and so the effect is that the second statement has no effect. If you want to assign a NULL value to a field without deleting the field, use a statement like this: SET OutputRoot.XMLNS.Order.Name VALUE = NULL;
THROW statement Use the THROW statement to generate a user exception.
ESQL reference
1587
Syntax
THROW
EXCEPTION
USER
SEVERITY
expression
CATALOG catalog name
MESSAGE
message number
, VALUES (
expression
)
The USER keyword indicates the type of exception being thrown. (Currently, only USER exceptions are supported, and if you omit the USER keyword the exception defaults to a USER exception anyway.) Specify the USER keyword, even though it currently has no effect, for the following reasons: v If future broker releases support other types of exception, and the default type changes, your code will not need to be changed. v It makes it clear that this is a user exception. SEVERITY is an optional clause that determines the severity associated with the exception. The clause can contain any expression that returns a non-NULL, integer value. If you omit the clause, it defaults to 1. CATALOG is an optional clause; if you omit it, it defaults to the WebSphere Message Broker current version catalog. To use the current version message catalog explicitly, use BIPv610 on all operating systems. MESSAGE is an optional clause; if you omit it, it defaults to the first message number of the block of messages provided for using THROW statements in the default catalog (2951). If you enter a message number in the THROW statement, you can use message numbers 2951 to 2999 from the default catalog. Alternatively, you can generate your own catalog by following the instructions in Creating message catalogs. Use the optional VALUES field to insert data into your message. You can insert any number of pieces of information, but the messages supplied (2951 - 2999) cater for eight inserts only.
Examples Here are some examples of how you might use a THROW statement: v THROW USER EXCEPTION;
v THROW USER EXCEPTION CATALOG 'BIPv610' MESSAGE 2951 VALUES(1,2,3,4,5,6,7,8) ;
v
1588
Message Flows
THROW USER EXCEPTION CATALOG 'BIPv610' MESSAGE 2951 VALUES('The SQL State: ', SQLSTATE, 'The SQL Code: ', SQLCODE, 'The SQLNATIVEERROR: ', SQLNATIVEERROR, 'The SQL Error Text: ', SQLERRORTEXT ) ;
v THROW USER EXCEPTION CATALOG 'BIPv610' MESSAGE 2951 ;
v THROW USER EXCEPTION CATALOG 'MyCatalog' MESSAGE 2951 VALUES('Hello World') ; v THROW USER EXCEPTION MESSAGE 2951 VALUES('Insert text 1', 'Insert text 2') ;
For more information about how to throw an exception, and details of SQLSTATE, SQLCODE, SQLNATIVEERROR, and SQLERRORTEXT, see “ESQL database state functions” on page 1596.
UPDATE statement The UPDATE statement changes the values of specified columns, in selected rows, in a table in an external database.
Syntax
UPDATE TableReference
AS
CorrelationName
, SET Column = Expression
WHERE
Expression
WHERE: TableReference =
Database
. . .
TableClause
SchemaClause
DataSourceClause
DataSourceClause =
SchemaClause =
TableClause =
DataSourceName { DataSourceExpression
SchemaName { SchemaExpression
TableName { TableExpression
}
}
}
ESQL reference
1589
All rows for which the WHERE clause expression evaluates to TRUE are updated in the table identified by TableReference. Each row is examined in turn and a variable is set to point to the current row. Typically, the WHERE clause expression uses this variable to access column values and thus cause rows to be updated, or retained unchanged, according to their contents. The variable is referred to by CorrelationName or, in the absence of an AS clause, by TableName. When a row has been selected for updating, each column named in the SET clause is given a new value as determined by the corresponding expression. These expressions can, if you wish, refer to the current row variable.
Table reference A table reference is a special case of the field references that are used to refer to message trees. It always starts with the word “Database” and may contain any of the following: v A table name only v A schema name and a table name v A data source name (that is, the name of a database instance), a schema name, and a table name In each case, the name may be specified directly or by an expression enclosed in braces ({...}). A directly-specified data source, schema, or table name is subject to name substitution. That is, if the name used has been declared to be a known name, the value of the declared name is used rather than the name itself (see “DECLARE statement” on page 1553). If a schema name is not specified, the default schema for the broker’s database user is used. If a data source name is not specified, the database pointed to by the node’s data source attribute is used.
The WHERE clause The WHERE clause expression can use any of the broker’s operators and functions in any combination. It can refer to table columns, message fields, and any declared variables or constants. However, be aware that the broker treats the WHERE clause expression by examining the expression and deciding whether the whole expression can be evaluated by the database. If it can, it is given to the database. In order to be evaluated by the database, it must use only those functions and operators supported by the database. The WHERE clause can, however, refer to message fields, correlation names declared by containing SELECT functions, and to any other declared variables or constants within scope. If the whole expression cannot be evaluated by the database, the broker looks for top-level AND operators and examines each sub-expression separately. It then attempts to give the database those sub-expressions that it can evaluate, leaving the broker to evaluate the rest. You need to be aware of this situation for two reasons: 1. Apparently trivial changes to WHERE clause expressions can have large effects on performance. You can determine how much of the expression was given to the database by examining a user trace.
1590
Message Flows
2. Some databases’ functions exhibit subtle differences of behavior from those of the broker.
Handling errors It is possible for errors to occur during update operations. For example, the database may not be operational, or the table may have constraints defined that the new values would violate. In these cases, an exception is thrown (unless the node has its throw exception on database error property set to FALSE). These exceptions set appropriate SQL code, state, native error, and error text values and can be dealt with by error handlers (see the DECLARE HANDLER statement). For further information about handling database errors, see “Capturing database state” on page 365.
Examples The following example assumes that the dataSource property of the Database node has been configured, and that the database it identifies has a table called STOCKPRICES, with columns called COMPANY and PRICES. It updates the PRICE column of the rows in the STOCKPRICES table whose COMPANY column matches the value given in the Company field in the message. UPDATE Database.StockPrices AS SP SET PRICE = InputBody.Message.StockPrice WHERE SP.COMPANY = InputBody.Message.Company
In the following example (which make similar assumptions), the SET clause expression refers to the existing value of a column and thus decrements the value by an amount in the message: UPDATE Database.INVENTORY AS INV SET QUANTITY = INV.QUANTITY - InputBody.Message.QuantitySold WHERE INV.ITEMNUMBER = InputBody.Message.ItemNumber
The following example updates multiple columns: UPDATE Database.table AS T SET column1 = T.column1+1, column2 = T.column2+2;
Note that the column names (on the left of the ″=″) are single identifiers. They must not be qualified with a table name or correlation name. In contrast, the references to database columns in the expressions (to the right of the ″=″) must be qualified with the correlation name. The next example shows the use of calculated data source, schema, and table names: -- Declare variables to hold the data source, schema and table names -- and set their default values DECLARE Source CHARACTER 'Production'; DECLARE Schema CHARACTER 'db2admin'; DECLARE Table CHARACTER 'DynamicTable1'; -- Code which calculates their actual values comes here -- Update rows in the table UPDATE Database.{Source}.{Schema}.{Table} AS R SET Value = 0;
ESQL reference
1591
WHILE statement The WHILE statement evaluates a condition expression, and if it is TRUE executes a sequence of statements.
Syntax
While Label :
While Label
While: WHILE condition DO statements END WHILE
The WHILE statement repeats the steps specified in DO as long as condition is TRUE. It is your responsibility to ensure that the logic of the program is such that the loop terminates. If condition evaluates to UNKNOWN, the loop terminates immediately. If present, Label gives the statement a name. This has no effect on the behavior of the WHILE statement itself, but allows statements to include ITERATE and LEAVE statements or other labelled statements, which in turn include them. The second Label can be present only if the first Label is present and if it is, the labels must be identical. It is not an error for two or more labelled statements at the same level to have the same Label, but this partly negates the advantage of the second Label. The advantage is that it unambiguously and accurately matches each END with its WHILE. However, it is an error for a labelled statement within statements to have the same label, because this makes the behavior of the ITERATE and LEAVE statements ambiguous.
Example For example: DECLARE i INTEGER; SET i = 1; X : WHILE i <= 3 DO ... SET i = i + 1; END WHILE X;
ESQL functions: reference material, organized by function type A table summarizing the functions that are available in ESQL, and what they do. CATEGORY
FUNCTIONS
RELATED KEYWORDS
Variable manipulation Manipulation of all sources of variables Basic manipulation of all types of variable
1592
Message Flows
v “CAST function” on page 1648
v ENCODING, CCSID, AS
Selective assignment to any variable
v “CASE function” on page 1647
Creation of values
v “UUIDASBLOB function” on page 1692
v ELSE, WHEN, THEN, END
v “COALESCE function” on page 1688
v “UUIDASCHAR function” on page 1692 Manipulation of message trees Assignment to and deletion from a message tree
v “SELECT function” on page 1662 (used with SET statement)
v FROM, AS, ITEM, THE, SUM, COUNT, MAX, MIN
v “ROW constructor function” on page 1669 v “LIST constructor function” on page 1670
Information relating to message trees or subtrees
v “ASBITSTREAM function” on page 1633 v “BITSTREAM function (deprecated)” on page 1637 v “FIELDNAME function” on page 1637 v “FIELDNAMESPACE function” on page 1638 v “FIELDTYPE function” on page 1638
Processing Lists
v CARDINALITY, see “CARDINALITY function” on page 1644 for details. v EXISTS, see “EXISTS function” on page 1645 for details. v SINGULAR, see “SINGULAR function” on page 1645 for details. v THE, see “THE function” on page 1646 for details.
Processing repeating fields
v FOR
v ALL, ANY, SOME
v “SELECT function” on page 1662
v FROM, AS, ITEM, THE, SUM, COUNT, MAX, MIN
Processing based on data type String processing Numeric information about strings
v “LENGTH function” on page 1622
String conversion
v “UPPER and UCASE functions” on page 1632
IN
v “POSITION function” on page 1625
v “LOWER and LCASE functions” on page 1623
ESQL reference
1593
| |
String manipulation
v “CONTAINS function” on page 1621
v LEADING, TRAILING, BOTH, FROM
v “ENDSWITH function” on page 1622
v PLACING, FROM, FOR
v “LEFT function” on page 1622
v FROM FOR
v “LTRIM function” on page 1623 v
“OVERLAY function” on page 1624
v
“REPLACE function” on page 1626
v “REPLICATE function” on page 1626 v “RIGHT function” on page 1627 v “RTRIM function” on page 1627 v “SPACE function” on page 1628
|
v “STARTSWITH function” on page 1628 v
“SUBSTRING function” on page 1629
v
“TRANSLATE function” on page 1630
v “TRIM function” on page 1631 Numeric processing Bitwise operations
v “BITAND function” on page 1608 v “BITNOT function” on page 1608 v “BITOR function” on page 1609 v “BITXOR function” on page 1609
General
v “ABS and ABSVAL functions” on page 1606 v “ACOS function” on page 1607 v “ASIN function” on page 1607 v “ATAN function” on page 1607 v “ATAN2 function” on page 1607 v “COS function” on page 1610 v “COSH function” on page 1611 v “COT function” on page 1611 v “DEGREES function” on page 1611 v “EXP function” on page 1611 v “FLOOR function” on page 1612 v “LN and LOG functions” on page 1612 v “LOG10 function” on page 1613 v “MOD function” on page 1613 v “POWER function” on page 1613 v “RADIANS function” on page 1614 v “RAND function” on page 1614 v “ROUND function” on page 1614 v “SIGN function” on page 1618 v “SIN function” on page 1618 v “SINH function” on page 1618 v “SQRT function” on page 1618 v “TAN function” on page 1619 v “TANH function” on page 1619 v “TRUNCATE function” on page 1620
Date time processing
1594
Message Flows
v “CURRENT_DATE function” on page 1603 YEAR, MONTH, DAY, HOUR, MINUTE, SECOND v “CURRENT_GMTDATE function” on page 1604 v “CURRENT_GMTTIME function” on page 1604 v “CURRENT_TIME function” on page 1603 v “CURRENT_TIMESTAMP function” on page 1603 v “CURRENT_GMTTIMESTAMP function” on page 1604 v “LOCAL_TIMEZONE function” on page 1605 v “EXTRACT function” on page 1601 Boolean evaluation for conditional statements Functions that return a Boolean value
v BETWEEN, see “ESQL simple comparison operators” on page 1500 for details.
SYMMETRIC, ASYMMETRIC, AND
v EXISTS, see “EXISTS function” on page 1645 for details. v IN, see “ESQL simple comparison operators” on page 1500 for details. v LIKE, see “ESQL simple comparison operators” on page 1500 for details. v “NULLIF function” on page 1689 v “LASTMOVE function” on page 1643 v “SAMEFIELD function” on page 1643 v SINGULAR, see “SINGULAR function” on page 1645 for details. Broker database interaction Actions on tables
v “PASSTHRU function” on page 1689 v “SELECT function” on page 1662
Results of actions
v FROM, AS, ITEM, THE, SUM, COUNT, MAX, MIN
v “SQLCODE function” on page 1596 v “SQLERRORTEXT function” on page 1596 v “SQLNATIVEERROR function” on page 1597 v “SQLSTATE function” on page 1598
Calling ESQL functions Most ESQL functions belong to a schema called SQL and this is particularly useful if you have functions with the same name. For example, if you have created a function called SQRT, you can code: /* call my SQRT function
*/
SET Variable1=SQRT (4); /* call the SQL supplied function */ SET Variable2=SQL.SQRT (144);
Most of the functions described in this section impose restrictions on the data types of the arguments that can be passed to the function. If the values passed to ESQL reference
1595
the functions do not match the required data types, errors are generated at node configuration time whenever possible. Otherwise runtime errors are generated when the function is evaluated.
ESQL database state functions ESQL provides four functions to return database state. These are: v “SQLCODE function” v “SQLERRORTEXT function” v “SQLNATIVEERROR function” on page 1597 v “SQLSTATE function” on page 1598
SQLCODE function SQLCODE is a database state function that returns an INTEGER data type with a default value of 0 (zero).
Syntax
SQLCODE
Within a message flow, you can access and update an external database resource using the available ESQL database functions in the Filter, Database, and Compute nodes. When making calls to an external database, you might get errors, such as a table does not exist, a database is not available, or an insert for a key that already exists. When these errors occur, the default action of the broker is to generate an exception. This behavior is determined by how you have set the property Throw exception on database error. If this check box is selected, the broker stops processing the node, propagates the message to the node’s failure terminal, and writes the details of the error to the ExceptionList. If you want to override the default behavior and handle a database error in the ESQL in the node, clear the Throw exception on database error check box. The broker does not throw an exception and you must include the THROW statement to throw an exception if a certain SQL state code is not expected. See “THROW statement” on page 1587 for a description of THROW. If you choose to handle database errors in a node, you can use the database state function SQLCODE to receive information about the status of the DBMS call made in ESQL. You can include it in conditional statements in current node’s ESQL to recognize and handle possible errors.
SQLERRORTEXT function SQLERRORTEXT is a database state function that returns a CHARACTER data type with a default value of ’’ (empty string).
1596
Message Flows
Syntax
SQLERRORTEXT
Within a message flow, you can access and update an external database resource using the available ESQL database functions in the Filter, Database, and Compute nodes. When making calls to an external database, you might get errors, such as a table does not exist, a database is not available, or an insert for a key that already exists. When these errors occur, the default action of the broker is to generate an exception. This behavior is determined by how you have set the property Throw exception on database error. If you have selected this check box, the broker stops processing the node, propagates the message to the node’s failure terminal, and writes the details of the error to the ExceptionList. If you want to override the default behavior and handle a database error in the ESQL in the node, clear the Throw exception on database error check box. The broker does not throw an exception and you must include the THROW statement to throw an exception if a certain SQL state code is not expected. See “THROW statement” on page 1587 for a description of THROW. If you choose to handle database errors in a node, you can use the database state function SQLERRORTEXT to receive information about the status of the DBMS call made in ESQL. You can include it in conditional statements in current node’s ESQL to recognize and handle possible errors.
SQLNATIVEERROR function SQLNATIVEERROR is a database state function that returns an INTEGER data type with a default value of 0 (zero).
Syntax
SQLNATIVEERROR
Within a message flow, you can access and update an external database resource using the available ESQL database functions in the Filter, Database, and Compute nodes. When making calls to an external database, you might get errors, such as a table does not exist, a database is not available, or an insert for a key that already exists. When these errors occur, the default action of the broker is to generate an exception. This behavior is determined by how you have set the property Throw exception on database error. If you have selected this check box, the broker stops processing the node, propagates the message to the node’s failure terminal, and writes the details of the error to the ExceptionList. If you want to override the default behavior and handle a database error in the ESQL in the node, clear the Throw exception on database error check box. The broker does not throw an exception
ESQL reference
1597
and you must include the THROW statement to throw an exception if a certain SQL state code is not expected. See “THROW statement” on page 1587 for a description of THROW. If you choose to handle database errors in a node, you can use the database state function SQLNATIVEERROR to receive information about the status of the DBMS call made in ESQL. You can include it in conditional statements in current node’s ESQL to recognize and handle possible errors.
SQLSTATE function SQLSTATE is a database state function that returns a 5 character data type of CHARACTER with a default value of ’00000’ (five zeros as a string).
Syntax
SQLSTATE
Within a message flow, you can access and update an external database resource using the available ESQL database functions in the Compute, Database, and Filter nodes. When making calls to an external database, you might get errors, such as a table does not exist, a database is not available, or an insert for a key that already exists. When these errors occur, the default action of the broker is to generate an exception. This behavior is determined by how you have set the property Throw exception on database error. If you select this property, the broker stops processing the node, propagates the message to the node’s failure terminal, and writes the details of the error to the ExceptionList. If you want to override the default behavior and handle a database error in the ESQL in the node, clear Throw exception on database error. The broker does not throw an exception and you must include the THROW statement to throw an exception if a certain SQL state code is not expected. See “THROW statement” on page 1587 for a description of THROW. To handle database errors in a node, you can use the database state function SQLSTATE to receive information about the status of the DBMS call made in ESQL. You can include it in conditional statements in current node’s ESQL to recognize and handle possible errors.
SQL states In ESQL, SQL states are variable length character strings. By convention, they are six characters long and contain only the characters 0-9, A-Z . The significance of the six characters is: Char 1 The origin of the exception Chars 2 - 3 The class of the exception Chars 4 - 6 The subclass of the exception The SQL state of an exception is determined by a two stage process. In the first stage, the exception information is examined and any wrapping exceptions (that is,
1598
Message Flows
information that says what the broker was doing at the time the exception occurred) is stepped over until the exception that describes the original error is located. The second stage is as follows: 1. If the selected exception is a database exception, the SQL state is that supplied by the database, but prefixed by the letter “D” to avoid any confusion with exceptions arising in the broker. The SQL code, native error, and error text are those supplied by the database. 2. If the selected exception is a user exception (that is, it originated in a THROW statement), the SQL code, state, native error, and error text are taken from the first four inserts of the exception, in order. The resulting state value is taken as is (not prefixed by a letter such as “U”). The letter “U” is not used by the broker as an origin indicator. If you want to define a unique SQL state rather than to imitate an existing one, use SQL states starting with the letter “U”. If you use SQL states that start with the letter “U”, you can write an error handler to match all user-defined and thrown exceptions with a LIKE’U%’ operator. 3. If the selected exception originated in the message transport or in the ESQL implementation itself, the SQL code, state, native error, and error text are as described in the list below. 4. For all other exceptions, the SQL state is ’’, indicating no origin, no class, and no subclass. Some exceptions that currently give an empty SQL state might give individual states in future releases. If you want to catch unclassified exceptions, use the “all” wildcard (“%”) for the SQL state on the last handler of a scope. This wildcard will continue to catch the same set of exceptions if previously unclassified exceptions are given new unique SQL states. The following SQL states are defined: Dddddd ddddd is the state returned by the database. SqlState = ’S22003’ Arithmetic overflow. An operation whose result is a numeric type resulted in a value beyond the range supported. SqlState = ’S22007’ Date time format not valid. A character string used in a cast from character to a datetime type had either the wrong basic format (for example, ’01947-10-24’) or had values outside the ranges allowed by the Gregorian calendar (for example, ’1947-21-24’). SqlState = ’S22008’ Date time field overflow. An operation whose result is a datetime type resulted in a value beyond the range supported. SqlState = ’S22012’ Divide by zero. A divide operation whose result data type has no concept of infinity had a zero right operand. SqlState = ’S22015’ Interval field overflow. An operation whose result is of type INTERVAL resulted in a value beyond the range supported by the INTERVAL data type.
ESQL reference
1599
SqlState = ’S22018’ Character value for cast not valid. SqlState = ’SPS001’ Target terminal not valid. A PROPAGATE to terminal statement attempted to use a terminal name that is not valid. SqlState = ’SPS002’ Target label not valid. A PROPAGATE to label statement attempted to use a label that is not valid. SqlState = ’MQW001’, SqlNativeError = 0 The bit stream does not meet the requirements for WebSphere MQ messages. No attempt was made to put it to a queue. Retrying and queue administration does not resolve this problem. SqlState = ’MQW002’, SqlNativeError = 0 The target queue or queue manager names were not valid (that is, they could not be converted from Unicode to the queue manager’s code page). Retrying and queue emptying does not resolve this problem. SqlState = ’MQW003’, SqlNativeError = 0 Request mode was specified but the “reply to” queue or queue manager names were not valid (that is, could not be converted from Unicode to the message’s code page). Retrying and queue emptying does not resolve this problem. SqlState = ’MQW004’, SqlNativeError = 0 Reply mode was specified but the queue or queue manager names taken from the message were not valid (that is, they could not be converted from the given code page to Unicode). Retrying and queue emptying does not resolve this problem. SqlState = ’MQW005’, SqlNativeError = 0 Destination list mode was specified but the destination list supplied does not meet the basic requirements for destination lists. No attempt was made to put any message to a queue. Retrying and queue administration does not resolve this problem. SqlState = ’MQW101’, SqlNativeError = returned by WebSphere MQ The target queue manager or queue could not be opened. Queue administration might resolve this problem but retrying does not. SqlState = ’MQW102’, SqlNativeError = returned by WebSphere MQ The target queue manager or queue could not be written to. Retrying and queue administration might resolve this problem. SqlState = ’MQW201’, SqlNativeError = number of destinations with an error More than one error occurred while processing a destination list. The message might have been put to zero or more queues. Retrying and queue administration might resolve this problem. Anything that the user has used in a THROW statement Use Uuuuuuu for user exceptions, unless imitating one of the exceptions defined above. Empty string All other errors.
ESQL datetime functions This topic lists the ESQL datetime functions.
1600
Message Flows
In addition to the functions described here, you can use arithmetic operators to perform various calculations on datetime values. For example, you can use the (minus) operator to calculate the difference between two dates as an interval, or you can add an interval to a timestamp. This section covers the following topics: “EXTRACT function” “CURRENT_DATE function” on page 1603 “CURRENT_TIME function” on page 1603 “CURRENT_TIMESTAMP function” on page 1603 “CURRENT_GMTDATE function” on page 1604 “CURRENT_GMTTIME function” on page 1604 “CURRENT_GMTTIMESTAMP function” on page 1604 “LOCAL_TIMEZONE function” on page 1605
EXTRACT function The EXTRACT function extracts fields (or calculates values) from datetime values and intervals. The result is INTEGER for YEAR, MONTH, DAY, HOUR, MINUTE, DAYS, DAYOFYEAR, DAYOFWEEK, MONTHS, QUARTEROFYEAR, QUARTERS, WEEKS, WEEKOFYEAR, and WEEKOFMONTH extracts, but FLOAT for SECOND extracts, and BOOLEAN for ISLEAPYEAR extracts. If the SourceDate is NULL, the result is NULL regardless of the type of extract.
Syntax
EXTRACT (
YEAR MONTH DAY HOUR MINUTE SECOND DAYS DAYOFYEAR DAYOFWEEK MONTHS QUARTEROFYEAR QUARTERS WEEKS WEEKOFYEAR WEEKOFMONTH ISLEAPYEAR
FROM
SourceDate
)
EXTRACT extracts individual fields from datetime values and intervals. You can extract a field only if it is present in the datetime value specified in the second parameter. Either a parse-time or a runtime error is generated if the requested field does not exist within the data type. ESQL reference
1601
The following table describes the extracts that are supported: Note: All new integer values start from 1. Table 301. Extract
Description
YEAR
Year
MONTH
Month
DAY
Day
HOUR
Hour
MINUTE
Minute
SECOND
Second
DAYS
Days encountered between 1st January 0001 and the SourceDate.
DAYOFYEAR
Day of year
DAYOFWEEK
Day of the week: Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5, Friday = 6, Saturday = 7.
MONTHS
Months encountered between 1st January 0001 and the SourceDate.
QUARTEROFYEAR
Quarter of year: January to March = 1, April to June = 2, July to September = 3, October to December = 4.
QUARTERS
Quarters encountered between 1st January 0001 and the SourceDate.
WEEKS
Weeks encountered between 1st January 0001 and the SourceDate.
WEEKOFYEAR
Week of year
WEEKOFMONTH
Week of month
ISLEAPYEAR
Whether this is a leap year
Notes: 1. A week is defined as Sunday to Saturday, not any seven consecutive days. You must convert to an alternative representation scheme if required. 2. The source date time epoch is 1 January 0001. Dates before the epoch are not valid for this function. 3. The Gregorian calendar is assumed for calculation.
Example EXTRACT(YEAR FROM CURRENT_DATE)
and EXTRACT(HOUR FROM LOCAL_TIMEZONE)
both work without error, but EXTRACT(DAY FROM CURRENT_TIME)
fails.
1602
Message Flows
EXTRACT (DAYS FROM DATE '2000-02-29')
calculates the number of days encountered since year 1 to '2000-02-29' and EXTRACT (DAYOFYEAR FROM CURRENT_DATE)
calculates the number of days encountered since the beginning of the current year but EXTRACT (DAYOFYEAR FROM CURRENT_TIME)
fails because CURRENT_TIME does not contain date information.
CURRENT_DATE function The CURRENT_DATE datetime function returns the current date.
Syntax
CURRENT_DATE
CURRENT_DATE returns a DATE value representing the current date in local time. As with all SQL functions that take no parameters, no parentheses are required or accepted. All calls to CURRENT_DATE within the processing of one node are guaranteed to return the same value.
CURRENT_TIME function The CURRENT_TIME datetime function returns the current local time.
Syntax
CURRENT_TIME
CURRENT_TIME returns a TIME value representing the current local time. As with all SQL functions that take no parameters, no parentheses are required or accepted. All calls to CURRENT_TIME within the processing of one node are guaranteed to return the same value.
CURRENT_TIMESTAMP function The CURRENT_TIMESTAMP datetime function returns the current date and local time.
Syntax
CURRENT_TIMESTAMP
ESQL reference
1603
CURRENT_TIMESTAMP returns a TIMESTAMP value representing the current date and local time. As with all SQL functions that take no parameters, no parentheses are required or accepted. All calls to CURRENT_TIMESTAMP within the processing of one node are guaranteed to return the same value.
Example To obtain the following XML output message: <Message>Hello World 2006-02-01 13:13:56.444730
use the following ESQL: SET OutputRoot.XMLNS.Body.Message = 'Hello World'; SET OutputRoot.XMLNS.Body.DateStamp = CURRENT_TIMESTAMP;
CURRENT_GMTDATE function The CURRENT_GMTDATE datetime function returns the current date in the GMT time zone.
Syntax
CURRENT_GMTDATE
CURRENT_GMTDATE returns a DATE value representing the current date in the GMT time zone. As with all SQL functions that take no parameters, no parentheses are required or accepted. All calls to CURRENT_GMTDATE within the processing of one node are guaranteed to return the same value.
CURRENT_GMTTIME function The CURRENT_GMTTIME datetime function returns the current time in the GMT time zone.
Syntax
CURRENT_GMTTIME
It returns a GMTTIME value representing the current time in the GMT time zone. As with all SQL functions that take no parameters, no parentheses are required or accepted. All calls to CURRENT_GMTTIME within the processing of one node are guaranteed to return the same value.
CURRENT_GMTTIMESTAMP function The CURRENT_GMTTIMESTAMP datetime function returns the current date and time in the GMT time zone.
1604
Message Flows
Syntax
CURRENT_GMTTIMESTAMP
CURRENT_GMTTIMESTAMP returns a GMTTIMESTAMP value representing the current date and time in the GMT time zone. As with all SQL functions that take no parameters, no parentheses are required or accepted. All calls to CURRENT_GMTTIMESTAMP within the processing of one node are guaranteed to return the same value.
LOCAL_TIMEZONE function The LOCAL_TIMEZONE datetime function returns the displacement of the local time zone from GMT.
Syntax
LOCAL_TIMEZONE
LOCAL_TIMEZONE returns an interval value representing the local time zone displacement from GMT. As with all SQL functions that take no parameters, no parentheses are required or accepted. The value returned is an interval in hours and minutes representing the displacement of the current time zone from Greenwich Mean Time. The sign of the interval is such that a local time can be converted to a time in GMT by subtracting the result of the LOCAL_TIMEZONE function.
ESQL numeric functions This topic lists the ESQL numeric functions and covers the following: “ABS and ABSVAL functions” on page 1606 “ACOS function” on page 1607 “ASIN function” on page 1607 “ATAN function” on page 1607 “ATAN2 function” on page 1607 “BITAND function” on page 1608 “BITNOT function” on page 1608 “BITOR function” on page 1609 “BITXOR function” on page 1609 “CEIL and CEILING functions” on page 1610 “COS function” on page 1610 “COSH function” on page 1611 ESQL reference
1605
“COT function” on page 1611 “DEGREES function” on page 1611 “EXP function” on page 1611 “FLOOR function” on page 1612 “LN and LOG functions” on page 1612 “LOG10 function” on page 1613 “MOD function” on page 1613 “POWER function” on page 1613 “RADIANS function” on page 1614 “RAND function” on page 1614 “ROUND function” on page 1614 “SIGN function” on page 1618 “SIN function” on page 1618 “SINH function” on page 1618 “SQRT function” on page 1618 “TAN function” on page 1619 “TANH function” on page 1619 “TRUNCATE function” on page 1620
ABS and ABSVAL functions The ABS and ABSVAL numeric functions return the absolute value of a supplied number.
Syntax
ABS ABSVAL
( source_number
)
The absolute value of the source number is a number with the same magnitude as the source but without a sign. The parameter must be a numeric value. The result is of the same type as the parameter unless it is NULL, in which case the result is NULL. For example: ABS( -3.7 )
returns 3.7 ABS( 3.7 )
returns 3.7 ABS( 1024 )
1606
Message Flows
returns 1024
ACOS function The ACOS numeric function returns the angle of a given cosine.
Syntax
ACOS
( NumericExpression
)
The ACOS function returns the angle, in radians, whose cosine is the given NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
ASIN function The ASIN numeric function returns the angle of the given sine.
Syntax
ASIN
( NumericExpression
)
The ASIN function returns the angle, in radians, whose sine is the given NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
ATAN function The ATAN numeric function returns the angle of the given tangent.
Syntax
ATAN
( NumericExpression
)
The ATAN function returns the angle, in radians, whose tangent is the given NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
ATAN2 function The ATAN2 numeric function returns the angle subtended in a right angled triangle between an opposite and the base.
ESQL reference
1607
Syntax
ATAN2 (
OppositeNumericExpression
,
BaseNumericExpression
)
The ATAN2 function returns the angle, in radians, subtended (in a right angled triangle) by an opposite given by OppositeNumericExpression and the base given by BaseNumericExpression. The parameters can be any built-in numeric data type. The result is FLOAT unless either parameter is NULL, in which case the result is NULL
BITAND function The BITAND numeric function performs a bitwise AND on the binary representation of two or more numbers.
Syntax
, BITAND (
source_integer
, source_integer
)
BITAND takes two or more integer values and returns the result of performing the bitwise AND on the binary representation of the numbers. The result is INTEGER unless either parameter is NULL, in which case the result is NULL. For example: BITAND(12, 7)
returns 4 as shown by this worked example: Binary Decimal 1100 12 AND 0111 7 _________ 0100 4
BITNOT function The BITNOT numeric function performs a bitwise complement on the binary representation of a number.
Syntax
BITNOT (
1608
Message Flows
source_integer
)
BITNOT takes an integer value and returns the result of performing the bitwise complement on the binary representation of the number. The result is INTEGER unless either parameter is NULL, in which case the result is NULL. For example: BITNOT(7)
returns -8, as shown by this worked example: Binary Decimal 00...0111 7 NOT _________ 11...1000 -8
BITOR function The BITOR numeric function performs a bitwise OR on the binary representation of two or more numbers.
Syntax
, BITOR (
source_integer
source_integer
,
)
BITOR takes two or more integer values and returns the result of performing the bitwise OR on the binary representation of the numbers. The result is INTEGER unless either parameter is NULL, in which case the result is NULL. For example: BITOR(12, 7)
returns 15, as shown by this worked example: Binary Decimal 1100 12 OR 0111 7 _________ 1111 15
BITXOR function The BITXOR numeric function performs a bitwise XOR on the binary representation of two or more numbers.
Syntax
, BITXOR (
source_integer
, source_integer
)
ESQL reference
1609
BITXOR takes two or more integer values and returns the result of performing the bitwise XOR on the binary representation of the numbers. The result is INTEGER unless either parameter is NULL, in which case the result is NULL. For example: BITXOR(12, 7)
returns 11, as shown by this worked example: Binary Decimal 1100 12 XOR 0111 7 _________ 1011 11
CEIL and CEILING functions The CEIL and CEILING numeric functions return the smallest integer equivalent of a decimal number.
Syntax
CEIL CEILING
( source_number
)
CEIL and CEILING return the smallest integer value greater than or equal to source_number. The parameter can be any numeric data type. The result is of the same type as the parameter unless it is NULL, in which case the result is NULL. For example: CEIL(1)
returns 1 CEIL(1.2)
returns 2.0 CEIL(-1.2)
returns -1.0 If possible, the scale is changed to zero. If the result cannot be represented at that scale, it is made sufficiently large to represent the number.
COS function The COS numeric function returns the cosine of a given angle.
Syntax
COS
1610
Message Flows
( NumericExpression
)
The COS function returns the cosine of the angle, in radians, given by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
COSH function The COSH numeric function returns the hyperbolic cosine of a given angle.
Syntax
COSH
( NumericExpression
)
The COSH function returns the hyperbolic cosine of the angle, in radians, given by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
COT function The COT numeric function returns the cotangent of a given angle.
Syntax
COT
( NumericExpression
)
The COT function returns the cotangent of the angle, in radians, given by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
DEGREES function The DEGREES numeric function returns the angle of the radians supplied.
Syntax
DEGREES
(
NumericExpression
)
The DEGREES function returns the angle, in degrees, specified by NumericExpression in radians. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
EXP function The EXP numeric function returns the exponential value of a given number.
ESQL reference
1611
Syntax
EXP
( NumericExpression
)
The EXP function returns the exponential of the value specified by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
FLOOR function The FLOOR numeric function returns the largest integer equivalent to a given decimal number.
Syntax
FLOOR (
source_number
)
FLOOR returns the largest integer value less than or equal to source_number. The parameter can be any numeric data type. The result is of the same type as the parameter unless it is NULL, in which case the result is NULL. For example: FLOOR(1)
returns 1 FLOOR(1.2)
returns 1.0 FLOOR(-1.2)
returns -2.0 If possible, the scale is changed to zero. If the result cannot be represented at that scale, it is made sufficiently large to represent the number.
LN and LOG functions The LN and LOG equivalent numeric functions return the natural logarithm of a given value.
Syntax
1612
Message Flows
LN LOG
( NumericExpression
)
The LN and LOG functions return the natural logarithm of the value specified by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
LOG10 function The LOG10 numeric function returns the logarithm to base 10 of a given value.
Syntax
LOG10
(
NumericExpression
)
The LOG10 function returns the logarithm to base 10 of the value specified by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
MOD function The MOD numeric function returns the remainder when dividing two numbers.
Syntax
MOD
( dividend
,
divisor
)
MOD returns the remainder when the first parameter is divided by the second parameter. The result is negative only if the first parameter is negative. Parameters must be integers. The function returns an integer. If any parameter is NULL, the result is NULL. For example: MOD(7, 3)
returns 1 MOD(-7, 3)
returns -1 MOD(7, -3)
returns 1 MOD(6, 3)
returns 0
POWER function The POWER numeric function raises a value to the power supplied.
ESQL reference
1613
Syntax
POWER (
ValueNumericExpression
,
PowerNumericExpression
)
POWER returns the given value raised to the given power. The parameters can be any built-in numeric data type. The result is FLOAT unless any parameter is NULL, in which case the result is NULL An exception occurs, if the value is either: v Zero and the power is negative, or v Negative and the power is not an integer
RADIANS function The RADIANS numeric function returns a given radians angle in degrees.
Syntax
RADIANS
(
NumericExpression
)
The RADIANS function returns the angle, in radians, specified by NumericExpression in degrees. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
RAND function The RAND numeric function returns a pseudo random number.
Syntax
RAND
(
)
IntegerExpression
The RAND function returns a pseudo random number in the range 0.0 to 1.0. If supplied, the parameter initializes the pseudo random sequence. The parameter can be of any numeric data type, but any fractional part is ignored. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
ROUND function The ROUND numeric function rounds a supplied value to a given number of places.
1614
Message Flows
Syntax
ROUND (
source_number
,
precision
(1) MODE
RoundingMode
)
RoundingMode: ROUND_UP ROUND_DOWN ROUND_CEILING ROUND_FLOOR ROUND_HALF_UP ROUND_HALF_EVEN ROUND_HALF_DOWN
Notes: 1
If you do not specify MODE, a value of ROUND_HALF_EVEN is used.
If precision is a positive number, source_number is rounded to precision places right of the decimal point. If precision is negative, the result is source_number rounded to the absolute value of precision places to the left of the decimal point. source_number can be any built-in numeric data type; precision must be an integer. The result is of the same data type as the source_number parameter unless source_number is NULL, in which case the result is NULL. This means that the result of the function is: v INTEGER if source_number is INTEGER v FLOAT if source_number is FLOAT v DECIMAL if source_number is DECIMAL When rounding, the banker’s or half-even symmetric rounding rules are used by default, unless a RoundingMode is specified.
RoundingMode RoundingMode can take one of the following values: ROUND_UP Round away from zero. Always increments the digit prior to a nonzero discarded fraction. This rounding mode never decreases the magnitude of the calculated value. ROUND_DOWN Round towards zero. Never increments the digit prior to a discarded fraction, that is, truncates. This rounding mode never increases the magnitude of the calculated value. ROUND_CEILING Round towards positive infinity. If the decimal is positive, behaves as for ESQL reference
1615
ROUND_UP; if negative, behaves as for ROUND_DOWN. This rounding mode never decreases the calculated value. ROUND_FLOOR Round towards negative infinity. If the decimal is positive, behaves as for ROUND_DOWN; if negative, behaves as for ROUND_UP. This rounding mode never increases the calculated value. ROUND_HALF_UP Round towards ″nearest neighbor″ unless both neighbors are equidistant, in which case round up. Behaves as for ROUND_UP if the discarded fraction is greater than, or equal to, 0.5; otherwise, behaves as for ROUND_DOWN. This is the rounding mode that is typically taught in schools. ROUND_HALF_DOWN Round towards ″nearest neighbor″ unless both neighbors are equidistant, in which case round down. Behaves as for ROUND_UP if the discarded fraction is grater than 0.5; otherwise, behaves as for ROUND_DOWN. ROUND_HALF_EVEN Round towards the ″nearest neighbor″ unless both neighbors are equidistant, in which case, round towards the even neighbor. Behaves as for ROUND_HALF_UP if the digit to the left of the discarded fraction is odd; behaves as for ROUND_HALF_DOWN if it is even. This is the rounding mode that minimizes cumulative error when applied repeatedly over a sequence of calculations, and is sometimes referred to as Banker’s rounding. The following table gives a summary of rounding operations, with a precision of zero, under different rounding modes. Input number
ROUND UP
ROUND DOWN
ROUND CEILING
ROUND FLOOR
ROUND HALF UP
ROUND HALF DOWN
ROUND HALF EVEN
5.5
6
5
6
5
6
5
6
2.5
3
2
3
2
3
2
2
1.6
2
1
2
1
2
2
2
1.1
2
1
2
1
1
1
1
1.0
1
1
1
1
1
1
1
-1.0
-1
-1
-1
-1
-1
-1
-1
-1.1
-2
-1
-1
-2
-1
-1
-1
-1.6
-2
-1
-1
-2
-2
-2
-2
-2.5
-3
-2
-2
-3
-3
-2
-2
-5.5
-6
-5
-5
-6
-6
-5
-6
Examples using the default rounding mode (ROUND_HALF_EVEN): ROUND(27.75, 2)
returns 27.75 ROUND(27.75, 1)
returns 27.8 ROUND(27.75, 0)
1616
Message Flows
returns 28 ROUND(27.75, -1)
returns 30 Examples using a rounding mode with a precision of zero: ROUND(5.5, 0 MODE ROUND_UP);
returns 6 ROUND(5.5, 0 MODE ROUND_DOWN);
returns 5 ROUND(5.5, 0 MODE ROUND_CEILING);
returns 6 ROUND(5.5, 0 MODE ROUND_FLOOR);
returns 5 ROUND(5.5, 0 MODE ROUND_HALF_UP);
returns 6 ROUND(5.5, 0 MODE ROUND_HALF_DOWN);
returns 5 ROUND(5.5, 0 MODE ROUND_HALF_EVEN);
returns 6 ROUND(2.5, 0 MODE ROUND_UP);
returns 3 ROUND(2.5, 0 MODE ROUND_DOWN);
returns 2 ROUND(2.5, 0 MODE ROUND_CEILING);
returns 3 ROUND(2.5, 0 MODE ROUND_FLOOR);
returns 2 ROUND(2.5, 0 MODE ROUND_HALF_UP);
returns 3 ROUND(2.5, 0 MODE ROUND_HALF_DOWN);
returns 2 ROUND(2.5, 0 MODE ROUND_HALF_EVEN);
returns 3 If possible, the scale is changed to the given value. If the result cannot be represented within the given scale, it is INFINITY.
ESQL reference
1617
SIGN function The SIGN numeric function tells you whether a given number is positive, negative, or zero.
Syntax
SIGN
( NumericExpression
)
The SIGN function returns -1, 0, or +1 when the NumericExpression value is negative, zero, or positive respectively. The parameter can be any built-in numeric data type and the result is of the same type as the parameter. If the parameter is NULL, the result is NULL
SIN function The SIN numeric function returns the sine of a given angle.
Syntax
SIN
( NumericExpression
)
The SIN function returns the sine of the angle, in radians, given by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
SINH function The SINH numeric function returns the hyperbolic sine of a given angle.
Syntax
SINH
( NumericExpression
)
The SINH function returns the hyperbolic sine of the angle, in radians, given by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
SQRT function The SQRT numeric function returns the square root of a given number.
1618
Message Flows
Syntax
SQRT
( source_number
)
SQRT returns the square root of source_number. The parameter can be any built-in numeric data type. The result is a FLOAT. If the parameter is NULL, the result is NULL. For example: SQRT(4)
returns 2E+1 SQRT(2)
returns 1.414213562373095E+0 SQRT(-1)
throws an exception.
TAN function The TAN numeric function returns the tangent of a given angle.
Syntax
TAN
( NumericExpression
)
The TAN function returns the tangent of the angle, in radians, given by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
TANH function The TANH numeric function returns the hyperbolic tangent of an angle.
Syntax
TANH
( NumericExpression
)
The TANH function returns the hyperbolic tangent of the angle, in radians, given by NumericExpression. The parameter can be any built-in numeric data type. The result is FLOAT unless the parameter is NULL, in which case the result is NULL.
ESQL reference
1619
TRUNCATE function The TRUNCATE numeric function truncates a supplied decimal number a specified number of places.
Syntax
TRUNCATE (
source_number
,
precision
)
If precision is positive, the result of the TRUNCATE function is source_number truncated to precision places right of the decimal point. If precision is negative, the result is source_number truncated to the absolute value of precision places to the left of the decimal point. source_number can be any built-in numeric data type. precision must evaluate to an INTEGER. The result is of the same data type as source_number. If any parameter is NULL, the result is NULL. For example: TRUNCATE(27.75, 2)
returns 27.75 TRUNCATE(27.75, 1)
returns 27.7 TRUNCATE(27.75, 0)
returns 27.0 TRUNCATE(27.75, -1)
returns 20.0 If possible, the scale is changed to the given value. If the result cannot be represented within the given scale, it is INF.
ESQL string manipulation functions A list of the ESQL string manipulation functions that you can use. Most of the following functions manipulate all string data types (BIT, BLOB, and CHARACTER). Exceptions to this are UPPER, LOWER, LCASE, UCASE, and SPACE, which operate only on character strings. In these descriptions, the term singleton refers to a single part (BIT, BLOB, or CHARACTER) within a string of that type. In addition to the functions that are described here, you can use the logical OR operator to perform various calculations on ESQL string manipulation values. To concatenate two strings, use the “ESQL string operator” on page 1506. This section covers the following topics:
1620
Message Flows
|
“CONTAINS function”
|
“ENDSWITH function” on page 1622 “LEFT function” on page 1622 “LENGTH function” on page 1622 “LOWER and LCASE functions” on page 1623 “LTRIM function” on page 1623 “OVERLAY function” on page 1624 “POSITION function” on page 1625 “REPLACE function” on page 1626 “REPLICATE function” on page 1626 “RIGHT function” on page 1627 “RTRIM function” on page 1627 “SPACE function” on page 1628
|
“STARTSWITH function” on page 1628 “SUBSTRING function” on page 1629 “TRANSLATE function” on page 1630 “TRIM function” on page 1631 “UPPER and UCASE functions” on page 1632
| | | |
CONTAINS function
| |
Syntax
| | ||
CONTAINS is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER), and returns a Boolean value to indicate whether one string is present within another.
CONTAINS (
SourceExpression
,
SearchExpression
)
| |
CONTAINS returns TRUE if the SearchExpression is present within the SourceExpression, otherwise it returns FALSE.
| |
The parameter strings for both SourceExpression and SearchExpression can be of the CHARACTER, BLOB, or BIT data type, but must be of the same data type.
|
If any parameter is NULL, the result is NULL.
| |
Examples
| |
returns TRUE.
|
returns FALSE.
CONTAINS('Hello World!', 'ello');
CONTAINS('Hello World!', 'daisy');
ESQL reference
1621
| | | |
ENDSWITH function
| |
Syntax
ENDSWITH is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER), and returns a Boolean value to indicate whether one string ends with another.
| | ||
ENDSWITH (
SourceExpression
,
SearchExpression
)
| |
ENDSWITH returns TRUE if SourceExpression ends with SearchExpression, otherwise it returns FALSE.
| |
The parameter strings for both SearchExpression and SourceExpression can be of the CHARACTER, BLOB, or BIT data type, but must be of the same data type.
|
If any parameter is NULL, the result is NULL.
| |
Examples
| |
returns TRUE.
|
returns FALSE.
ENDSWITH('Hello World!', 'World!');
ENDSWITH('Hello World!', 'World');
LEFT function LEFT is a string manipulation function that returns a string consisting of the source string truncated to the length given by the length expression.
Syntax
LEFT
( source_string
,
LengthIntegerExpression
)
The source string can be of the CHARACTER, BLOB or BIT data type and the length must be of type INTEGER. The truncation discards the final characters of the source_string The result is of the same type as the source string. If the length is negative or zero, a zero length string is returned. If either parameter is NULL, the result is NULL
LENGTH function The LENGTH function is used for string manipulation on all string data types (BIT, BLOB, and CHARACTER) and returns an integer value giving the number of singletons in source_string.
1622
Message Flows
Syntax
LENGTH (
source_string
)
It If the source_string is NULL, the result is the NULL value. The term singleton refers to a single part (BIT, BYTE, or CHARACTER) within a string of that type. For example: LENGTH('Hello World!');
returns 12. LENGTH('');
returns 0.
LOWER and LCASE functions The LOWER and LCASE functions are equivalent, and manipulate CHARACTER string data; they both return a new character string, which is identical to source_string, except that all uppercase letters are replaced with the corresponding lowercase letters.
Syntax
LOWER LCASE
(
source_string
)
For example: LOWER('Mr Smith')
returns 'mr smith'. LOWER('22 Railway Cuttings')
returns '22 railway cuttings'. LCASE('ABCD')
returns 'abcd'.
LTRIM function LTRIM is a string manipulation function, used for manipulating all data types (BIT, BLOB, and CHARACTER), that returns a character string value of the same data type and content as source_string, but with any leading default singletons removed.
ESQL reference
1623
Syntax
LTRIM (
source_string
)
The term singleton is used to refer to a single part (BIT, BLOB, or CHARACTER) within a string of that type. The LTRIM function is equivalent to TRIM(LEADING FROM source_string). If the parameter is NULL, the result is NULL. The default singleton depends on the data type of source_string: Table 302. Character
’ ’ (space)
BLOB
X’00’
Bit
B’0’
OVERLAY function OVERLAY is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER) and replaces part of a string with a substring.
Syntax
OVERLAY (
FROM
source_string
PLACING
source_string2
start_position
) FOR
string_length
OVERLAY returns a new string of the same type as the source and is identical to source_string, except that a given substring in the string, starting from the specified numeric position and of the given length, has been replaced by source_string2. When the length of the substring is zero, nothing is replaced. For example: OVERLAY ('ABCDEFGHIJ' PLACING '1234' FROM 4 FOR 3)
returns the string 'ABC1234GHIJ' If any parameter is NULL, the result is NULL. If string_length is not specified, it is assumed to be equal to LENGTH(source_string2). The result of the OVERLAY function is equivalent to: SUBSTRING(source_string FROM 1 FOR start_position -1 ) || source_string2 || SUBSTRING(source_string FROM start_position + string_length)
1624
Message Flows
where || is the concatenation operator.
POSITION function POSITION is a string manipulation function that manipulates all data types (BIT, BLOB, and CHARACTER), and returns the position of one string within another.
Syntax
POSITION ( SearchExpression IN SourceExpression
FROM FromExpression
)
REPEAT RepeatExpression
POSITION returns an integer giving the position of one string (SearchExpression) in a second string (SourceExpression). A position of one corresponds to the first character of the source string. If present, the FROM clause gives a position within the search string at which the search commences. In the absence of a FROM clause, the source string is searched from the beginning. If present, the REPEAT clause gives a repeat count, returning the position returned to be that of the nth occurrence of the search string within the source string. If the repeat count is negative, the source string is searched from the end. In the absence of a REPEAT clause, a repeat count of +1 is assumed; that is, the position of the first occurrence, searching from the beginning is returned. If the search string has a length of zero, the result is one. If the search string cannot be found, the result is zero: if the FROM clause is present, this applies only to the section of the source string being searched; if the REPEAT clause is present this applies only if there are insufficient occurrences of the string. If any parameter is NULL, the result is NULL. The search and source strings can be of the CHARACTER, BLOB, or BIT data types but they must be of the same type. For example: POSITION('Village' IN 'Hursley Village'); returns 9 POSITION('Town' IN 'Hursley Village'); returns 0 POSITION ('B' IN 'ABCABCABCABCABC'); -> returns 2 POSITION ('D' IN 'ABCABCABCABCABC'); -> returns 0 POSITION ('A' IN 'ABCABCABCABCABC' FROM 4); -> returns 4 POSITION ('C' IN 'ABCABCABCABCABC' FROM 2); -> returns 3 POSITION ('B' IN 'ABCABCABCABCABC' REPEAT 2); -> returns 5 POSITION ('C' IN 'ABCABCABCABCABC' REPEAT 4); -> returns 12 POSITION ('A' IN 'ABCABCABCABCABC' FROM 4 REPEAT 2); -> returns 7 POSITION ('AB' IN 'ABCABCABCABCABC' FROM 2 REPEAT 3); -> returns 10 ESQL reference
1625
POSITION ('A' IN 'ABCABCABCABCABC' REPEAT -2); -> returns 10 POSITION ('BC' IN 'ABCABCABCABCABC' FROM 2 REPEAT -3); -> returns 5
REPLACE function REPLACE is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER), and replaces parts of a string with supplied substrings.
Syntax
REPLACE
( SourceStringExpression , SearchStringExpression
)
ReplaceStringExpression
REPLACE returns a string consisting of the source string, with each occurrence of the search string replaced by the replace string. The parameter strings can be of the CHARACTER, BLOB, or BIT data types, but all three must be of the same type. If any parameter is NULL, the result is NULL. The search process is single pass from the left and disregards characters that have already been matched. If you do not specify the replace string expression, the replace string uses the default value of an empty string, and the behavior of the function is to delete all occurrences of the search string from the result. The following examples give the results shown: REPLACE('ABCDABCDABCDA', 'A', 'AA') -- RESULT = AABCDAABCDAABCDAA
The above example shows that replacement is single pass. Each occurrence of A is replaced by AA but these are not then expanded further. REPLACE('AAAABCDEFGHAAAABCDEFGH', 'AA', 'A') -- RESULT = AABCDEFGHAABCDEFGH
This example shows that after characters are matched, they are not considered further. Each occurrence of AA is replaced by A. The resulting AA pairs are not matched. REPLACE('AAAAABCDEFGHAAAABCDEFGH', 'AA', 'XYZ') -- RESULT = XYZXYZABCDEFGHXYZXYZBCDEFGH
This last example shows that matching is from the left. The first four As are matched as two pairs and replaced. The fifth A is not matched.
REPLICATE function REPLICATE is a string manipulation function that manipulates all data types (BIT, BLOB, and CHARACTER) and returns a string made up of multiple copies of a supplied string.
1626
Message Flows
Syntax
REPLICATE (
PatternStringExpression
,
CountNumericExpression
)
REPLICATE returns a string consisting of the pattern string given by PatternStringExpression repeated the number of times given by CountNumericExpression. The pattern string can be of the CHARACTER, BLOB, or BIT datatype and the count must be of type INTEGER. The result is of the same data type as the pattern string. If the count is negative or zero, a zero length string is returned. If either parameter is NULL, the result is NULL. The count is limited to 32*1024*1024 to protect the broker from erroneous programs. If this limit is exceeded, an exception condition is issued.
RIGHT function RIGHT is a string manipulation function that manipulates all data types (BIT, BLOB, and CHARACTER), and truncates a string.
Syntax
RIGHT (
SourceStringExpression
, LengthIntegerExpression
)
RIGHT returns a string consisting of the source string truncated to the length given by the length expression. The truncation discards the initial characters of the source string. The source string can be of the CHARACTER, BLOB, or BIT data type and the length must be of type INTEGER. If the length is negative or zero, a zero length string is returned. If either parameter is NULL, the result is NULL
RTRIM function RTRIM is a string manipulation function that manipulates all data types (BIT, BLOB, and CHARACTER), and removes trailing singletons from a string.
Syntax
RTRIM (
source_string
)
ESQL reference
1627
RTRIM returns a string value of the same data type and content as source_string but with any trailing default singletons removed. The term singleton refers to a single part (BIT, BLOB, or CHARACTER) within a string of that type. The RTRIM function is equivalent to TRIM(TRAILING FROM source_string). If the parameter is NULL, the result is NULL. The default singleton depends on the data type of source_string: Character
’ ’ (space)
BLOB
X’00’
Bit
B’0’
SPACE function SPACE is a string manipulation function that manipulates all data types (BIT, BLOB, and CHARACTER), and creates a string consisting of a defined number of blank spaces.
Syntax
SPACE
(
NumericExpression
)
SPACE returns a character string consisting of the number of blank spaces given by NumericExpression. The parameter must be of type INTEGER; the result is of type CHARACTER. If the parameter is negative or zero, a zero length character string is returned. If the parameter is NULL, the result is NULL. The string is limited to 32*1024*1024 to protect the broker from erroneous programs. If this limit is exceeded, an exception condition is issued. | | | |
STARTSWITH function
| |
Syntax
STARTSWITH is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER), and returns a Boolean value to indicate whether one string begins with another.
| | ||
STARTSWITH (
SourceExpression
, SearchExpression
)
STARTSWITH returns TRUE if SourceExpression begins with SearchExpression, otherwise it returns FALSE.
| |
1628
Message Flows
| |
The parameter strings for both SearchExpression and SourceExpression can be of the CHARACTER, BLOB, or BIT data type, but must be of the same data type.
|
If any parameter is NULL, the result is NULL.
| |
Examples
| |
returns TRUE.
|
returns FALSE.
STARTSWITH('Hello World!', 'Hello');
STARTSWITH('Hello World!', 'World');
SUBSTRING function SUBSTRING is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER), and extracts characters from a string to create another string. | |
Syntax
| |
SUBSTRING (
| | |
SourceExpression
FROM StartPosition BEFORE BeforeExpression AFTER AfterExpression
) FOR
StringLength
|
Parameters must be of the following types: v SourceExpression, BeforeExpression, and AfterExpression can be BIT, BLOB, or CHARACTER. v StartPosition and StringLength can be INTEGER only.
|
StartPosition
| | | | | | |
If you specify StartPosition, SUBSTRING returns a new string of the same type as SourceExpression containing one contiguous sequence of characters that are extracted from SourceExpression, as specified by StartPosition and StringLength. If you do not specify StringLength, the sequence runs from StartPosition until the end of SourceExpression. The StartPosition can be negative, and together, the StartPosition and StringLength define a range. The result is the overlap between this range and the SourceExpression; the StringLength cannot be less than the StartPosition.
|
BeforeExpression
| | | | | | | |
If you specify BeforeExpression, SUBSTRING returns a new string of the same type as SourceExpression containing one contiguous sequence of characters that are extracted from StringLength characters before the first occurrence of BeforeExpression within SourceExpression, up to (but not including) the first character of the first occurrence of BeforeExpression. If you do not specify StringLength, the sequence of characters is taken from the beginning of SourceExpression up to (but not including) the first character of the first occurrence of BeforeExpression. If the BeforeExpression string does not occur in SourceExpression, an empty (zero length) string is returned.
| | |
ESQL reference
1629
|
The BeforeExpression string must be of the same data type as SourceExpression.
|
AfterExpression
| | | | | |
If you specify AfterExpression, SUBSTRING returns a new string of the same type as SourceExpression, containing one contiguous sequence of characters that are extracted from SourceExpression, beginning with the first character after the end of the first occurrence of AfterExpression until the end of SourceExpression (or StringLength characters, if specified). If the AfterExpression string does not occur in SourceExpression, an empty (zero length) string is returned.
|
The AfterExpression string must be of the same data type as SourceExpression.
|
If any parameter is NULL, the result is NULL. This is not a zero length string. Examples: SUBSTRING('Hello World!' FROM 7 FOR 4)
returns 'Worl'. |
SUBSTRING('Hello World!' BEFORE 'World');
| |
returns 'Hello '.
| |
returns 'lo '.
| |
returns 'H'.
| |
returns '!'.
| |
returns 'or'.
|
returns ''.
SUBSTRING('Hello World!' BEFORE 'World' FOR 3);
SUBSTRING('Hello World!' BEFORE 'e');
SUBSTRING('Hello World!' AFTER 'World');
SUBSTRING('Hello World!' AFTER 'W' FOR 2);
SUBSTRING('Hello World!' AFTER 'P');
TRANSLATE function TRANSLATE is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER), and replaces specified characters in a string.
Syntax
TRANSLATE ( SourceStringExpression , SearchStringExpression
)
ReplaceStringExpression
TRANSLATE returns a string consisting of the source string, with each occurrence of any character that occurs in the search string being replaced by the corresponding character from the replace string.
1630
Message Flows
The parameter strings can be of the CHARACTER, BLOB, or BIT data type but all three must be of the same type. If any parameter is NULL, the result is NULL. If the replace string is shorter than the search string, there are characters in the search string for which there is no corresponding character in the replace string. This is treated as an instruction to delete these characters and any occurrences of these characters in the source string are absent from the returned string If the replace string expression is not specified, the replace string is assumed to be an empty string, and the function deletes all occurrences of any characters in the search string from the result.
TRIM function TRIM is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER), and removes trailing and leading singletons from a string.
Syntax
TRIM
(
trim_singleton BOTH LEADING TRAILING
FROM
trim_singleton
source_string )
TRIM returns a new string of the same type as source_string, in which the leading, trailing, or both leading and trailing singletons have been removed. The term singleton refers to a single part (BIT, BYTE, or CHARACTER) within a string of that type. If trim_singleton is not specified, a default singleton is assumed. The default singleton depends on the data type of source_string: Character
’ ’ (space)
BLOB
X’00’
Bit
B’0’
If any parameter is NULL, the result is NULL. It is often unnecessary to strip trailing blanks from character strings before comparison, because the rules of character string comparison mean that trailing blanks are not significant. The following examples illustrate the behavior of the TRIM function: TRIM(TRAILING 'b' FROM 'aaabBb')
returns 'aaabB'. TRIM('
a
') ESQL reference
1631
returns 'a'. TRIM(LEADING FROM '
a
')
returns 'a '. TRIM('b' FROM 'bbbaaabbb')
returns 'aaa'.
UPPER and UCASE functions UPPER and UCASE are equivalent string manipulation functions that manipulate CHARACTER string data and convert lowercase characters in a string to uppercase.
Syntax
UPPER UCASE
(
source_string
)
UPPER and UCASE both return a new character string, which is identical to source_string, except that all lowercase letters are replaced with the corresponding uppercase letters. For example: UPPER('ABCD')
returns 'ABCD'. UCASE('abc123')
returns 'ABC123'. Converting characters from different code pages to uppercase If you are using certain code pages, characters with no uppercase equivalent in your code page might be converted when you use the UPPER or UCASE function. This conversion happens because the bitstream is converted to a Unicode message tree by the message parser. Even though characters might have no uppercase equivalent in the source code page, they can still have an uppercase equivalent in the Unicode code page, and are converted by the UPPER or UCASE function. When the bitstream is converted back to the original code page, these characters cannot be converted back, and a substitution character is inserted into the output message for each character. The substitution character inserted depends on the original code page. For example, conversion to an EBCDIC code page inserts an X’3F’ byte and conversion to a Japanese code page inserts an X’7F’ byte. A solution to this problem is to use the TRANSLATE function to convert selected characters to uppercase, instead of using the UPPER or UCASE function. Any characters that have no uppercase equivalent in the code page are excluded from the conversion. In the following example, the input message is in code page 284, and the InputRoot.XML.MSG.APPDATA element contains characters that do not have an upper
1632
Message Flows
case equivalent in code page 284, but do have upper case equivalents in the Unicode code page. The TRANSLATE function is used to convert only the lowercase characters ’a’ to ’z’ to their equivalent uppercase characters. Any other characters in InputRoot.XML.MSG.APPDATA are excluded from the conversion. DECLARE char1 CHAR; SET char1 = TRANSLATE(InputRoot.XML.MSG.APPDATA,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'); SET OutputRoot.MQMD.CodedCharSetId = 284; SET OutputRoot.XML.TEST.translated = char1;
ESQL field functions This topic lists the ESQL field functions and covers the following: “ASBITSTREAM function” “BITSTREAM function (deprecated)” on page 1637 “FIELDNAME function” on page 1637 “FIELDNAMESPACE function” on page 1638 “FIELDTYPE function” on page 1638 “FIELDVALUE function” on page 1641 “FOR function” on page 1641 “LASTMOVE function” on page 1643 “SAMEFIELD function” on page 1643
ASBITSTREAM function The ASBITSTREAM field function generates a bit stream for the subtree of a given field according to the rules of the parser that owns the field. The ASBITSTREAM field function uses parameters supplied by the caller for: v v v v v v
Encoding CCSID Message set Message type Message format Options
The ASBITSTREAM function removes the limitation of the existing BITSTREAM function, which can be used only on a tree produced by a parser that belongs to an input node. The BITSTREAM function is retained only for compatibility with earlier versions.
ESQL reference
1633
Syntax
ASBITSTREAM (
FieldReference
)
<<
OPTIONS expression ENCODING expression CCSID expression SET expression TYPE expression FORMAT expression
Note that each clause can occur once only. ASBITSTREAM returns a value of type BLOB that contains a bitstream representation of the field that is pointed to by FieldReference and its children. The algorithm for doing this varies from parser to parser, and according to the options specified. All parsers support the following modes: v RootBitStream, in which the algorithm that generates the bit stream is the same as the algorithm that is used by an output node. In this mode, a meaningful result is obtained only if the field pointed to is at the head of a subtree with an appropriate structure. v EmbeddedBitStream, in which not only is the algorithm that generates the bit stream is the same as the algorithm that is used by an output node, but also the – Encoding – CCSID – Message set – Message type – Message format are determined, if not explicitly specified, in the same way as the output node. That is, they are determined by searching the previous siblings of FieldReference on the assumption that they represent headers. In this way, the algorithm for determining these properties is essentially the same as that used for the BITSTREAM function. Some parsers also support another mode, FolderBitStream, which generates a meaningful bit stream for any subtree, provided that the field that is pointed to represents a folder. In all cases, the bit stream obtained can be given to a CREATE statement with a PARSE clause, using the same DOMAIN and OPTIONS to reproduce the original subtree. When the function is called, any clause expressions are evaluated. An exception is thrown if any of the expressions do not result in a value of the appropriate type.
1634
Message Flows
If any parameter is NULL the result is NULL. Clause
Type
Default value
OPTIONS
Integer
RootBitStream & ValidateNone
ENCODING
Integer
0
CCSID
Integer
0
SET
Character
Zero length string
TYPE
Character
Zero length string
FORMAT
Character
Zero length string
For details of the syntax of the TYPE clause, refer to Specifying namespaces in the Message Type property. Although the OPTIONS clause accepts any expression that returns a value of type integer, it is only meaningful to generate option values from the list of supplied constants, using the BITOR function if more than one option is required. The generated value becomes an integer and can be saved in a variable, passed as a parameter to a function, or used directly in an ASBITSTREAM call. The list of globally-defined constants is: Validate master options... ValidateContentAndValue ValidateValue -- Can be used with ValidateContent ValidateContent -- Can be used with ValidateValue ValidateNone Validate failure action options... ValidateException ValidateExceptionList ValidateLocalError ValidateUserTrace Validate value constraints options... ValidateFullConstraints ValidateBasicConstraints Validate fix up options... ValidateFullFixUp ValidateNoFixUp
Notes: 1. The validateFullFixUp option is reserved for future use. Selecting validateFullFixUp gives identical behaviour to validateNoFixUp. 2. The validateFullConstraints option is reserved for future use. Selecting validateFullConstraints gives identical behaviour to validateBasicConstraints. 3. For full details of the validation options, refer to “Validation properties” on page 1385. C and Java equivalent APIs Note that equivalent options are not available on: v The Java plugin node API MBElement methods createElementAsLastChildFromBitstream() and toBitstream()
ESQL reference
1635
v The C plugin node API methods cniCreateElementAsLastChildFromBitstream() and cniElementAsBitstream. Only one option from each group can be specified, with the exception of ValidateValue and ValidateContent, which can be used together to obtain the content and value validation. If you do not specify an option within a group, the option in bold is used. The ENCODING clause accepts any expression that returns a value of type integer. However, it is only meaningful to generate encoding values from the list of supplied constants: 0 MQENC_INTEGER_NORMAL MQENC_INTEGER_REVERSED MQENC_DECIMAL_NORMAL MQENC_DECIMAL_REVERSED MQENC_FLOAT_IEEE_NORMAL MQENC_FLOAT_IEEE_REVERSED MQENC_FLOAT_S390
0 uses the queue manager’s encoding. The values that are used for the CCSID clause follow the normal numbering system. For example, 1200 = UCS-2, 1208 = UTF-8. In addition the special values 0 and -1 are supported: v 0 uses the queue manager’s CCSID v -1 uses the CCSID’s as determined by the parser itself. This value is reserved. For absent clauses, the given default values are used. Use the CCSID and encoding default values, because they take their values from the queue manager’s encoding and CCSID settings. Similarly, use the default values for each of the message set, type, and format options, because many parsers do not require message set, type, or format information; any valid value is sufficient. When any expressions have been evaluated, the appropriate bit stream is generated. Note: Because this function has a large number of clauses, an alternative syntax is supported in which the parameters are supplied as a comma-separated list rather than by named clauses. In this case, the expressions must be in the following order: ENCODING -> CCSID -> SET -> TYPE -> FORMAT -> OPTIONS
The list can be truncated at any point and you can use an empty expression for any clauses for which you do not supply a value.
Examples DECLARE options INTEGER BITOR(FolderBitStream, ValidateContent, ValidateValue); SET result = ASBITSTREAM(cursor OPTIONS options CCSID 1208); SET Result = ASBITSTREAM(Environment.Variables.MQRFH2.Data,,1208 ,,,,options);
1636
Message Flows
BITSTREAM function (deprecated) The BITSTREAM field function returns a value that represents the bit stream that is described by the given field and its children. Its use is deprecated; use the newer ASBITSTREAM function instead. The BITSTREAM function can be used only on a tree produced by a parser belonging to an input node. The ASBITSTREAM function does not suffer from this limitation.
Syntax
BITSTREAM (
field_reference
)
The BITSTREAM function returns a value of type BLOB that represents the bit stream that is described by the given field and its children. For incoming messages, the appropriate portion of the incoming bit stream is used. For messages that are constructed by Compute nodes, the following algorithm is used to establish the ENCODING, CCSID, message set, message type, and message format: v If the addressed field has a previous sibling, and this sibling is the root of a subtree that belongs to a parser capable of providing an ENCODING and CCSID, these values are obtained and used to generate the requested bit stream. Otherwise, the broker’s default ENCODING and CCSID (that is, those of its queue manager) are used. v Similarly, if the addressed field has a previous sibling, and this sibling is the root of a subtree that belongs to a parser capable of providing a message set, message type, and message format, these values are obtained and used to generate the requested bit stream. Otherwise, zero length strings are used. This function is typically used for message warehouse scenarios, where the bit stream of a message needs to be stored in a database. The function returns the bit stream of the physical portion of the incoming message, identified by the parameter. In some cases, it does not return the bit stream that represents the actual field identified. For example, the following two calls return the same value: BITSTREAM(Root.MQMD); BITSTREAM(Root.MQMD.UserIdentifier);
because they lie in the same portion of the message.
FIELDNAME function The FIELDNAME field function returns the name of a given field.
Syntax
FIELDNAME (
source_field_reference
)
FIELDNAME returns the name of the field identified by source_field_reference as a character value. If the parameter identifies a nonexistent field, NULL is returned. ESQL reference
1637
For example: v FIELDNAME(InputRoot.XMLNS) returns XMLNS. v FIELDNAME(InputBody) returns the name of the last child of InputRoot, which could be XMLNS. v FIELDNAME(InputRoot.*[<]) returns the name of the last child of InputRoot, which could be XMLNS. This function does not show any namespace information; this must be obtained by a separate call to the “FIELDNAMESPACE function.” Whereas the following ESQL sets X to ″F1″: SET X=FIELDNAME(InputBody.*[<]);
The following ESQL sets Y to null: SET Y=FIELDNAME(InputBody.F1.*[<]);
However, the following ESQL sets Z to the (expected) child of F1: SET Z=FIELDNAME(InputBody.*[<].*[<]);
This is because F1 belongs to a namespace and needs to be explicitly referenced by, for example: DECLARE ns NAMESPACE 'urn:nid:xxxxxx'; SET Y=FIELDNAME(InputBody.ns:F1.*[<]);
FIELDNAMESPACE function The FIELDNAMESPACE field function returns the namespace of a given field.
Syntax
FIELDNAMESPACE (
FieldReference
)
FIELDNAMESPACE takes a field reference as a parameter and returns a value of type CHARACTER containing the namespace of the addressed field. If the parameter identifies a nonexistent field, NULL is returned.
FIELDTYPE function The FIELDTYPE field function returns the type of a given field.
Syntax
FIELDTYPE (
1638
Message Flows
source_field_reference
)
FIELDTYPE returns an integer representing the type of the field identified by source_field_reference; this is the type of the field, not the data type of the field that the parameter identifies. If the parameter identifies a nonexistent entity, NULL is returned. The mapping of integer values to field types is not published, and might change from release to release. Compare the results of the FIELDTYPE function with named field types. For example: IF FIELDTYPE(source_field_reference) = NameValue THEN ...
The named field types that you can use in this context are listed below. The following conditions apply: v Name, Value, NameValue and MQRFH2.BitStream are domain independent. v The XML.* types are applicable to the XML, XMLNS, JMSMap, and JMSStream domains, except for XML.Namespace which is specific to the XMLNS domain. v The XMLNSC.* types are applicable to the XMLNSC domain. You must use these types with the capitalization shown: v Name v Value v NameValue v MQRFH2.BitStream v XML.AsisElementContent v v v v v v
XML.Attribute XML.AttributeDef XML.AttributeDefDefaultType XML.AttributeDefType XML.AttributeDefValue XML.AttributeList
v XML.BitStream v XML.CDataSection v v v v v
XML.Comment XML.Content XML.DocTypeComment XML.DocTypeDecl XML.DocTypePI
v XML.DocTypeWhiteSpace v XML.Element v v v v v
XML.ElementDef XML.Encoding XML.EntityDecl XML.EntityDeclValue XML.EntityReferenceStart
v XML.EntityReferenceEnd ESQL reference
1639
v v v v v
XML.ExternalEntityDecl XML.ExternalParameterEntityDecl XML.ExtSubset XML.IntSubset XML.NamespaceDecl
v v v v v v v
XML.NotationDecl XML.NotationReference XML.ParameterEntityDecl XML.ParserRoot XML.ProcessingInstruction XML.PublicId XML.RequestedDomain
v v v v v v
XML.Standalone XML.SystemId XML.UnparsedEntityDecl XML.Version XML.WhiteSpace XML.XmlDecl
v XMLNSC.Attribute v XMLNSC.BitStream v XMLNSC.CDataField v v v v
XMLNSC.CDataValue XMLNSC.Comment XMLNSC.DocumentType XMLNSC.DoubleAttribute
v XMLNSC.DoubleEntityDefinition v XMLNSC.EntityDefinition v XMLNSC.EntityReference v v v v v
XMLNSC.Field XMLNSC.Folder XMLNSC.HybridField XMLNSC.HybridValue XMLNSC.PCDataField
v XMLNSC.PCDataValue v XMLNSC.ProcessingInstruction v v v v
XMLNSC.SingleAttribute XMLNSC.SingleEntityDefinition XMLNSC.Value XMLNSC.XmlDeclaration
You can also use this function to determine whether a field in a message exists. To do this, use the form: FIELDTYPE(SomeFieldReference) IS NULL
1640
Message Flows
If the field exists, an integer value is returned to the function that indicates the field type (for example, string). When this is compared to NULL, the result is FALSE. If the field does not exist, NULL is returned and therefore the result is TRUE. For example: IF FIELDTYPE(InputRoot.XMLNS.Message1.Name) IS NULL THEN // Name field does not exist, take error action.... ... more ESQL ... ELSE // Name field does exist, continue.... ... more ESQL ... END IF
FIELDVALUE function The FIELDVALUE field function returns the scalar value of a given field.
Syntax
FIELDVALUE (
source_field_reference
)
FIELDVALUE returns the scalar value of the field identified by source_field_reference. If it identifies a non-existent field, NULL is returned. For example, consider the following XML input message: 1234
The ESQL statement SET OutputRoot.XML.Data.Quantity = FIELDVALUE(InputRoot.XML.Data.Qty);
gives the result: 1234
whereas this ESQL statement (without the FIELDVALUE function): SET OutputRoot.XML.Data.Quantity = InputRoot.XML.Data.Qty;
causes a tree copy, with the result: 1234
because the field Qty is not a leaf field.
FOR function The FOR field function evaluates an expression and assigns a resulting value of TRUE, FALSE, or UNKNOWN
ESQL reference
1641
Syntax
, fieldreference
FOR ALL -ANY -SOME (
AS
Identifier
expression )
FOR enables you to write an expression that iterates over all instances of a repeating field. For each instance it processes a boolean expression and collates the results. For example: FOR ALL Body.Invoice.Purchases."Item"[] AS I (I.Quantity <= 50)
Note: 1. With the quantified predicate , the first thing to note is the [] on the end of the field reference after the FOR ALL. The square brackets define iteration over all instances of the Item field. In some cases, this syntax appears unnecessary, because you can get that information from the context, but it is done for consistency with other pieces of syntax. 2. The ASclause associates the name I in the field reference with the current instance of the repeating field. This is similar to the concept of iterator classes used in some object oriented languages such as C++. The expression in parentheses is a predicate that is evaluated for each instance of the Item field. If you specify the ALL keyword, the function iterates over all instances of the field Item inside Body.Invoice.Purchases and evaluates the predicate I.Quantity <= 50. If the predicate evaluates to: v TRUE (if the field is empty, or for all instances of Item) return TRUE. v FALSE (for any instance of Item) return FALSE. v Anything else, return UNKNOWN. The ANY and SOME keywords are equivalent. If you use either, the function iterates over all instances of the field Item inside Body.Invoice.Purchases and evaluates the predicate I.Quantity <= 50. If the predicate evaluates to: v FALSE (if the field is empty, or for all instances of Item) return FALSE. v TRUE (for any instance of Item) return TRUE. v Anything else, return UNKNOWN. To further illustrate this, the following examples are based on the message described in “Example message” on page 1701. In the following filter expression:
1642
Message Flows
FOR ANY Body.Invoice.Purchases."Item"[] AS I (I.Title = 'The XML Companion')
the sub-predicate evaluates to TRUE. However, this next expression returns FALSE: FOR ANY Body.Invoice.Purchases."Item"[] AS I (I.Title = 'C Primer')
because the C Primer is not included on this invoice. If in this instance some of the items in the invoice do not include a book title field, the sub-predicate returns UNKNOWN, and the quantified predicate returns the value UNKNOWN. Take great care to deal with the possibility of null values appearing. Write this filter with an explicit check on the existence of the field, as follows: FOR ANY Body.Invoice.Purchases."Item"[] AS I (I.Book IS NOT NULL AND I.Book.Title = 'C Primer')
The IS NOT NULL predicate ensures that, if an Item field does not contain a Book, a FALSE value is returned from the sub-predicate.
LASTMOVE function The LASTMOVE field function tells you whether the last MOVE function succeeded.
Syntax
LASTMOVE (
source_dynamic_reference
)
LASTMOVE returns a Boolean value indicating whether the last MOVE function applied to source_dynamic_reference was successful (TRUE) or not (FALSE). See “MOVE statement” on page 1574 for an example of using the MOVE statement, and the LASTMOVE function to check its success. See “Creating dynamic field references” on page 316 for information about dynamic references.
SAMEFIELD function The SAMEFIELD field function tells you whether two field references point to the same target.
Syntax
SAMEFIELD (
source_field_reference1
,
source_field_reference2
)
SAMEFIELD returns a BOOLEAN value indicating whether two field references point to the same target. If they do, SAMEFIELD returns TRUE; otherwise SAMEFIELD returns FALSE. For example: ESQL reference
1643
DECLARE ref1 REFERENCE TO OutputRoot.XMLNS.Invoice.Purchases.Item[1]; MOVE ref1 NEXTSIBLING; SET Result = SAMEFIELD(ref1,OutputRoot.XMLNS.Invoice.Purchases.Item[2]);
Result is TRUE. See “Creating dynamic field references” on page 316 for information about dynamic references.
ESQL list functions This topic lists the ESQL list functions and covers the following: “CARDINALITY function” “EXISTS function” on page 1645 “SINGULAR function” on page 1645 “THE function” on page 1646
CARDINALITY function The CARDINALITY function returns the number of elements in a list.
Syntax
CARDINALITY (
ListExpression
)
CARDINALITY returns an integer value giving the number of elements in the list specified by ListExpression. ListExpression is any expression that returns a list. All the following, for example, return a list: v A LIST constructor v A field reference with the [] array indicator v Some SELECT expressions (not all return a list) A common use of this function is to determine the number of fields in a list before iterating over them.
Examples -- Determine the number of F1 fields in the message. -- Note that the [ ] are required DECLARE CountF1 INT CARDINALITY(OutputRoot.XMLNS.Data.Source.F1[]); -- Determine the number of fields called F1 with the value 'F12' in the message. -- Again note that the [ ] are required DECLARE CountF1F12 INT CARDINALITY(SELECT F.* FROM OutputRoot.XMLNS.Data.Source.F1[] AS F where F = 'F12'); -- Use the value returned by CARDINALITY to refer to a specific element -- in a list or array: -- Array indices start at 1, so this example refers to the third-from-last -- instance of the Item field Body.Invoice.Item[CARDINALITY(Body.Invoice.Item[]) - 2].Quantity
1644
Message Flows
EXISTS function The EXISTS function returns a BOOLEAN value indicating whether a list contains at least one element (that is, whether the list exists).
Syntax
EXISTS (
ListExpression
)
If the list specified by ListExpression contains one or more elements, EXISTS returns TRUE. If the list contains no elements, EXISTS returns FALSE. ListExpression is any expression that returns a list. All the following, for example, return a list: v A LIST constructor v A field reference with the [] array indicator v Some SELECT expressions (not all return a list) If you only want to know whether a list contains any elements or none, EXISTS executes more quickly than an expression involving the CARDINALITY function (for example, CARDINALITY(ListExpression ) <> 0). A common use of this function is to determine whether a field exists.
Examples -- Determine whether the F1 array exists in the message. Note that the [ ] -- are required DECLARE Field1Exists BOOLEAN EXISTS(OutputRoot.XMLNS.Data.Source.F1[]); -- Determine whether the F1 array contains an element with the value 'F12'. -- Again note that the [ ] are required DECLARE Field1F12Exists BOOLEAN EXISTS(SELECT F.* FROM OutputRoot.XMLNS.Data.Source.F1[] AS F where F = 'F12');
SINGULAR function The SINGULAR function returns a BOOLEAN value indicating whether a list contains exactly one element.
Syntax
SINGULAR (
ListExpression
)
If the list specified by ListExpression contains exactly one element, SINGULAR returns TRUE. If the list contains more or fewer elements, SINGULAR returns FALSE. ListExpression is any expression that returns a list. All the following, for example, return a list: v A LIST constructor ESQL reference
1645
v A field reference with the [] array indicator v Some SELECT expressions (not all return a list) If you only want to know whether a list contains just one element or some other number, SINGULAR executes more quickly than an expression involving the CARDINALITY function (for example, CARDINALITY(ListExpression ) = 1). A common use of this function is to determine whether a field is unique.
Examples -- Determine whether there is just one F1 field in the message. -- Note that the [ ] are required DECLARE Field1Unique BOOLEAN SINGULAR(OutputRoot.XMLNS.Data.Source.F1[]); -- Determine whether there is just one field called F1 with the value 'F12' -- in the message. Again note that the [ ] are required DECLARE Field1F12Unique BOOLEAN SINGULAR(SELECT F.* FROM OutputRoot.XMLNS.Data.Source.F1[] AS F where F = 'F12');
THE function The THE function returns the first element of a list.
Syntax
THE
( ListExpression )
If ListExpression contains one or more elements; THE returns the first element of the list. Otherwise it returns an empty list.
Restrictions Currently, ListExpression must be a SELECT expression.
Complex ESQL functions This topic lists the complex ESQL functions and covers the following: “CASE function” on page 1647 “CAST function” on page 1648 “SELECT function” on page 1662 “ROW constructor function” on page 1669 “LIST constructor function” on page 1670 “ROW and LIST combined” on page 1671 “ROW and LIST comparisons” on page 1672 “Supported casts” on page 1674 “Implicit casts” on page 1682 “Implicit CASTs for comparisons” on page 1682 “Implicit CASTs for arithmetic operations” on page 1684
1646
Message Flows
“Implicit CASTs for assignment” on page 1686 “Data types of values from external sources” on page 1687
CASE function CASE is a complex function that has two forms; the simple-when form and the searched-when form. In either form CASE returns a result, the value of which controls the path of subsequent processing.
Syntax
ELSE NULL CASE
simple-when-clause searched-when-clause
END ELSE
result_expression
simple-when-clause:
source_value WHEN
test_value
THEN
result_value NULL
searched-when-clause:
WHEN
search_condition
THEN
result_value NULL
In the simple-when form, source_value is compared with each test_value until a match is found. The result of the CASE function is the value of the corresponding result_value. The data type of source_value must therefore be comparable to the data type of each test_value. The CASE function must have at least one WHEN clause. The ELSE expression is optional. The default ELSE expression is NULL. A CASE expression is delimited by END. The test values do not have to be literal values. The searched-when form is similar, but has the additional flexibility of allowing a number of different values to be tested. The following example shows a CASE function with a simple WHEN clause. In this example, the CASE can be determined only by one variable that is specified next to the CASE keyword. DECLARE CurrentMonth CHAR; DECLARE MonthText CHAR; SET CurrentMonth = SUBSTRING(InputBody.Invoice.InvoiceDate FROM 6 FOR 2); SET MonthText = CASE CurrentMonth WHEN '01' THEN 'January' WHEN '02' THEN 'February' WHEN '03' THEN 'March' ESQL reference
1647
WHEN WHEN WHEN ELSE END;
'04' THEN 'April' '05' THEN 'May' '06' THEN 'June' 'Second half of year'
The following example shows a CASE function with a searched-when-clause. This example is still determined by one variable CurrentMonth: DECLARE CurrentMonth CHAR; DECLARE MonthText CHAR; SET CurrentMonth = SUBSTRING(InputBody.Invoice.InvoiceDate FROM 6 FOR 2); SET MonthText = CASE WHEN Month = WHEN Month = WHEN Month = WHEN Month = WHEN Month = WHEN Month = ELSE 'Second END;
'01' '02' '03' '04' '05' '06' half
THEN 'January' THEN 'February' THEN 'March' THEN 'April' THEN 'May' THEN 'June' of year'
In a searched-when-clause, different variables can be used in the WHEN clauses to determine the result. This is demonstrated in the following example of the searched-when-clause: DECLARE CurrentMonth CHAR; DECLARE CurrentYear CHAR; DECLARE MonthText CHAR; SET CurrentMonth = SUBSTRING(InputBody.Invoice.InvoiceDate FROM 6 FOR 2); SET CurrentYear = SUBSTRING(InputBody.Invoice.InvoiceDate FROM 1 FOR 4); SET MonthText = CASE WHEN CurrentMonth = '01' THEN 'January' WHEN CurrentMonth = '02' THEN 'February' WHEN CurrentMonth = '03' THEN 'March' WHEN CurrentYear = '2000' THEN 'A month in the Year 2000' WHEN CurrentYear = '2001' THEN 'A month in the Year 2001' ELSE 'Not first three months of any year or a month in the Year 2000 or 2001' END;
CAST function CAST is a complex function that transforms one or more values from one data type into another.
1648
Message Flows
Syntax
<< , << CAST
( source_expression
AS
DataType CCSID
expression
ENCODING expression
FORMAT
expression
DEFAULT
expression
)
In practice, you cannot specify all of the above parameters at the same time. For example, CCSID and ENCODING parameters take effect only on string-to-string conversions, while FORMAT applies only to string-numeric and string-datetime conversions (in either direction). The CAST function transforms one or more values from one data type into another data type. For example, you can use CAST to process generic XML messages. All fields in an XML message have character values, so to perform an arithmetic calculation or a date/time comparison on a field, for example, use CAST to convert the string value of the field into a value of the appropriate type. Not all conversions are supported; see “Supported casts” on page 1674 for a list of supported conversions. Parameters: Source expression CAST returns its first parameter (source_expression), which can contain more than one value, as the data type that is specified by its second parameter (DataType). In all cases, if the source expression is NULL, the result is NULL. If the evaluated source expression is not compatible with the target data type, or if the source expression is of the wrong format, a runtime error is generated. CCSID The CCSID parameter is used only for conversions to or from one of the string data types. Use the CCSID parameter to specify the code page of the source or target string. The CCSID parameter can be any expression that evaluates to a value of type INT. The expression is interpreted according to normal WebSphere Message Broker rules for CCSIDs. See “Supported code pages” on page 1353 for a list of valid values. DataType The DataType parameter is the data type into which the source value is transformed. The possible values are: ESQL reference
1649
v String types: – BIT – BLOB – CHARACTER v Numeric types: – DECIMAL – FLOAT – INTEGER v Date/Time types: – DATE – GMTTIME – GMTTIMESTAMP – INTERVAL – TIME – TIMESTAMP v Boolean: – BOOLEAN Ensure that you specify a valid ESQL interval subtype after a Date/Time type of INTERVAL. For valid ESQL interval subtypes, see “ESQL INTERVAL data type” on page 1482. For example commands that show how to specify a valid ESQL interval subtype, see examples 12, 13, and 14 below. DEFAULT The DEFAULT parameter provides a method of avoiding exceptions being thrown from CAST statements by providing a last-resort value to return. The DEFAULT parameter must be a valid ESQL expression that returns the same data type as that specified on the DataType parameter, otherwise an exception is thrown. The CCSID, ENCODING, and FORMAT parameters are not applied to the result of the DEFAULT parameter; the expression must, therefore, be of the correct CCSID, ENCODING, and FORMAT. ENCODING Use the ENCODING parameter to specify the encoding for certain conversions. The ENCODING value can be any expression that evaluates to a value of type INT, and is interpreted according to normal WebSphere Message Broker rules for encoding. Valid values are: v MQENC_NATIVE (0x00000222L) v MQENC_INTEGER_NORMAL (0x00000001L) v MQENC_INTEGER_REVERSED (0x00000002L) v v v v v
1650
Message Flows
MQENC_DECIMAL_NORMAL (0x00000010L) MQENC_DECIMAL_REVERSED (0x00000020L) MQENC_FLOAT_IEEE_NORMAL (0x00000100L) MQENC_FLOAT_IEEE_REVERSED (0x00000200L) MQENC_FLOAT_S390 (0x00000300L)
FORMAT Use the FORMAT parameter for conversions between string data types and numerical or date/time data types. For conversions from string types, FORMAT defines how the source string should be parsed to fill the target data type. For conversions to string types, it defines how the data in the source expression is formatted in the target string. FORMAT takes different types of expression for date/time and numerical conversions. However, the same FORMAT expression can be used irrespective of whether the conversion is to a string or from a string. You can specify a FORMAT parameter when casting: v From any of the string data types (BIT, BLOB, or CHARACTER) to: – DECIMAL – FLOAT – INTEGER – DATE – GMTTIMESTAMP – TIMESTAMP – GMTTIME – TIME v To any of the string data types (BIT, BLOB, or CHARACTER) from any of the numerical and date/time data types in the previous list. Specifying FORMAT for an unsupported combination of source and target data types causes error message BIP3205 to be issued. For more information about conversion to and from numerical data types, see “Formatting and parsing numbers as strings” on page 1654. For more information about conversion to and from date/time data types, see “Formatting and parsing dateTimes as strings” on page 1656. The FORMAT parameter is equivalent to those used in many other products, such as ICU and Microsoft Excel. Examples: Example 1. Formatted CAST from DECIMAL to CHARACTER DECLARE source DECIMAL 31415.92653589; DECLARE target CHARACTER; DECLARE pattern CHARACTER '#,##0.00'; SET target = CAST(source AS CHARACTER FORMAT pattern); -- target is now '31,415.93'
Example 2. Formatted CAST from DATE to CHARACTER | | |
DECLARE now CHARACTER; SET now = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'yyyyMMdd-HHmmss'); -- target is now '20041007-111656' (in this instance at least)
Example 3. Formatted CAST from CHARACTER to DATE DECLARE source CHARACTER '01-02-03'; DECLARE target DATE; DECLARE pattern CHARACTER 'dd-MM-yy'; SET target = CAST(source AS DATE FORMAT pattern); -- target now contains Year=2003, Month=02, Day=01
ESQL reference
1651
Example 4. Formatted CAST from CHARACTER to TIMESTAMP DECLARE source CHARACTER '12 Jan 03, 3:45pm'; DECLARE target TIMESTAMP; DECLARE pattern CHARACTER 'dd MMM yy, h:mma'; SET target = CAST(source AS TIMESTAMP FORMAT pattern); -- target now contains Year=2003, Month=01, Day=03, Hour=15, Minute=45, Seconds=58 -- (seconds taken from CURRENT_TIME since not present in input)
Example 5. Formatted CAST from DECIMAL to CHARACTER, with negative pattern DECLARE source DECIMAL -54231.122; DECLARE target CHARACTER; DECLARE pattern CHARACTER '#,##0.00;(#,##0.00)'; SET target = CAST(source AS CHARACTER FORMAT pattern); -- target is now '£(54,231.12)'
Example 6. Formatted CAST from CHARACTER to TIME DECLARE source CHARACTER '16:18:30'; DECLARE target TIME; DECLARE pattern CHARACTER 'hh:mm:ss'; SET target = CAST(source AS TIME FORMAT pattern); -- target now contains Hour=16, Minute=18, Seconds=30
Example 7. CASTs from the numeric types to DATE CAST(7, 6, 5 AS DATE); CAST(7.4e0, 6.5e0, 5.6e0 AS DATE); CAST(7.6, 6.51, 5.4 AS DATE);
Example 8. CASTs from the numeric types to TIME CAST(9, 8, 7 AS TIME); CAST(9.4e0, 8.6e0, 7.1234567e0 AS TIME); CAST(9.6, 8.4, 7.7654321 AS TIME);
Example 9. CASTs from the numeric types to GMTTIME CAST(DATE '0001-02-03', TIME '04:05:06' AS TIMESTAMP); CAST(2, 3, 4, 5, 6, 7.8 AS TIMESTAMP);
Example 10. CASTs to TIMESTAMP CAST(DATE '0001-02-03', TIME '04:05:06' AS TIMESTAMP); CAST(2, 3, 4, 5, 6, 7.8 AS TIMESTAMP);
Example 11. CASTs to GMTTIMESTAMP CAST(DATE '0002-03-04', GMTTIME '05:06:07' AS GMTTIMESTAMP); CAST(3, 4, 5, 6, 7, 8 AS GMTTIMESTAMP); CAST(3.1e0, 4.2e0, 5.3e0, 6.4e0, 7.5e0, 8.6789012e0 AS GMTTIMESTAMP); CAST(3.2, 4.3, 5.4, 6.5, 7.6, 8.7890135 AS GMTTIMESTAMP);
Example 12. CASTs to INTERVAL from INTEGER CAST(1234 AS INTERVAL YEAR); CAST(32, 10 AS INTERVAL YEAR TO MONTH ); CAST(33, 11 AS INTERVAL DAY TO HOUR ); CAST(34, 12 AS INTERVAL HOUR TO MINUTE); CAST(35, 13 AS INTERVAL MINUTE TO SECOND); CAST(36, 14, 10 AS INTERVAL DAY TO MINUTE); CAST(37, 15, 11 AS INTERVAL HOUR TO SECOND); CAST(38, 16, 12, 10 AS INTERVAL DAY TO SECOND);
1652
Message Flows
Example 13. CASTs to INTERVAL from FLOAT CAST(2345.67e0 CAST(3456.78e1 CAST(4567.89e2 CAST(5678.90e3 CAST(6789.01e4 CAST(7890.12e5 CAST(7890.1234e0
AS AS AS AS AS AS AS
INTERVAL INTERVAL INTERVAL INTERVAL INTERVAL INTERVAL INTERVAL
YEAR ); MONTH ); DAY ); HOUR ); MINUTE); SECOND); SECOND);
Example 14. CASTs to INTERVAL from DECIMAL CAST(2345.67 CAST(34567.8 CAST(456789 CAST(5678900 CAST(67890100 CAST(789012000 CAST(7890.1234
AS AS AS AS AS AS AS
INTERVAL INTERVAL INTERVAL INTERVAL INTERVAL INTERVAL INTERVAL
YEAR ); MONTH ); DAY ); HOUR ); MINUTE); SECOND); SECOND);
Example 15. CASTs to FLOAT from INTERVAL CAST(INTERVAL CAST(INTERVAL CAST(INTERVAL CAST(INTERVAL CAST(INTERVAL CAST(INTERVAL
'1234' YEAR AS '2345' MONTH AS '3456' DAY AS '4567' HOUR AS '5678' MINUTE AS '6789.01' SECOND
FLOAT); FLOAT); FLOAT); FLOAT); FLOAT); AS FLOAT);
Example 16. CASTs DECIMAL from INTERVAL CAST(INTERVAL CAST(INTERVAL CAST(INTERVAL CAST(INTERVAL CAST(INTERVAL CAST(INTERVAL
'1234' YEAR AS '2345' MONTH AS '3456' DAY AS '4567' HOUR AS '5678' MINUTE AS '6789.01' SECOND
DECIMAL); DECIMAL); DECIMAL); DECIMAL); DECIMAL); AS DECIMAL);
Example 17. A ternary cast that fails and results in the substitution of a default value CAST(7, 6, 32 AS DATE DEFAULT DATE '1947-10-24');
Example 18. A sexternary cast that fails and results in the substitution of a default value CAST(2, 3, 4, 24, 6, 7.8 AS TIMESTAMP DEFAULT TIMESTAMP '1947-10-24 07:08:09');
Example 19. A ternary cast that fails and throws an exception BEGIN DECLARE EXIT HANDLER FOR SQLSTATE LIKE '%' BEGIN SET OutputRoot.XMLNS.Data.Date.FromIntegersInvalidCast = 'Exception thrown'; END; DECLARE Dummy CHARACTER CAST(7, 6, 32 AS DATE); END;
Example 20. A sexternary cast that fails and throws an exception BEGIN DECLARE EXIT HANDLER FOR SQLSTATE LIKE '%' BEGIN SET OutputRoot.XMLNS.Data.Timestamp.FromIntegersInvalidCast = 'Exception thrown'; END; DECLARE Dummy CHARACTER CAST(2, 3, 4, 24, 6, 7.8 AS TIMESTAMP); END;
ESQL reference
1653
Formatting and parsing numbers as strings: For conversions between string data types and numeric data types, you can supply, on the FORMAT parameter of the CAST function, an optional formatting expression. For conversions from string types, the formatting expression defines how the source string should be parsed to fill the target data type. For conversions to string types, the formatting expression defines how the data in the source expression is to be formatted in the target string. You can specify a FORMAT expression for the following numeric conversions (Specifying a FORMAT expression for date/time conversions is described in “Formatting and parsing dateTimes as strings” on page 1656). v From any of the string data types (BIT, BLOB, or CHARACTER) to: – DECIMAL – FLOAT – INTEGER v To any of the string data types (BIT, BLOB, or CHARACTER) from any of the numeric data types that are in the previous list. The formatting expression consists of three parts: 1. A subpattern that defines positive numbers. 2. An optional subpattern that defines negative numbers. (If only one subpattern is defined, negative numbers use the positive pattern, prefixed with a minus sign.) 3. The optional parameters groupsep and decsep. Syntax
subpattern
;
subpattern
:groupsep=
chars
:decsep= chars
subpattern: digits chars
.digits
e E
digits
chars
Parameters: chars A sequence of zero or more characters. All characters can be used, except the special characters that are listed under “subpattern” on page 1655.
1654
Message Flows
decsep One or more characters to be used as the separator between the whole and decimal parts of a number (the decimal separator). The default decimal separator is a period (.). digits A sequence of one or more of the numeric tokens (0 # - + , . ) that are listed under “subpattern.” groupsep One or more characters to be used as the separator between clusters of integers, to make large numbers more readable (the grouping separator). The default grouping separator is nothing (that is, there is no grouping of digits or separation of groups). Grouping is commonly done in thousands, but it can be redefined by either the pattern or the locale. There are two grouping sizes: The primary grouping size Used for the least significant integer digits. The secondary grouping size Used for all other integer digits. In most cases, the primary and secondary grouping sizes are the same, but they can be different. For example, if the pattern used is #,##,##0, the primary grouping size is 3 and the secondary is 2. The number 123456789 would become the string “12,34,56,789”. If multiple grouping separators are used (as in the previous example), the rightmost separator defines the primary size, and the penultimate rightmost separator defines the secondary size. subpattern The subpattern consists of: 1. An optional prefix (chars) 2. A mandatory pattern representing a whole number 3. An optional pattern representing decimal places 4. An optional pattern representing an exponent (the power by which the preceding number is raised) 5. An optional suffix (chars) Parts 2, 3, and 4 of the subpattern are defined by the tokens in the following table. Token
Represents
0
Any digit, including a leading zero.
#
Any digit, excluding a leading zero. (See the explanation of the difference between 0 and # that follows this table.)
.
Decimal separator.
+
Prefix of positive numbers.
-
Prefix of negative numbers.
,
Grouping separator.
ESQL reference
1655
Token
Represents
E/e
Separates the number from the exponent.
;
Subpattern boundary.
’
Quotation mark, applied to special characters. If a quotation mark is needed in output, it must be doubled (’’).
*
Padding specifier. The character following the asterisk is used to pad the number to fit the length of the format pattern.
The # and 0 characters are used for digit substitution, the difference between them being that a # character is removed if there is no number to replace it with. For example, 10 formatted by the pattern #,##0.00 gives “10.00”, but formatted by 0,000.00 gives “0,010.00”. To specify padding characters, use an asterisk. When an asterisk is placed in either of the two chars regions (the prefix and suffix), the character immediately following it is used to pad the output. Padding can be specified only once. For example, a pattern of *x#,###,##0.00 applied to 1234 gives “xxx1,234.00”. But applied to 1234567, it gives “1,234,567.00”. Examples of formatting patterns: The following table shows formatting patterns and the strings that are generated from sample numeric input. Pattern
Input number
Output string
+###,##0.00;###,###,##0.00:groupsep=’’:decsep=,
123456789.123
“+123’456’789,12”
##0.00
1000000
“1000000.00”
##0.00
3.14159265
“3.14”
Formatting and parsing dateTimes as strings: This section gives information on how you can specify the dateTime format using a string of pattern letters. When you convert a date or time into a string, a format pattern must be applied that directs the conversion. Apply the format pattern to convert a date or time into a string, or to parse a string into a date or time. During the conversion (for example, of a dateTime into a string), a pattern or a set of tokens is replaced with the equivalent source. The following diagram shows how a pattern is used to format a dateTime source to produce a character string output.
1656
Message Flows
source
pattern
Year=2004, Month=10, Day=07, Hour=10, Minute=24, Second=40
yyyy-MM-dd HH:mm:ss
output 2004-10-07 10:24:40
When a string is parsed (for example, when converting the string to a dateTime), the pattern or set of tokens is used to determine which part of the target dateTime is represented by which part of the string. The following diagram shows how this is done.
source
pattern dd MMM yy, h:ma
12 Jan 03, 3:45pm
output Year=2003, Month=01, Day=12, Hour=15, Minute=45
Syntax The expression pattern is defined by:
symbol string
Where: symbol is a character in the set adDeEFGhHIkKmMsSTUwWyYzZ. string is a sequence of characters enclosed in single quotation marks. If a single quotation mark is required within the string, use two single quotation marks (″).
ESQL reference
1657
Characters for formatting a dateTime as a string The following table lists the characters that you can use in a pattern for formatting or parsing strings in relation to a dateTime. The table is followed by some notes that explain more about some of the examples in the table. Symbol
Meaning
Presentation
Examples
a
am or pm marker
Text
Input am, AM, pm, PM. Output AM or PM
d
day in month (1-31)
Number
1, 20
dd
day in month (01-31)
Number
01, 31
D
day in year (1-366)
Number
3, 80, 100
DD
day in year (01-366)
Number
03, 80, 366
DDD
day in year (001-366)
Number
003
Number
2
Text
Tue
Text
Tuesday
Number
2
e
day in week (1-7)
EEE EEEE
day in week
1
day in week
1
1
2
F
day of week in month (1-5)
G
Era
Text
BC or AD
h
hour in am or pm (1-12)
Number
6
hh
hour in am or pm (01-12)
Number
06
H
hour of day in 24 hour form (0-23)3
Number
7
HH
hour of day in 24 hour form (00-23)3
Number
07
I
ISO8601 Date/Time (up to yyyy-MM-dd’T’HH:mm:ss. SSSZZZ)4
Text
2006-1007T12:06:56.568+01:00
IU
ISO8601 Date/Time (similar Text to I, but ZZZ with output ″Z″ if the time zone is +00:00)4
k
hour of day in 24 hour form (1-24)3
Number
8
k
hour of day in 24 hour form (01-24)3
Number
08
K
hour in am or pm (0-11)
Number
9
KK
hour in am or pm (00-11)
Number
09
m
minute
Number
4
mm
minute
Number
04
M
numeric month
Number
5, 12
MM
numeric month
Number
05, 12
2006-1007T12:06:56.568+01:00, 2003-12 -15T15:42:12.000Z
MMM
named month
Text
Jan, Feb
MMMM
named month
Text
January, February
s
seconds
Number
5
ss
seconds
Number
05
S
decisecond5
Number
7
1658
Message Flows
Symbol SS SSS SSSS SSSSS
Meaning centisecond millisecond
5
5
0.0001 second
5
0.00001 second
5 5
Presentation
Examples
Number
70
Number
700
Number
7000
Number
70000
Number
700000
SSSSSS
0.000001 second
T
ISO8601 Time (up to HH:mm:ss.SSSZZZ)4
Text
12:06:56.568+01:00
TU
ISO8601 Time (similar to T, Text but a time zone of +00:00 is replaced with ’Z’)4
12:06:56.568+01:00, 15:42:12.000Z
w
week in year6
Number
7, 53
Number
07, 53
ww
week in year
6 7
Number
2
year
8
Number
06
yyyy
year
8
Number
2006
YY
year: use with week in year Number only6
06
YYYY
year: use with week in year Number only6
2006
zzz
time zone (abbreviated name)
Text
GMT
zzzz
time zone (full name)
Text
Greenwich Mean Time
Z
time zone (+/-n)
Text
+3
ZZ
time zone (+/-nn)
Text
+03
ZZZ
time zone (+/-nn:nn)
Text
+03:00
ZZZU
time zone (as ZZZ, ″+00:00″ Text is replaced by ″Z″)
+03:00, Z
ZZZZ
time zone (GMT+/-nn:nn)
Text
GMT+03:00
ZZZZZ
time zone (as ZZZ, but no colon) (+/-nnnn)
Text
+0300
’
escape for text
’User text’
″
(two single quotation marks) single quotation mark within escaped text
’o″clock’
W yy
week in month
The presentation of the dateTime object depends on what symbols you specify. v Text. If you specify four or more of the symbols, the full form is presented. If you specify less than four symbols, the short or abbreviated form, if it exists, is presented. For example, EEEE produces Monday, EEE produces Mon. v Number. The number of characters for a numeric dateTime component must be within the bounds of the corresponding formatting symbols. Repeat the symbol to specify the minimum number of digits that are required. The maximum number of digits allowed is the upper bound for a particular symbol. For example, day in month has an upper bound of 31; therefore, a format string of d allows the values 2 or 21 to be parsed but disallows the values 32 and 210. On
ESQL reference
1659
output, numbers are padded with zeros to the specified length. A year is a special case; see note 8 in the list below. Fractional seconds are also special case; see note 5 below. v Any characters in the pattern that are not in the ranges of [’a’..’z’] and [’A’..’Z’] are treated as quoted text. For example, characters like colon (:), comma (,), period (.), the number sign (hash or pound, #), the at sign (@), and space appear in the resulting time text even if they are not enclosed within single quotes. v You can create formatting strings that produce unpredictable results; therefore, you must use these symbols with care. For example, if you specify dMyyyy, you cannot distinguish between day, month, and year. dMyyyy tells the broker that a minimum of one character represents the day, a minimum of one character represents the month, and four characters represent the year. Therefore, 3111999 can be interpreted as either 3/11/1999 or 31/1/1999. Notes: The following notes apply to the table above. 1. You can specify the following values in the day in week field: v 1 - Sunday v v v v v
2 3 4 5 6
-
Monday Tuesday Wednesday Thursday Friday
v 7 - Saturday 2. 12th July 2006 is the second Wednesday in July and can be expressed as 2006 July Wednesday 2 using the format string yyyy MMMM EEEE F. Note that this format does not represent the Wednesday in week 2 of July 2006, which is 5th July 2006; the format string for this is yyyy MMMM EEEE W. 3. 24-hour fields might result in an ambiguous time, if specified with a conflicting am/pm field. 4. See “ISO8601, I and T DateTime tokens” on page 1661. 5. Fractional seconds are represented by uppercase S. The length must implicitly match the number of format symbols on input. The format string ss SSS or ss.SSS, for example, represents seconds and milliseconds. However, the format string ss.sss represents a repeated field (of seconds); the value after the period (.) is taken as a seconds field, not as fractional seconds. The output is truncated to the specified length. 6. In ESQL, the first day of the year is assumed to be in the first week; therefore, January 1 is always in week 1. As a result, dates that are specified relative to one year might actually be in a different year. For example, ″Monday week 1 2005″ parsed using ″EEEE' week 'w' 'YYYY″ gives a date of 2004-12-27, because the Monday of the first week in 2005 is actually a date in 2004. If you use the y symbol, the adjustment is not done and unpredictable results might occur for dates around the end of the year. For example, if the string ″2005 01 Monday″ is formatted: v Monday of week 1 in 2005 using format string ″YYYY ww EEEE″ is correctly interpreted as 27th December 2004 v Monday of week 1 in 2005 using format string ″yyyy ww EEEE″ is incorrectly interpreted as 27th December 2005
1660
Message Flows
7. The first and last week in a month might include days from neighboring months. For example, Monday 31st July 2006 can be expressed as Monday in week one of August 2006, which is 2006 08 1 Monday using format string yyyy MM W EEEE. 8. Year is handled as a special case. v On output, if the count of y is 2, the year is truncated to 2 digits. For example, if yyyy produces 1997, yy produces 97. v On input, for 2 digit years the century window is fixed to 53. For example, an input date of 52 results in a year value of 2052, whereas an input date of 53 gives an output year of 1953, and 97 gives 1997. ISO8601, I and T DateTime tokens If your dateTime values comply with the ISO8601:2000 ’Representation of dates and times’ standard, consider using the formatting symbols I and T, which match the following subset of the ISO8601 standard. v The restricted profile as proposed by the W3C at http://www.w3.org/TR/ NOTE-datetime v Truncated representations of calendar dates, as specified in section 5.2.1.3 of ISO8601:2000 – Basic format (subsections c, e, and f) – Extended format (subsections a, b, and d) Use the formatting symbols I and T only on their own: v The I formatting symbol matches any dateTime string that conforms to the supported subset. v The T formatting symbol matches any dateTime string that conforms to the supported subset that consists of a time portion only. The following table shows how the output form relates to the logical data type. Logical model data type
ESQL data type
Output form
xsd:dateTime
TIMESTAMP or GMTTIMESTAMP
yyyy-MM-dd’T’HH:mm:ss.SSSZZZ
xsd:date
DATE
yyyy-MM-dd
xsd:gYear
INTERVAL
yyyy
xsd:gYearMonth
INTERVAL
yyyy-MM
xsd:gMonth
INTERVAL
--MM
xsd:gmonthDay
INTERVAL
--MM-dd
xsd:gDay
INTERVAL
---dd
xsd:time
TIME / GMTTIME
’T’HH:mm:ss.SSSZZZ
Note: v On input, both I and T accept both ’+00:00’ and ’Z’ to indicate a zero time difference from Coordinated Universal Time (UTC), but on output they always generate ’+00:00’. If you want ’Z’ to always be generated on output, use the IU or TU formatting symbols instead. v ZZZ always outputs ’+00:00’ to indicate a zero time difference from Coordinated Universal Time (UTC). If you want ’Z’ to always be generated on output, use ZZZU instead.
ESQL reference
1661
Using the input UTC format on output An element or attribute of logical type xsd:dateTime or xsd:time that contains a dateTime as a string can specify Coordinated Universal Time (UTC) by using either the Z symbol or time zone +00:00. On input, the MRM parser remembers the UTC format of such elements and attributes. On output, you can specify whether Z or +00:00 is displayed by using the Default DateTime Format property of the element or attribute. Alternatively, you can preserve the input UTC format by selecting the message set property Use input UTC format on output. If this property is selected, the UTC format is preserved in the output message and overrides the format that is implied by the dateTime format property. Understanding daylight saving time and the CAST function When the broker is running in a time zone other than GMT, it calculates the daylight saving time (DST) offset on times that are supplied to it by the CAST function. For CAST to calculate the offset correctly, the time passed into CAST must have a time zone associated with it, as a Z parameter. If no time zone is associated with the value passed, the time is converted into GMT time; it is not treated as a local time stamp. Also, when you use CAST to cast a string to a time value, the DST offset is calculated using the current system date. To cast a string to a time variable and calculate DST for a specific date, you must also specify the date. For example, if timeValue=’10:00:00’, the following code, run on a broker that is in the Central Daylight Time zone, converts the time to GMT, because no time zone identifier is specified: DECLARE castTime TIME; SET castTime = CAST (timeValue AS TIME FORMAT timePattern)
The time is not converted into GMT again if the castTime variable is used in any subsequent code, for example CAST(castDate, castTime AS GMTTIMESTAMP);
Examples The following table shows a few examples of dateTime formats. Format pattern
Result
″yyyy.MM.dd ’at’ HH:mm:ss ZZZ″
2006.07.10 at 15:08:56 -05:00
″EEE, MMM d, ″yy″
Wed, July 10, ’06
″h:mm a″
8:08 PM
″hh o″clock a, ZZZZ″
09 o’clock AM, GMT+09:00
″K:mm a, ZZZ″
9:34 AM, -05:00
″yyyy.MMMMM.dd hh:mm aaa″
1996.July.10 12:08 PM
SELECT function The SELECT function combines, filters, and transforms complex message and database data.
1662
Message Flows
Syntax
(1) SELECT SelectClause FromClause
WhereClause
WHERE: <<---- ,------ << SelectClause =
Expression AS Path INSERT ITEM
Expression (2) COUNT ( MAX MIN SUM
Expression
)
<<---- ,------ << FromClause =
FROM FieldReference AS
WhereClause =
WHERE
CorrelationName
Expression
Notes: 1
You no longer require the enclosing parentheses in SELECT expressions. This does not prevent you using parentheses but, if they are present, they are merely normal, expression-scoping, parentheses.
2
For the COUNT parameter only, you can specify the value of the following Expression as a single star (*).
Usage The SELECT function is the usual and most efficient way of transforming messages. You can use SELECT to: v Comprehensively reformat messages v Access database tables v Make an output array that is a subset of an input array v Make an output array that contains only the values of an input array v Count the number of entries in an array v Select the minimum or maximum value from a number of entries in an array v Sum the values in an array
ESQL reference
1663
Introduction to SELECT The SELECT function considers a message tree (or sub-tree) to consist of a number of rows and columns, rather like a database table. A FieldReference in a FROM clause identifies a field in a message tree. The identified field is regarded in the following ways: v The identified field is regarded as a row in a table. v The field’s siblings are regarded as other rows of the same table. v The field’s children are regarded as the table’s columns. Note: The FieldReference in a FROM clause can also be a table reference that refers directly to a real database table. The return value of the SELECT function is typically another message tree that contains rows whose structure and content is determined by the SelectClause. The number of rows in the result is the sum of all the rows pointed to by all the field references and table references in the FROM clause, filtered by the WHERE clause; only those fields for which the WHERE clause evaluates to TRUE are included. The return value of the SELECT function can also be scalar (see “ITEM selections” on page 1666). You can specify the SelectClause in several ways; see: v v v v
“Simple selections” “INSERT selections” on page 1666 “ITEM selections” on page 1666 “Column function selections” on page 1666
If you have created a message flow that contains one of the following nodes, and the ESQL that is associated with this node includes a SELECT function and a database reference, you must specify a value for the Data source property of the relevant node: v Compute v Database v Filter
Simple selections To understand the SELECT function in more detail, first consider the following simple case: v The SelectClause consists of a number of expressions, each with an AS Path clause. v The FROM clause contains a single FieldReference and an AS CorrelationName clause. The SELECT function creates a local, reference, correlation variable, whose name is given by the AS CorrelationName clause, and then steps, in turn, through each row of the list of rows derived from the FROM clause. For each row: 1. The correlation variable is set to point to the current row. 2. The WHERE clause (if present) is evaluated. If it evaluates to FALSE or unknown (null), nothing is added to the result tree and processing proceeds to the next row of the input. Otherwise processing proceeds to the next step. 3. A new member is added to the result list.
1664
Message Flows
4. The SELECT clause expressions are evaluated and assigned to fields named as dictated by the AS Path clause. These fields are child fields of the new member of the result list. Typically, both the SelectClause and the WHERE clause expressions use the correlation variable to access column values (that is, fields in the input message tree) and thus to build a new message tree containing data from the input message. The correlation variable is referred to by the name specified in the AS CorrelationName clause or, if an AS clause is not specified, by the final name in the FROM FieldReference (that is, the name after the last dot). Note that: v Despite the analogy with a table, you are not restricted to accessing or creating messages with a flat, table-like, structure; you can access and build trees with arbitrarily deep folder structures. v You are not restricted to a column being a single value; a column can be a repeating list value or a structure. These concepts are best understood by reference to the examples. If the field reference is actually a TableReference, the operation is very similar. In this case, the input is a real database table and is thus restricted to the flat structures supported by databases. The result tree is still not so restricted, however. If the FROM clause contains more than one field reference, the rightmost reference steps through each of its rows for each row in the next-to-rightmost reference, and so on. The total number of rows in the result is thus the product of the number of rows in each table. Such selects are known as joins and commonly use a WHERE clause that excludes most of these rows from the result. Joins are commonly used to add database data to messages. The AS Path clause is optional. If it is unspecified, the broker generates a default name according to the following rules: 1. If the SelectClause expression is a reference to a field or a cast of a reference to a field, the name of the field is used. 2. Otherwise the broker uses the default names Column1, Column2, and so on.
Examples The following example performs a SELECT on the table Parts in the schema Shop in the database DSN1. Because no WHERE clause exists, all rows are selected. Because the select clause expressions (for example, P.PartNumber) contain no AS clauses, the fields in the result adopt the same names: SET PartsTable.Part[] = SELECT P.PartNumber, P.Description, P.Price FROM Database.DSN1.Shop.Parts AS P;
If the target of the SET statement (PartsTable) is a variable of type ROW, after the statement is executed PartsTable will have, as children of its root element, a field called Part for each row in the table. Each of the Part fields will have child fields called PartNumber, Description, and Price. The child fields will have values dictated by the contents of the table. (PartsTable could also be a reference into a message tree).
ESQL reference
1665
The next example performs a similar SELECT. This case differs from the last in that the SELECT is performed on the message tree produced by the first example (rather than on a real database table). The result is assigned into a subfolder of OutputRoot: SET OutputRoot.XMLNS.Data.TableData.Part[] = SELECT P.PartNumber, P.Description, P.Price FROM PartsTable.Part[] AS P;
INSERT selections The INSERT clause is an alternative to the AS clause. It assigns the result of the SelectClause expression (which must be a row) to the current new row itself, rather than to a child of it. The effect of this is to merge the row result of the expression into the row being generated by the SELECT. This differs from the AS clause, in that the AS clause always generates at least one child element before adding a result, whereas INSERT generates none. INSERT is useful when inserting data from other SELECT operations, because it allows the data to be merged without extra folders.
ITEM selections The SelectClause can consist of the keyword ITEM and a single expression. The effect of this is to make the results nameless. That is, the result is a list of values of the type returned by the expression, rather than a row. This option has several uses: v In conjunction with a scalar expression and the THE function, it can be used to create a SELECT query that returns a single scalar value (for example, the price of a particular item from a table). v In conjunction with a CASE expression and ROW constructors, it can be used to create a SELECT query that creates or handles messages in which the structure of some rows (that is, repeats in the message) is different to others. This is useful for handling messages that have a repeating structure but in which the repeats do not all have the same structure. v In conjunction with a ROW constructor, it can be used to create a SELECT query that collapses levels of repetition in the input message.
Column function selections The SelectClause can consist of one of the functions COUNT, MAX, MIN, and SUM operating on an expression. These functions are known as column functions. They return a single scalar value (not a list) giving the count, maximum, minimum, or sum of the values that Expression evaluated to in stepping through the rows of the FROM clause. If Expression evaluates to NULL for a particular row, the value is ignored, so that the function returns the count, maximum, minimum, or sum of the remaining rows. For the COUNT function only, Expression can consist of a single star (*). This form counts the rows regardless of null values. To make the result a useful reflection of the input message, Expression typically includes the correlation variable. Typically, Expression evaluates to the same data type for each row. In these cases, the result of the MAX, MIN, and SUM functions are of the same data type as the
1666
Message Flows
operands. The returned values are not required to be all of the same type however, and if they are not, the normal rules of arithmetic apply. For example, if a field in a repeated message structure contains integer values for some rows and float values for others, the sum follows the normal rules for addition. The sum is of type float because the operation is equivalent to adding a number of integer and float values. The result of the COUNT function is always an integer.
Differences between message and database selections FROM expressions in which a correlation variable represents a row in a message behave slightly differently from those in which the correlation variable represents a row in a real database table. In the message case, a path involving a star (*) has the normal meaning; it ignores the field’s name and finds the first field that matches the other criteria (if any). In the database case a star (*) has, for historical reasons, the special meaning of all fields. This special meaning requires advance knowledge of the definition of the database table and is supported only when querying the default database (that is, the database pointed to by the node’s data source attribute). For example, the following queries return column name and value pairs only when querying the default database: SELECT * FROM Database.Datasource.SchemaName.Table As A SELECT A.* FROM Database.Datasource.SchemaName.Table As A SELECT A FROM Database.Datasource.SchemaName.Table AS A
Specifying the SELECT expressions SelectClause SelectClause expressions can use any of the broker’s operators and functions in any combination. They can refer to the tables’ columns, message fields, correlation names declared by containing SELECTs, and to any other declared variables or constants that are in scope. AS Path An AS Path expression is a relative path (that is, there is no correlation name) but is otherwise unrestricted in any way. For example, it can contain: v Indexes (for example, A.B.C[i]) v Field-type specifiers (for example, A.B.(XML.Attribute)C ) v Multipart paths (for example, A.B.C ) v Name expressions (for example, A.B.{var}) Any expressions in these paths can also use any of the broker’s operators and functions in any combination. The expressions can refer to the tables’ columns, message fields, correlation names declared by containing SELECTs, and any declared variables or constants. FROM clause FROM clause expressions can contain multiple database references, multiple message references, or a mixture of the two. You can join tables with tables, messages with messages, or tables with messages. FROM clause FieldReferences can contain expressions of any kind (for example, Database.{DataSource}.{Schema}.Table1). You can calculate a field, data source, schema, or table name at run time. ESQL reference
1667
WHERE clause The WHERE clause expression can use any of the broker’s operators and functions in any combination. It can refer to table columns, message fields, and any declared variables or constants. However, be aware that the broker treats the WHERE clause expression by examining the expression and deciding whether the whole expression can be evaluated by the database. If it can, it is given to the database. In order to be evaluated by the database, it must use only those functions and operators supported by the database. The WHERE clause can, however, refer to message fields, correlation names declared by containing SELECT functions, and to any other declared variables or constants within scope. If the whole expression cannot be evaluated by the database, the broker looks for top-level AND operators and examines each sub-expression separately. It then attempts to give the database those sub-expressions that it can evaluate, leaving the broker to evaluate the rest. You need to be aware of this situation for two reasons: 1. Apparently trivial changes to WHERE clause expressions can have large effects on performance. You can determine how much of the expression was given to the database by examining a user trace. 2. Some databases’ functions exhibit subtle differences of behavior from those of the broker.
Relation to the THE function You can use the function THE (which returns the first element of a list) in conjunction with SELECT to produce a non-list result. This is useful, for example, when a SELECT query is required to return no more than one item. It is particularly useful in conjunction with ITEM (see “ITEM selections” on page 1666).
Differences from the SQL standard ESQL SELECT differs from database SQL SELECT in the following ways: v ESQL can produce tree-structured result data v ESQL can accept arrays in SELECT clauses v ESQL has the THE function and the ITEM and INSERT parameters v ESQL has no SELECT ALL function in this release v ESQL has no ORDER BY function in this release v ESQL has no SELECT DISTINCT function in this release v ESQL has no GROUP BY or HAVING parameters in this release v ESQL has no AVG column function in this release
Restrictions The following restrictions apply to the current release: v When a SELECT command operates on more than one database table, all the tables must be in the same database instance. (That is, the TableReferences must not specify different data source names.) v If the FROM clause refers to both messages and tables, the tables must precede the messages in the list.
1668
Message Flows
v Using dynamic DSN, SCHEMA and TABLE names with ’SELECT *’ statements is not supported. If you use a schema, table or datasource name as a variable (dynamic variables) in ’SELECT *’ queries, the variables are not resolved to the correct set of schema or table names.
ROW constructor function ROW constructor is a complex function used to explicitly generate rows of values that can be assigned to fields in an output message.
Syntax
<< , << ROW
( expression
)
AS fieldreference
A ROW consists of a sequence of named values. When assigned to a field reference it creates that sequence of named values as child fields of the referenced field. A ROW cannot be assigned to an array field reference. Examples: Example 1 SET OutputRoot.XMLNS.Data = ROW('granary' AS bread, 'riesling' AS wine, 'stilton' AS cheese);
produces: granary <wine>riesling stilton
Example 2 Given the following XML input message body: 5 <wine>12 40
the following ESQL: SET OutputRoot.XMLNS.Data = ROW(InputBody.Proof.beer, InputBody.Proof.wine AS vin, (InputBody.Proof.gin * 2) AS special);
produces the following result:
ESQL reference
1669
5 12 <special>80
Because the values in this case are derived from field references that already have names, it is not necessary to explicitly provide a name for each element of the row, but you might choose to do so.
LIST constructor function The LIST constructor complex function is used to explicitly generate lists of values that can be assigned to fields in an output message.
Syntax
<< , << LIST
{
expression
}
A LIST consists of a sequence of unnamed values. When assigned to an array field reference (indicated by [] suffixed to the last element of the reference), each value is assigned in sequence to an element of the array. A LIST cannot be assigned to a non-array field reference. Examples: Example 1 Given the following XML message input body: <size>big red
The following ESQL: SET OutputRoot.XMLNS.Data.Result[] = LIST{InputBody.Car.colour, 'green', 'blue'};
produces the following results: red green blue
In the case of a LIST, there is no explicit name associated with each value. The values are assigned in sequence to elements of the message field array specified as the target of the assignment. Curly braces rather than parentheses are used to surround the LIST items.
1670
Message Flows
Example 2 Given the following XML input message body: Keats Shelley Wordsworth Tennyson Byron
the following ESQL: -- Copy the entire input message to the output message, -- including the XML message field array as above SET OutputRoot = InputRoot; SET OutputRoot.XMLNS.Data.Field[] = LIST{'Henri','McGough','Patten'};
Produces the following output: Henri McGough Patten
The previous members of the Data.Field[] array have been discarded. Assigning a new list of values to an already existing message field array removes all the elements in the existing array before the new ones are assigned.
ROW and LIST combined ROW and LIST combined form a complex function. A ROW might validly be an element in a LIST. For example: SET OutputRoot.XMLNS.Data.Country[] = LIST{ROW('UK' AS name,'pound' AS currency), ROW('US' AS name, 'dollar' AS currency), 'default'};
produces the following result: UK <currency>pound US <currency>dollar default
ROW and non-ROW values can be freely mixed within a LIST. A LIST cannot be a member of a ROW. Only named scalar values can be members of a ROW.
ESQL reference
1671
ROW and LIST comparisons You can compare ROWs and LISTs against other ROWs and LISTs. Examples: Example 1 IF ROW(InputBody.Data.*[1],InputBody.Data.*[2]) = ROW('Raf' AS Name,'25' AS Age) THEN ... IF LIST{InputBody.Data.Name, InputBody.Data.Age} = LIST{'Raf','25'} THEN ...
With the following XML input message body both the IF expressions in both the above statements evaluate to TRUE: Raf 25
In the comparison between ROWs, both the name and the value of each element are compared; in the comparison between LISTs only the value of each element is compared. In both cases, the cardinality and sequential order of the LIST or ROW operands being compared must be equal in order for the two operands to be equal. In other words, all the following are false because either the sequential order or the cardinality of the operands being compared do not match: ROW('alpha' AS A, 'beta' AS B) = ROW('alpha' AS A, 'beta' AS B, 'delta' AS D) ROW('alpha' AS A, 'beta' AS B) = ROW('beta' AS B,'alpha' AS A) LIST{1,2,3} = LIST{1,2,3,4} LIST{3,2,1} = LIST{1,2,3}
Example 2 Consider the following ESQL: IF InputBody.Places = ROW('Ken' AS first, 'Bob' AS second, 'Kate' AS third) THEN ...
With the following XML input message body, the above IF expression evaluates to TRUE: Ken <second>Bob Kate
The presence of an explicitly-constructed ROW as one of the operands to the comparison operator results in the other operand also being treated as a ROW. Contrast this with a comparison such as: IF InputBody.Lottery.FirstDraw = InputBody.Lottery.SecondDraw THEN ...
which compares the value of the FirstDraw and SecondDraw fields, not the names and values of each of FirstDraw and SecondDraw’s child fields constructed as a ROW. Thus an XML input message body such as: wednesday 32 12
1672
Message Flows
<SecondDraw>saturday 32 12
would not result in the above IF expression being evaluated as TRUE, because the values wednesday and saturday are being compared, not the names and values of the ball fields. Example 3 Consider the following ESQL: IF InputBody.Cities.City[] = LIST{'Athens','Sparta','Thebes'} THEN ...
With the following XML input message body, the IF expression evaluates to TRUE: Athens Sparta Thebes
Two message field arrays can be compared together in this way, for example: IF InputBody.Cities.Mediaeval.City[] = InputBody.Cities.Modern.City[] THEN ... IF InputBody.Cities.Mediaeval.*[] = InputBody.Cities.Modern.*[] THEN ... IF InputBody.Cities.Mediaeval.(XML.Element)[] = InputBody.Cities.Modern.(XML.Element)[] THEN ...
With the following XML input message body, the IF expression of the first and third of the statements above evaluates to TRUE: <Mediaeval>1350 London Paris <Modern>1990 London Paris
However the IF expression of the second statement evaluates to FALSE, because the *[] indicates that all the children of Mediaeval and Modern are to be compared, not just the (XML.Element)s. In this case the values 1350 and 1990, which form nameless children of Mediaeval and Modern, are compared as well as the values of the City tags. The IF expression of the third statement above evaluates to TRUE with an XML input message body such as: <Mediaeval>1350 London Paris <Modern>1990
ESQL reference
1673
London Paris
LISTs are composed of unnamed values. It is the values of the child fields of Mediaeval and Modern that are compared, not their names.
Supported casts This topic lists the CASTs that are supported between combinations of data-types. A CAST is not supported between every combination of data-types. Those that are supported are listed below, along with the effect of the CAST. When casting, there can be a one-to-one or a many-to-one mapping between the source data-type and the target data-type. An example of a one-to-one mapping is where the source data-type is a single integer and the target data-type a single float. An example of a many-to-one mapping is where the source data consists of three integers that are converted to a single date. Table 303 lists the supported one-to-one casts. Table 304 on page 1681 lists the supported many-to-one casts. See “ESQL data types” on page 284 for information about precision, scale, and interval qualifier. Table 303. Supported casts: one-to-one mappings of source to target data-type Source data-type
Target data-type
Effect
BIT
BIT
The result is the same as the input.
BIT
BLOB
The bit array is converted to a byte array with a maximum of 263 elements. An error is reported if the source is not of a suitable length to produce a BLOB (that is a multiple of 8).
BIT
CHARACTER
The result is a string conforming to the definition of a bit string literal whose interpreted value is the same as the source value. The resulting string has the form B’bbbbbb’ (where b is either 0 or 1). If you specify either a CCSID or ENCODING clause, the bit array is assumed to be characters in the specified CCSID and encoding, and is code-page converted into the character return value. If you specify only a CCSID, big endian encoding is assumed. If you specify only an encoding, a CCSID of 1208 is assumed. This function reports conversion errors if the code page or encoding are unknown, the data supplied is not an integral number of characters of the code page, or the data contains characters that are not valid in the given code page.
BIT
INTEGER
The bit array has a maximum of 263 elements and is converted to an integer. An error is reported if the source is not of the correct length to match an integer.
BLOB
BIT
The given byte array is converted to a bit array with a maximum of 263 elements.
BLOB
BLOB
The result is the same as the input.
1674
Message Flows
Table 303. Supported casts: one-to-one mappings of source to target data-type (continued) Source data-type
Target data-type
Effect
BLOB
CHARACTER
The result is a string conforming to the definition of a binary string literal whose interpreted value is the same as the source value. The resulting string has the form X’hhhh’ (where h is any hexadecimal character). If you specify either a CCSID or ENCODING clause, the byte array is assumed to be characters in the specified CCSID and encoding, and is code-page converted into the character return value. If you specify only a CCSID, big endian encoding is assumed. If you specify only an encoding, a CCSID of 1208 is assumed. This function reports conversion errors if the code page or encoding are unknown, the data supplied is not an integral number of characters of the code page, or the data contains characters that are not valid in the given code page.
BLOB
INTEGER
The byte array has a maximum of 263 elements and is converted to an integer. An error is reported if the source is not of the correct length to match an integer.
BOOLEAN
BOOLEAN
The result is the same as the input.
BOOLEAN
CHARACTER
If the source value is TRUE, the result is the character string TRUE. If the source value is FALSE, the result is the character string FALSE. Because the UNKNOWN Boolean value is the same as the NULL value for Booleans, the result is NULL if the source value is UNKNOWN.
CHARACTER
BIT
The character string must conform to the rules for a bit string literal or for the contents of the bit string literal. That is, the character string can be of the form B’bbbbbbb’ or bbbbbb (where b’ can be either 0 or 1). If you specify either a CCSID or ENCODING clause, the character string is converted into the specified CCSID and encoding and placed without further conversion into the bit array return value. If you specify only a CCSID, big endian encoding is assumed. If you specify only an encoding, a CCSID of 1208 is assumed. This function reports conversion errors if the code page or encoding are unknown or the data contains Unicode characters that cannot be converted to the given code page.
ESQL reference
1675
Table 303. Supported casts: one-to-one mappings of source to target data-type (continued) Source data-type
Target data-type
Effect
CHARACTER
BLOB
This cast can work in two ways: 1. If you specify either a CCSID or ENCODING clause, the whole string is written out in the code page or encoding that you requested. For example, the string ″Cat″ in CCSID 850 becomes the three-byte array in hexadecimal, 43,61,74. 2.
If you specify neither the CCSID nor ENCODING clause, the string must itself contain two-character hexadecimal digits of the form X’hhhhhh’ or hhhhhh (where h can be any hexadecimal characters). In this case, the input string ″436174″ becomes the same three-byte binary array (43,61,74). Note that an error is generated if the input string is not of the correct format.
If you specify only a CCSID, big endian encoding is assumed. If you specify only an encoding, a CCSID of 1208 is assumed. This function reports conversion errors if the code page or encoding are unknown or the data contains Unicode characters that cannot be converted to the given code page. CHARACTER
BOOLEAN
The character string is interpreted in the same way as a Boolean literal. That is, the character string must be one of the strings TRUE, FALSE, or UNKNOWN (in any case combination).
CHARACTER
CHARACTER
The result is the same as the input.
CHARACTER
DATE
If a FORMAT clause is not specified, the character string must conform to the rules for a date literal or the date string. That is, the character string can be either DATE ’2002-10-05’ or 2002-10-05. See also “Formatting and parsing dateTimes as strings” on page 1656.
CHARACTER
DECIMAL
The character string is interpreted in the same way as an exact numeric literal to form a temporary decimal result with a scale and precision defined by the format of the string. This is converted into a decimal of the specified precision and scale, with a runtime error being generated if the conversion results in loss of significant digits. If you do not specify the precision and scale, the precision and scale of the result are the minimum necessary to hold the given value. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing numbers as strings” on page 1654.
CHARACTER
FLOAT
The character string is interpreted in the same way as a floating point literal. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing numbers as strings” on page 1654.
CHARACTER
GMTTIME
The character string must conform to the rules for a GMT time literal or the time string. That is, the character string can be either GMTTIME ’09:24:15’ or 09:24:15. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
1676
Message Flows
Table 303. Supported casts: one-to-one mappings of source to target data-type (continued) Source data-type
Target data-type
Effect
CHARACTER
GMTTIMESTAMP
The character string must conform to the rules for a GMT timestamp literal or the timestamp string. That is, the character string can be either GMTTIMESTAMP ’2002-10-05 09:24:15’ or 2002-10-05 09:24:15. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
CHARACTER
INTEGER
The character string is interpreted in the same way as an integer literal. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing numbers as strings” on page 1654.
CHARACTER
INTERVAL
The character string must conform to the rules for an interval literal with the same interval qualifier as specified in the CAST function, or it must conform to the rules for an interval string that apply for the specified interval qualifier.
CHARACTER
TIME
The character string must conform to the rules for a time literal or for the time string. That is, the character string can be either TIME ’09:24:15’ or 09:24:15. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
CHARACTER
TIMESTAMP
The character string must conform to the rules for a timestamp literal or for the timestamp string. That is, the character string can be either TIMESTAMP ’2002-10-05 09:24:15’ or 2002-10-05 09:24:15. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
DATE
CHARACTER
The result is a string conforming to the definition of a date literal, whose interpreted value is the same as the source date value. For example: CAST(DATE '2002-10-05' AS CHARACTER) returns DATE '2002-10-05' The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
DATE
DATE
The result is the same as the input.
DATE
GMTTIMESTAMP
The result is a value whose date fields are taken from the source date value, and whose time fields are taken from the current GMT time.
DATE
TIMESTAMP
The result is a value whose date fields are taken from the source date value, and whose time fields are taken from the current time.
DECIMAL
CHARACTER
The result is the shortest character string that conforms to the definition of an exact numeric literal and whose interpreted value is the value of the decimal. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing numbers as strings” on page 1654.
DECIMAL
DECIMAL
The value is converted to the specified precision and scale, with a runtime error being generated if the conversion results in loss of significant digits. If you do not specify the precision and scale, the value, precision and scale are preserved; it is a NOOP (no operation).
ESQL reference
1677
Table 303. Supported casts: one-to-one mappings of source to target data-type (continued) Source data-type
Target data-type
Effect
DECIMAL
FLOAT
The number is converted, with rounding if necessary.
DECIMAL
INTEGER
The value is rounded and converted into an integer, with a runtime error being generated if the conversion results in loss of significant digits.
DECIMAL
INTERVAL
If the interval qualifier specified has only one field, the result is an interval with that qualifier with the field equal to the value of the exact numeric. Otherwise a runtime error is generated.
FLOAT
CHARACTER
The result is the shortest character string that conforms to the definition of an approximate numeric literal and whose mantissa consists of a single digit that is not 0, followed by a period and an unsigned integer, and whose interpreted value is the value of the float. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing numbers as strings” on page 1654.
FLOAT
FLOAT
The result is the same as the input.
FLOAT
DECIMAL
The value is rounded and converted into a decimal of the specified precision and scale, with a runtime error being generated if the conversion results in loss of significant digits. If you do not specify the precision and scale, the precision and scale of the result are the minimum necessary to hold the given value.
FLOAT
INTEGER
The value is rounded and converted into an integer, with a runtime error being generated if the conversion results in loss of significant digits.
FLOAT
INTERVAL
If the specified interval qualifier has only one field, the result is an interval with that qualifier with the field equal to the value of the numeric. Otherwise a runtime error is generated.
GMTTIME
CHARACTER
The result is a string conforming to the definition of a GMTTIME literal whose interpreted value is the same as the source value. The resulting string has the form GMTTIME ’hh:mm:ss’. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
GMTTIME
GMTTIME
The result is the same as the input.
GMTTIME
TIME
The resulting value is the source value plus the local time zone displacement (as returned by LOCAL_TIMEZONE). The hours field is calculated modulo 24.
GMTTIME
GMTTIMESTAMP
The result is a value whose date fields are taken from the current date, and whose time fields are taken from the source GMT time.
GMTTIME
TIMESTAMP
The result is a value whose date fields are taken from the current date, and whose time fields are taken from the source GMT time, plus the local time zone displacement (as returned by LOCAL_TIMEZONE).
GMTTIMESTAMP
CHARACTER
The result is a string conforming to the definition of a GMTTIMESTAMP literal whose interpreted value is the same as the source value. The resulting string has the form GMTTIMESTAMP ’yyyy-mm-dd hh:mm:ss’. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
GMTTIMESTAMP
1678
Message Flows
DATE
The result is a value whose fields consist of the date fields of the source GMTTIMESTAMP value.
Table 303. Supported casts: one-to-one mappings of source to target data-type (continued) Source data-type
Target data-type
Effect
GMTTIMESTAMP
GMTTIME
The result is a value whose fields consist of the time fields of the source GMTTIMESTAMP value.
GMTTIMESTAMP
TIME
The result is a value whose time fields are taken from the source GMTTIMESTAMP value, plus the local time zone displacement (as returned by LOCAL_TIMEZONE). The hours field is calculated modulo 24.
GMTTIMESTAMP
GMTTIMESTAMP
The result is the same as the input.
GMTTIMESTAMP
TIMESTAMP
The resulting value is source value plus the local time zone displacement (as returned by LOCAL_TIMEZONE).
INTEGER
BIT
The given integer is converted to a bit array with a maximum of 263 elements.
INTEGER
BLOB
The given integer is converted to a byte array with a maximum of 263 elements.
INTEGER
CHARACTER
The result is the shortest character string that conforms to the definition of an exact numeric literal and whose interpreted value is the value of the integer. The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing numbers as strings” on page 1654.
INTEGER
FLOAT
The number is converted, with rounding if necessary.
INTEGER
INTEGER
The result is the same as the input.
INTEGER
DECIMAL
The value is converted into a decimal of the specified precision and scale, with a runtime error being generated if the conversion results in loss of significant digits. If you do not specify the precision and scale, the precision and scale of the result are the minimum necessary to hold the given value.
INTEGER
INTERVAL
If the interval qualifier specified has only one field, the result is an interval with that qualifier with the field equal to the value of the exact numeric. Otherwise a runtime error is generated.
INTERVAL
CHARACTER
The result is a string conforming to the definition of an INTERVAL literal, whose interpreted value is the same as the source interval value. For example: CAST(INTERVAL '4' YEARS AS CHARACTER) returns INTERVAL '4' YEARS
INTERVAL
DECIMAL
If the interval value has a qualifier that has only one field, the result is a decimal of the specified precision and scale with that value, with a runtime error being generated if the conversion results in loss of significant digits. If the interval has a qualifier with more than one field, such as YEAR TO MONTH, a runtime error is generated. If you do not specify the precision and scale, the precision and scale of the result are the minimum necessary to hold the given value.
INTERVAL
FLOAT
If the interval value has a qualifier that has only one field, the result is a float with that value. If the interval has a qualifier with more than one field, such as YEAR TO MONTH, a runtime error is generated.
INTERVAL
INTEGER
If the interval value has a qualifier that has only one field, the result is an integer with that value. If the interval has a qualifier with more than one field, such as YEAR TO MONTH, a runtime error is generated. ESQL reference
1679
Table 303. Supported casts: one-to-one mappings of source to target data-type (continued) Source data-type
Target data-type
Effect
INTERVAL
INTERVAL
The result is the same as the input. Year-month intervals can be converted only to year-month intervals, and day-second intervals only to day-second intervals. The source interval is converted into a scalar in units of the least significant field of the target interval qualifier. This value is normalized into an interval with the target interval qualifier. For example, to convert an interval that has the qualifier MINUTE TO SECOND into an interval with the qualifier DAY TO HOUR, the source value is converted into a scalar in units of hours, and this value is normalized into an interval with qualifier DAY TO HOUR.
TIME
CHARACTER
The result is a string conforming to the definition of a TIME literal, whose interpreted value is the same as the source time value. For example: CAST(TIME '09:24:15' AS CHARACTER) returns TIME '09:24:15' The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
TIME
GMTTIME
The result value is the source value minus the local time zone displacement (as returned by LOCAL_TIMEZONE). The hours field is calculated modulo 24.
TIME
GMTTIMESTAMP
The result is a value whose date fields are taken from the current date, and whose time fields are taken from the source GMT time, minus the local time zone displacement (as returned by LOCAL_TIMEZONE).
TIME
TIME
The result is the same as the input.
TIME
TIMESTAMP
The result is a value whose date fields are taken from the current date, and whose time fields are taken from the source time value.
TIMESTAMP
CHARACTER
The result is a string conforming to the definition of a TIMESTAMP literal, whose interpreted value is the same as the source timestamp value. For example: CAST(TIMESTAMP '2002-10-05 09:24:15' AS CHARACTER) returns TIMESTAMP '2002-10-05 09:24:15' The behavior changes if the FORMAT clause is specified. See also “Formatting and parsing dateTimes as strings” on page 1656.
TIMESTAMP
DATE
The result is a value whose fields consist of the date fields of the source timestamp value.
TIMESTAMP
GMTTIME
The result is a value whose time fields are taken from the source TIMESTAMP value, minus the local time zone displacement (as returned by LOCAL_TIMEZONE). The hours field is calculated modulo 24.
TIMESTAMP
GMTTIMESTAMP
The resulting value is the source value minus the local time zone displacement (as returned by LOCAL_TIMEZONE).
TIMESTAMP
TIME
The result is a value whose fields consist of the time fields of the source timestamp value.
1680
Message Flows
Table 303. Supported casts: one-to-one mappings of source to target data-type (continued) Source data-type
Target data-type
Effect
TIMESTAMP
TIMESTAMP
The result is the same as the input.
Table 304. Supported casts: many-to-one mappings of source to target data-type Source data-type
Target data-type
Effect
Numeric, Numeric, Numeric
DATE
Creates a DATE value from the numerics in the order year, month, and day. Non-integer values are rounded.
Numeric, Numeric, Numeric
TIME
Creates a TIME value from the numerics in the order hours, minutes, and seconds. Non-integer values for hours and minutes are rounded.
Numeric, Numeric, Numeric
GMTIME
Creates a GMTTIME value from the numerics in the order of hours, minutes, and seconds. Non-integer values for hours and minutes are rounded.
Numeric, Numeric, Numeric, Numeric, Numeric, Numeric
TIMESTAMP
Creates a TIMESTAMP value from the numerics in the order years, months, days, hours, minutes, and seconds. Non-integer values for years, months, days, hours, and minutes are rounded.
Numeric, Numeric, Numeric, Numeric, Numeric, Numeric
GMTTIMESTAMP
Creates a GMTIMESTAMP value from the numerics in the order years, months, days, hours, minutes, and seconds. Non-integer values for years, months, days, hours, and minutes are rounded.
DATE, TIME
TIMESTAMP
The result is a TIMESTAMP value with the given DATE and TIME.
DATE, GMTTIME
GMTIMESTAMP
The result is a GMTTIMESTAMP value with the given DATE and GMTTIME.
Numeric, Numeric
INTERVAL YEAR TO MONTH
The result is an INTERVAL with the first source as years and the second as months. Non-integer values are rounded.
Numeric, Numeric
INTERVAL HOUR TO MINUTE
The result is an INTERVAL with the first source as hours and the second as minutes. Non-integer values are rounded.
Numeric, Numeric, Numeric
INTERVAL HOUR TO SECOND
The result is an INTERVAL with the sources as hours, minutes, and seconds, respectively. Non-integer values for hours and minutes are rounded.
Numeric, Numeric
INTERVAL MINUTE The result is an INTERVAL with the sources as minutes and seconds, TO SECOND respectively. Non-integer values for minutes are rounded.
Numeric, Numeric
INTERVAL DAY TO HOUR
The result is an INTERVAL with the sources as days and hours, respectively. Non-integer values are rounded.
Numeric, Numeric, Numeric
INTERVAL DAY TO MINUTE
The result is an INTERVAL with the sources as days, hours, and minutes, respectively. Non-integer values are rounded.
Numeric, Numeric, Numeric, Numeric
INTERVAL DAY TO SECOND
The result is an INTERVAL with the sources as days, hours, minutes, and seconds, respectively. Non-integer values for days, hours, and minutes are rounded.
Numeric
INTERVAL YEAR
The result is an INTERVAL with the source as years, rounded if necessary.
Numeric
INTERVAL MONTH The result is an INTERVAL with the source as months, rounded if necessary.
Numeric
INTERVAL DAY
The result is an INTERVAL with the source as days, rounded if necessary.
Numeric
INTERVAL HOUR
The result is an INTERVAL with the source as hours, rounded if necessary.
Numeric
INTERVAL MINUTE The result is an INTERVAL with the source as minutes, rounded if necessary.
ESQL reference
1681
Table 304. Supported casts: many-to-one mappings of source to target data-type (continued) Source data-type
Target data-type
Effect
Numeric
INTERVAL SECOND
The result is an INTERVAL with the source as seconds.
Implicit casts This topic discusses implicit casts. It is not always necessary to cast values between types. Some casts are done implicitly. For example, numbers are implicitly cast between the three numeric types for the purposes of comparison and arithmetic. Character strings are also implicitly cast to other data types for the purposes of comparison. There are three situations in which a data value of one type is cast to another type implicitly. The behavior and restrictions of the implicit cast are the same as described for the explicit cast function, except where noted in the topics listed below.
Implicit CASTs for comparisons The standard SQL comparison operators>, <,>=, <=, =, <> are supported for comparing two values in ESQL. When the data types of the two values are not the same, one of them can be implicitly cast to the type of the other to allow the comparison to proceed. In the table below, the vertical axis represents the left hand operand, the horizontal axis represents the right hand operand. L means that the right hand operand is cast to the type of the left hand operand before comparison; R means the opposite; X means that no implicit casting takes place; a blank means that comparison between the values of the two data types is not supported. ukn
bln
int
float
dec
char
time
gtm
date
ts
gts
ivl
blob
bit
R
R
R
R1
R
R
ukn bln
X
L
int
X
R
R
L
float
L
X
L
L
dec
L
R
X
L
R
R
R
X
R
R
tm
L
X
L
gtm
L
R
X
dt
L
X
R2
R2
ts
L
L2
X
L
L
2
R
X
chr
R
gts ivl
L
blb
L
bit
L
1682
Message Flows
L 1
X X X
ukn
bln
int
float
dec
char
time
gtm
date
ts
gts
ivl
blob
bit
Notes: 1. When casting from a character string to an interval, the character string must be of the format INTERVAL ’’ . The format , which is allowede for an explicit CAST, is not allowed here because no qualifier external to the string is supplied. 2. When casting from a DATE to a TIMESTAMP or GMTTIMESTAMP, the time portion of the TIMESTAMP is set to all zero values (00:00:00). This is different from the behavior of the explicit cast, which sets the time portion to the current time.
Numeric types: The comparison operators operate on all three numeric types. Character strings: You cannot define an alternative collation order that, for example, collates upper and lowercase characters equally. When comparing character strings, trailing blanks are not significant, so the comparison 'hello' = 'hello ' returns true. Datetime values: Datetime values are compared in accordance with the natural rules of the Gregorian calendar and clock. You can compare the time zone you are working in with the GMT time zone. The GMT time zone is converted into a local time zone based on the difference between your local time zone and the GMT time specified. When you compare your local time with the GMT time, the comparison is based on the difference at a given time on a given date. Conversion is always based on the value of LOCAL_TIMEZONE. This is because GMT timestamps are converted to local timestamps only if it can be done unambiguously. Converting a local timestamp to a GMT timestamp has difficulties around the daylight saving cut-over time, and converting between times and GMT times (without date information) has to be done based on the LOCAL_TIMEZONE value, because you cannot specify which time zone difference to use otherwise. Booleans: Boolean values can be compared using all the normal comparison operators. The TRUE value is defined to be greater than the FALSE value. Comparing either value to the UNKNOWN Boolean value (which is equivalent to NULL) returns an UNKNOWN result. Intervals: Intervals are compared by converting the two interval values into intermediate representations, so that both intervals have the same interval qualifier. Year-month intervals can be compared only with other year-month intervals, and day-second intervals can be compared only with other day-second intervals. For example, if an interval in minutes, such as INTERVAL '120' MINUTE is compared with an interval in days to seconds, such as INTERVAL '0 02:01:00', the two ESQL reference
1683
intervals are first converted into values that have consistent interval qualifiers, which can be compared. So, in this example, the first value is converted into an interval in days to seconds, which gives INTERVAL '0 02:00:00', which can be compared with the second value. Comparing character strings with other types: If a character string is compared with a value of another type, WebSphere Message Broker attempts to cast the character string into a value of the same data type as the other value. For example, you can write an expression: '1234'> 4567
The character string on the left is converted into an integer before the comparison takes place. This behavior reduces some of the need for explicit CAST operators when comparing values derived from a generic XML message with literal values. (For details of explicit casts that are supported, see “Supported casts” on page 1674.) It is this facility that allows you to write the following expression: Body.Trade.Quantity> 5000
In this example, the field reference on the left evaluates to the character string ’1000’ and, because this is being compared to an integer, that character string is converted into an integer before the comparison takes place. You must still check whether the price field that you want interpreted as a decimal is greater than a given threshold. Make sure that the literal you compare it to is a decimal value and not an integer. For example: Body.Trade.Price> 100
does not have the desired effect, because the Price field is converted into an integer, and that conversion fails because the character string contains a decimal point. However, the following expression succeeds: Body.Trade.Price> 100.00
Implicit CASTs for arithmetic operations This topic lists the implicit CASTs available for arithmetic operations. Normally the arithmetic operators (+, -, *, and /) operate on operands of the same data type, and return a value of the same data type as the operands. Cases where it is acceptable for the operands to be of different data types, or where the data type of the resulting value is different from the type of the operands, are shown in the following table. The following table lists the implicit CASTs for arithmetic operation. Left operand data type
Right operand data type
Supported operators
Result data type
INTEGER
FLOAT
+, -, *, /
FLOAT1
INTEGER
DECIMAL
+, -, *, /
DECIMAL1
INTEGER
INTERVAL
*
INTERVAL4
1684
Message Flows
Left operand data type
Right operand data type
Supported operators
Result data type
FLOAT
INTEGER
+, -, *, /
FLOAT1
FLOAT
DECIMAL
+, -, *, /
FLOAT1
FLOAT
INTERVAL
*
INTERVAL4
DECIMAL
INTEGER
+, -, *, /
DECIMAL1
DECIMAL
FLOAT
+, -, *, /
FLOAT1
DECIMAL
INTERVAL
*
INTERVAL4
TIME
TIME
-
INTERVAL2
TIME
GMTTIME
-
INTERVAL2
TIME
INTERVAL
+, -
TIME3
GMTTIME
TIME
-
INTERVAL2
GMTTIME
GMTTIME
-
INTERVAL2
GMTTIME
INTERVAL
+, -
GMTTIME3
DATE
DATE
-
INTERVAL2
DATE
INTERVAL
+, -
DATE3
TIMESTAMP
TIMESTAMP
-
INTERVAL2
TIMESTAMP
GMTTIMESTAMP
-
INTERVAL2
TIMESTAMP
INTERVAL
+, -
TIMESTAMP3
GMTTIMESTAMP
TIMESTAMP
-
INTERVAL2
GMTTIMESTAMP
GMTTIMESTAMP
-
INTERVAL2
GMTTIMESTAMP
INTERVAL
+, -
GMTTIMESTAMP3
INTERVAL
INTEGER
*, /
INTERVAL4
INTERVAL
FLOAT
*, /
INTERVAL4
INTERVAL
DECIMAL
*, /
INTERVAL4
INTERVAL
TIME
+
TIME3
INTERVAL
GMTTIME
+
GMTTIME3
INTERVAL
DATE
+
DATE3
INTERVAL
TIMESTAMP
+
TIMESTAMP3
INTERVAL
GMTTIMESTAMP
+
GMTTIMESTAMP3
ESQL reference
1685
Left operand data type
Right operand data type
Supported operators
Result data type
Notes: 1. The operand that does not match the data type of the result is cast to the data type of the result before the operation proceeds. For example, if the left operand to an addition operator is an INTEGER, and the right operand is a FLOAT, the left operand is cast to a FLOAT before the addition operation is performed. 2. Subtracting a (GMT)TIME value from a (GMT)TIME value, a DATE value from a DATE value, or a (GMT)TIMESTAMP value from a (GMT)TIMESTAMP value, results in an INTERVAL value representing the time interval between the two operands. 3. Adding or subtracting an INTERVAL from a (GMT)TIME, DATE or (GMT)TIMESTAMP value results in a new value of the data type of the non-INTERVAL operand, representing the point in time represented by the original non-INTERVAL, plus or minus the length of time represented by the INTERVAL. 4. Multiplying or dividing an INTERVAL by an INTEGER, FLOAT, or DECIMAL value results in a new INTERVAL representing the length of time represented by the original, multiplied or divided by the factor represented by the non-INTERVAL operand. For example, an INTERVAL value of 2 hours 16 minutes multiplied by a FLOAT value of 2.5 results in a new INTERVAL value of 5 hours 40 minutes. The intermediate calculations involved in multiplying or dividing the original INTERVAL are carried out in the data type of the non-INTERVAL, but the individual fields of the INTERVAL (such as HOUR, YEAR, and so on) are always integral, so some rounding errors might occur.
Implicit CASTs for assignment Values can be assigned to one of three entities. A message field (or equivalent in an exception or destination list) Support for implicit conversion between the WebSphere Message Broker data types and the message (in its bitstream form) depends on the appropriate parser. For example, the XML parser casts everything as character strings before inserting them into the WebSphere MQ message. A field in a database table WebSphere Message Broker converts each of its data types into a suitable standard SQL C data type, as detailed in the following table. Conversion between this standard SQL C data type, and the data types supported by each DBMS, depends on the DBMS. Consult your DBMS documentation for more details. The following table lists the available conversions from WebSphere Message Broker to SQL data types
1686
Message Flows
WebSphere Message Broker data type
SQL data type
NULL, or unknown or invalid value
SQL_NULL_DATA
BOOLEAN
SQL_C_BIT
INTEGER
SQL_C_LONG
FLOAT
SQL_C_DOUBLE
DECIMAL
SQL_C_CHAR1
CHARACTER
SQL_C_CHAR
TIME
SQL_C_TIME
GMTTIME
SQL_C_TIME
DATE
SQL_C_DATE
TIMESTAMP
SQL_C_TIMESTAMP
GMTTIMESTAMP
SQL_C_DATE
WebSphere Message Broker data type
SQL data type
INTERVAL
Not supported2
BLOB
SQL_C_BINARY
BIT
Not supported2
Notes: 1. For convenience, DECIMAL values are passed to the DBMS in character form. 2. There is no suitable standard SQL C data type for INTERVAL or BIT. Cast these to another data type, such as CHARACTER, if you need to assign them to a database field.
A scalar variable When assigning to a scalar variable, if the data type of the value being assigned and that of the target variable data type are different, an implicit cast is attempted with the same restrictions and behavior as specified for the explicit CAST function. The only exception is when the data type of the variable is INTERVAL or DECIMAL. In both these cases, the value being assigned is first cast to a CHARACTER value, and an attempt is made to cast the CHARACTER value to an INTERVAL or DECIMAL. This is because INTERVAL requires a qualifier and DECIMAL requires a precision and scale. These must be specified in the explicit cast, but must be obtained from the character string when implicitly casting. Therefore, a further restriction is that when implicitly casting to an INTERVAL variable, the character string must be of the form INTERVAL ’’ . The shortened form that is acceptable for the explicit cast is not acceptable here.
Data types of values from external sources ESQL can extract data from two external sources: message fields and database columns. The ESQL data type of message fields depends on the type of the message (for example, XML), and the parser that is used to parse it. The ESQL data type of the value returned by a database column reference depends on the data type of the column in the database. The following table shows which ESQL data types the various built-in database data types are cast to, when they are accessed by message flows that are running in a broker. The versions that are supported for the database products shown in this table are listed in Supported databases. Data type
DB2
BOOLEAN
SQL Server and Sybase
Oracle
Informix
BIT
INTEGER
SMALLINT, INTEGER, BIGINT
INT, SMALLINT, TINYINT
INT, SMALLINT
FLOAT
REAL, DOUBLE
FLOAT, REAL
NUMBER()1
FLOAT, SMALLFLOAT, DOUBLE
DECIMAL
DECIMAL
DECIMAL, NUMERIC, MONEY, SMALLMONEY
NUMBER(P)1, NUMBER(P,S)1
DECIMAL, MONEY
ESQL reference
1687
Data type
DB2
SQL Server and Sybase
Oracle
Informix
CHARACTER
CHAR, VARCHAR, CLOB
CHAR, VARCHAR, TEXT
CHAR, VARCHAR2, ROWID, UROWID, LONG, CLOB
CHAR, VARCHAR, CHAR VARYING
TIME
TIME
GMTTIME DATE
DATE
DATE
TIMESTAMP
TIMESTAMP
DATETIME, SMALLDATETIME, TIMESTAMP
DATE
DATETIME
GMTTIMESTAMP INTERVAL BLOB
INTERVAL BLOB
BINARY, VARBINARY, IMAGE, UNIQUEIDENTIFIER
RAW LONG, RAW BLOB
BIT
Note: 1. If an Oracle database column with NUMBER data type is defined with an explicit precision (P) and scale (S), it is cast to an ESQL DECIMAL value; otherwise it is cast to a FLOAT. For example, an ESQL statement like this: SET OutputRoot.xxx[] = (SELECT T.department FROM Database.personnel AS T);
where Database.personnel resolves to a TINYINT column in an SQL Server database table, results in a list of ESQL INTEGER values being assigned to OutputRoot.xxx. By contrast, an identical query, where Database.personnel resolves to a NUMBER() column in an Oracle database, results in a list of ESQL FLOAT values being assigned to OutputRoot.xxx.
Miscellaneous ESQL functions This topic lists the miscellaneous ESQL functions and covers the following: “COALESCE function” “NULLIF function” on page 1689 “PASSTHRU function” on page 1689 “UUIDASBLOB function” on page 1692 “UUIDASCHAR function” on page 1692
COALESCE function COALESCE is a miscellaneous function that lets you provide default values for fields.
1688
Message Flows
Syntax
, COALESCE (
source_value
, source_value
)
The COALESCE function evaluates its parameters in order and returns the first one that is not NULL. The result is NULL if, and only if, all the arguments are NULL. The parameters can be of any scalar type, but they need not all be of the same type. Use the COALESCE function to provide a default value for a field, which might not exist in a message. For example, the expression: COALESCE(Body.Salary, 0)
returns the value of the Salary field in the message if it exists, or 0 (zero) if that field does not exist.
NULLIF function NULLIF is a miscellaneous function that returns a NULL value if the arguments are equal.
Syntax
NULLIF (
expression1
,
expression2
)
The NULLIF function returns a NULL value if the arguments are equal; otherwise, it returns the value of the first argument. The arguments must be comparable. The result of using NULLIF(e1,e2) is the same as using the expression: CASE WHEN e1=e2 THEN NULL ELSE e1 END
When e1=e2 evaluates to unknown (because one or both of the arguments is NULL), NULLIF returns the value of the first argument.
PASSTHRU function The PASSTHRU function evaluates an expression and executes the resulting character string as a database statement, returning a result set. The PASSTHRU function is similar to the PASSTHRU statement, which is described in “PASSTHRU statement” on page 1576.
ESQL reference
1689
PASSTHRU (
Expression
) TO
DatabaseReference
, VALUES
(
Expression
)
, (1) ,
Expression
WHERE: DatabaseReference =
DataSourceClause =
Database .
DataSourceClause
DataSourceName { DataSourceExpression
}
Notes: 1
The lower half of the main syntax diagram describes syntax retained for backward compatability.
Usage The main use of the PASSTHRU function is to issue complex SELECTs, not currently supported by the broker, to databases. (Examples of complex SELECTs not currently supported by the broker are those containing GROUP BY or HAVING clauses.) The first expression is evaluated and the resulting character string is passed to the database pointed to by DatabaseReference (in the TO clause) for execution. If the TO clause is not specified, the database pointed to by the node’s data source attribute is used. Use question marks (?) in the database string to denote parameters. The parameter values are supplied by the VALUES clause. If the VALUES clause is specified, its expressions are evaluated and passed to the database as parameters; (that is, the expressions’ values are substituted for the question marks in the database statement). If only one VALUE expression exists, the result might or might not be a list. If it is a list, the list’s scalar values are substituted sequentially for the question marks. If it is not a list, the single scalar value is substituted for the (single) question mark in the database statement. If more than one VALUE expression exists, none of the expressions evaluate to a list; their scalar values are substituted sequentially for the question marks instead. Because the database statement is constructed by the user program, it is not essential to use parameter markers (that is, the question marks) or the VALUES clause, because the whole of the database statement could be supplied, as a literal string, by the program. However, use parameter markers whenever possible because this reduces the number of different statements that need to be prepared and stored in the database and the broker.
1690
Message Flows
Database reference A database reference is a special instance of the field references that is used to refer to message trees. It consists of the word Database followed by the name of a data source (that is, the name of a database instance). You can specify the data source name directly or by an expression enclosed in braces ({...}). A directly-specified data source name is subject to name substitution. That is, if the name used has been declared to be a known name, the value of the declared name is used rather than the name itself (see “DECLARE statement” on page 1553). If you have created a message flow that contains one of the following nodes, and the ESQL that is associated with this node includes a PASSTHRU statement and a database reference, you must specify a value for the Data source property of the relevant node: v Compute v Database v Filter
Handling errors It is possible for errors to occur during PASSTHRU operations. For example, the database might not be operational or the statement might be invalid. In these cases, an exception is thrown (unless the node has its Throw exception on database error property cleared). These exceptions set appropriate SQL code, state, native error, and error text values and can be dealt with by error handlers (see the DECLARE HANDLER statement). For further information about handling database errors, see “Capturing database state” on page 365.
Example The following example performs a SELECT on table Table1 in schema Schema1 in database DSN1, passing two parameters to the WHERE clause and asking for the result set to be ordered in ascending name order. The result set is assigned to the SelectResult folder: SET OutputRoot.XML.Data.SelectResult.Row[] = PASSTHRU('SELECT R.* FROM Schema1.Table1 AS R WHERE R.Name = ? OR R.Name = ? ORDER BY Name' TO Database.DSN1 VALUES ('Name1', 'Name4'));
The above example assigns the result set to the OutputRoot message body tree that is owned by the Generic XML parser, which allows self-defining messages. If assigning the result set into a message tree owned by one of the MRM parsers, and the result set structure exactly matches the MRM message definition, then the result set can be assigned directly into the OutputRoot message body tree. If the result set structure does not exactly match the MRM message definition, then you must first assign the result set into a ROW data type, or an Environment tree that does not have any parsers associated with it. The required data can then be assigned to OutputRoot to build a message tree that conforms to the message definition. ESQL reference
1691
UUIDASBLOB function UUIDASBLOB is a miscellaneous function that returns universally unique identifiers (UUIDs) as BLOBs.
Syntax
UUIDASBLOB
( source_character_uuid
)
If (source_character_uuid) is not specified, UUIDASBLOB creates a new UUID and returns it as a BLOB. If (source_character_uuid) is specified, UUIDASBLOB converts an existing character UUID in the form dddddddd_dddd_dddd_dddd_dddddddddddd to the BLOB form. An exception is thrown if the parameter is not of the expected form. The result is NULL if a NULL parameter is supplied.
UUIDASCHAR function UUIDASCHAR is a miscellaneous function that returns universally unique identifiers (UUIDs) as CHARACTER values.
Syntax
UUIDASCHAR
( source_blob_uuid
)
If (source_character_uuid) is not specified, UUIDASCHAR creates a new UUID and returns it as a CHARACTER value. If (source_character_uuid) is specified, UUIDASCHAR converts an existing BLOB UUID to the character form. The result is NULL if a NULL parameter is supplied.
ESQL constants Use these constants to make or parse a bitstream.
1692
Message Flows
ESQL constants in the Mapping node
Corresponding ESQL constants
$esql:RootBitStream
RootBitStream
$esql:FolderBitStream
FolderBitStream
$esql:ValidateContentAndValue
ValidateContentAndValue
$esql:ValidateValue
ValidateValue
$esql:ValidateContent
ValidateContent
ESQL constants in the Mapping node
Corresponding ESQL constants
$esql:ValidateNone
ValidateNone
$esql:ValidateException
ValidateException
$esql:ValidateExceptionList
ValidateExceptionList
$esql:ValidateLocalError
ValidateLocalError
$esql:ValidateUserTrace
ValidateUserTrace
$esql:ParseComplete
ParseComplete
$esql:ParseImmediate
ParseImmediate
$esql:ParseOnDemand
ParseOnDemand
Broker properties that are accessible from ESQL and Java You can access broker, message flow, and node properties from ESQL and Java. The following table shows the properties that are available to ESQL and Java code. The fourth column indicates whether the properties are also accessible from Java nodes. If a property is listed as being accessible from Java nodes, it is accessible from Java nodes only, not from Java routines that are called as ESQL functions or procedures. For a complete overview of broker properties, see “Broker properties” on page 118.
ESQL reference
1693
Property type
General broker properties 1
Property name
Return type
From Java nodes? 2
BrokerDataSourceUserId
Character
Yes
BrokerDataSource
Character
No
The ODBC Data Source Name (DSN) of the database that contains the broker’s tables.
BrokerName
Character
Yes3
The name of the broker.
BrokerUserId
Character
No
The user ID that the broker uses to access its database tables.
BrokerVersion
Character
No
The 4-character version number of the broker (see “BrokerVersion” on page 1696).
ExecutionGroupLabel
Character
Yes4
The label of the Execution Group (a human-readable name).
ExecutionGroupName
Character
No
The name of the Execution Group (often a UUID identifier).
Family
Character
No
The generic name of the software platform that the broker is running on ('WINDOWS', 'UNIX', or 'ZOS').
ProcessId
Integer
No
The process identifier (PID) of the DataFlowEngine.
QueueManagerName
Character
Yes5
The name of the WebSphere MQ queue manager to which the broker is connected.
WorkPath
Character
No
(Optional) The directory in which working files for this broker are stored.
AdditionalInstances
Integer
No
The number of additional threads that the broker can use to service the message flow.
CommitCount
Integer
No
How many input messages are processed by the message flow before a syncpoint is taken.
CommitInterval
Integer
No
The time interval at which a commit is taken when the CommitCount property is greater than 1 (that is, where the message flow is batching messages), but the number of messages processed has not reached the value of the CommitCount property.
CoordinatedTransaction
Boolean
Yes6
Whether or not the message flow is processed as a global transaction, coordinated by WebSphere MQ.
MessageFlowLabel
Character
Yes7
The name of the flow.
Flow properties
1694
What is it?
Message Flows
The data source user ID used by the broker.
Property type
Node properties
From Java nodes?
Property name
Return type
What is it?
DataSource
Character
No
The ODBC Data Source Name (DSN) of the database in which the user tables are created.
DataSourceUserId
Character
No
The user ID that the broker uses to access the database user tables.
MessageOptions
Integer (64-bit)
No
The bitstream and validation options in force.
NodeLabel
Character
Yes8
The name of the node.
NodeType
Character
No
The type of node (Compute, Filter, or Database).
ThrowExceptionOnDatabaseError Boolean
Yes9
Whether the broker generates an exception when a database error is detected.
TransactionType
Character
Yes10
The type of transaction (Automatic or commit) used to access a database from this node.
TreatWarningsAsErrors
Boolean
Yes11
Whether database warning messages are treated as errors and cause the output message to be propagated to the failure terminal.
Notes: 1. The only broker-defined properties that can be used in a Trace node are those in the “General broker properties” group. For example, you could specify the Pattern setting of a Trace node as: #### Start Trace Input Message Time: ${CURRENT_TIMESTAMP} Broker: ${BrokerName} Version: ${BrokerVersion} Platform: ${Family} ProcessID: ${ProcessId} BrokerUserId: ${BrokerUserId} ExecutionGroupLabel: ${ExecutionGroupLabel} Transaction: ${Transaction} Root Tree: ${Root} #### End Trace Input Message
2. Accessible through: a. MbNode.getBroker() b. MbBroker.getDataSourceUserId() 3. Accessible through: a. MbNode.getBroker() b. MbBroker.getName() 4. Accessible through: a. MbNode.getExecutionGroup() b. MbExecutionGroup.getName() 5. Accessible through: a. MbNode.getBroker() b. MbBroker.getQueueManagerName() 6. Accessible through: a. MbNode.getMessageFlow() b. MbMessageFlow.isCoordinatedTransaction() 7. Accessible through: a. MbNode.getMessageFlow() ESQL reference
1695
8. 9. 10. 11.
b. MbMessageFlow.getName() Accessible through MbNode.getName() Accessible through MbSQL.getThrowExceptionOnDatabaseError() Accessible through MbSQL.getTransactionType() Accessible through MbSQL.getTreatWarningsAsErrors()
BrokerVersion The BrokerVersion property contains a 4-character code that indicates the version of the broker. The code is based on the IBM Version/Release/Modification/Fix pack (VRMF) product-numbering system. The VRMF code works like this: V
The Version number. A Version is a separate IBM licensed program that usually has significant new code or new function. Each version has its own license, terms, and conditions.
R
The Release number. A Release is a distribution of new function and authorized program analysis report (APAR) fixes for an existing product.
M
The Modification number. A Modification is new function added to an existing product, and is delivered separately from an announced Version or Release.
F
The Fix pack number. Fix packs contain defect and APAR fixes. They do not contain new function. A fix pack is cumulative: that is, it contains all the fixes shipped in previous maintenance to the release, including previous fix packs. It can be applied on top of any previously-shipped maintenance to bring the system up to the current fix pack level.
Special characters, case sensitivity, and comments in ESQL This topic describes the special characters used in ESQL, case sensitivity, and how comments are handled in the following sections: v “Special characters” v “Case sensitivity of ESQL syntax” on page 1697 v “Comments” on page 1697
Special characters
1696
Message Flows
Symbol
Name
Usage
;
semicolon
End of ESQL statement
.
period
Field reference separator or decimal point
=
equals
Comparison or assignment
>
greater than
Comparison
<
less than
Comparison
[]
square brackets
Array subscript
Symbol
Name
Usage
’
single quotation mark
Delimit string, date-time, and decimal literals Note, that to escape a single quotation mark inside a string literal, you must use two single quotation marks.
||
double vertical bar
Concatenation
()
parentheses
Expression delimiter
″
quotation mark
Identifier delimiter
*
asterisk
Any name or multiply
+
plus
Arithmetic add
-
minus
Arithmetic subtract, date separator, or negation
/
forward slash
Arithmetic divide
_
underscore
LIKE single wild card
%
percent
LIKE multiple wild card
\
backslash
LIKE escape character
:
colon
Name space and Time literal separator
,
comma
List separator
<>
less than greater than
Not equals
--
double minus
ESQL single line comment
/* */
slash asterisk asterisk slash
ESQL multiline comment
?
question mark
Substitution variable in PASSTHRU
<=
less than or equal
Comparison
>=
greater than or equal
Comparison
/*!{ }!*/
executable comment
Bypass tools check
Case sensitivity of ESQL syntax The case of ESQL statements is: v Case sensitive in field reference literals v Not case sensitive in ESQL language words
Comments ESQL has two types of comment: single line and multiple line. A single line comment starts with the characters -- and ends at the end of the line. In arithmetic expressions you must take care not to initiate a line comment accidentally. For example, consider the expression: 1 - -2
Removing all white space from the expression results in: 1--2 ESQL reference
1697
which is interpreted as the number 1, followed by a line comment. A multiple line comment starts with /* anywhere in ESQL and ends with */.
ESQL reserved keywords The following keywords are reserved in uppercase, lowercase, or mixed case. You cannot use these keywords for variable names. However, you can use reserved keywords as names in a field reference. ALL
ASYMMETRIC
BOTH
CASE
DISTINCT
FROM
ITEM
LEADING
NOT
SYMMETRIC
TRAILING
WHEN
ESQL non-reserved keywords The following keywords are used in the ESQL language but are not reserved. Do not use them for variable, function, or procedure names (in any combination of upper and lower case) because your code can become difficult to understand. v AND v ANY v AS v ATOMIC v ATTACH v BEGIN v BETWEEN v BIT v BLOB v BOOLEAN v BY v CALL v CATALOG v CCSID v CHAR v CHARACTER v COMPUTE v CONDITION v CONSTANT v CONTINUE v COORDINATED v COUNT v CREATE v CURRENT_DATE v CURRENT_GMTDATE v CURRENT_GMTTIME v CURRENT_GMTTIMESTAMP v CURRENT_TIME v CURRENT_TIMESTAMP v DATA v DATABASE v DATE v DAY
1698
Message Flows
v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v
DAYOFWEEK DAYOFYEAR DAYS DECIMAL DECLARE DEFAULT DELETE DETACH DO DOMAIN DYNAMIC ELSE ELSEIF ENCODING END ENVIRONMENT ESCAPE ESQL EVAL EVENT EXCEPTION EXISTS EXIT EXTERNAL FALSE FIELD FILTER FINALIZE FIRSTCHILD FLOAT FOR FORMAT FOUND FULL FUNCTION GMTTIME GMTTIMESTAMP GROUP HANDLER HAVING HOUR IDENTITY IF IN INF INFINITY INOUT INSERT INT INTEGER INTERVAL INTO IS ISLEAPYEAR ITERATE JAVA ESQL reference
1699
v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v
1700
Message Flows
LABEL LANGUAGE LAST LASTCHILD LEAVE LIKE LIST LOCALTIMEZONE LOG LOOP MAX MESSAGE MIN MINUTE MODIFIES MODULE MONTH MONTHS MOVE NAME NAMESPACE NAN NEXTSIBLING NONE NULL NUM NUMBER OF OPTIONS OR ORDER OUT PARSE PASSTHRU PATH PLACING PREVIOUSSIBLING PROCEDURE PROPAGATE QUARTEROFYEAR QUARTERS READS REFERENCE REPEAT RESIGNAL RESULT RETURN RETURNS ROW SAMEFIELD SCHEMA SECOND SELECT SET SETS SEVERITY
v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v
SHARED SHORT SOME SQL SQLCODE SQLERRORTEXT SQLEXCEPTION SQLNATIVEERROR SQLSTATE SQLWARNING SUM TERMINAL THE THEN THROW TIME TIMESTAMP TO TRACE TRUE TYPE UNCOORDINATED UNKNOWN UNTIL UPDATE USER UUIDASBLOB UUIDASCHAR VALUE VALUES WEEKOFMONTH WEEKOFYEAR WEEKS WHERE WHILE YEAR
Example message This topic defines the example message that is used in many of the examples throughout the information center. The example message is: 300524 2000-12-07 12:40:00 <TillNumber>3 Mary Andrew Smith <Title>Mr 20-01-70 01962818000 ESQL reference
1701
14 High Street Hursley Village Hampshire SO213JR <Payment> Visa 4921682832258418 Mr Andrew J. Smith 1200 <Expires>1101 - <Title Category="Computer" Form="Paperback" Edition="2">The XML Companion
0201674866 Neil Bradley Addison-Wesley October 1999 27.95 2 - <Title Category="Computer" Form="Paperback" Edition="2">A Complete Guide to DB2 Universal Database
1558604820 Don Chamberlin Morgan Kaufmann Publishers April 1998 42.95 1 - <Title Category="Computer" Form="Hardcover" Edition="0">JAVA 2 Developers Handbook
0782121799 Philip Heller, Simon Roberts Sybex, Inc. September 1998 59.99 1 <StoreRecords/> <Error/>
For a diagrammatic representation of this message, and for examples of how this message can be manipulated with ESQL statements and functions, refer to “Writing ESQL” on page 305.
1702
Message Flows
Message mappings You edit and configure message maps using the Message Mapping editor. This section contains topics that provide reference information about message mapping: v “Message Mapping editor” – Source pane – Target pane – Edit pane – Spreadsheet pane v “Mapping node” on page 1714 – Syntax – Functions – Casts v “Migrating message mappings from Version 5.0” on page 1725 – Migration restrictions
Message Mapping editor You configure a message mapping using the Message Mapping editor, which you use to set values for: v the message destination v message headers v message content Here is an example of the Message Mapping editor. There are separate panes for working with sources, targets and expressions, as well as a spreadsheet view.
© Copyright IBM Corp. 2000, 2008
1703
1
2
3
4
1. Source pane: displays a source message or database table 2. Target pane: displays a target message 3. Edit pane: displays the expression to be used to derive the target element value 4. Spreadsheet pane: displays a summary of the mappings in spreadsheet columns (each target field and its value) Use the Message Mapping editor to perform various mapping tasks. Wizards and dialog boxes are provided for tasks such as adding mappable elements, working with ESQL, and working with submaps. Mappings that are created with the Message Mapping editor are automatically validated and compiled, ready for adding to a broker archive (BAR) file, and subsequent deployment to WebSphere Message Broker.
Message Mapping editor Source pane Details of the elements present in the Source pane of the Message Mapping Editor. The following example shows the “Message Mapping editor” on page 1703. The pane that is labelled as 1 in the example is the Source pane:
1704
Message Flows
1
2
3
4
The following list describes the elements that are present in the Source pane: v A source message is identified by $source. v A source database is identified by $db:select. v A mapped entry is indicated by a blue triangle alongside the element. In this example, Customer_ID and Order_Date are mapped. v v v v
Square brackets contain minimum and maximum occurrences of an element. An optional field is indicated by [0,1]. In this example, First_Class is optional. A repeating field is indicated by [minoccurs, maxoccurs]. A choice field is indicated by a choice line; under the choice line are the possible choices. In this example, First_Class, Second_Class, and Airmail are choices of Delivery_Method.
v The type of each element is indicated in round brackets after the element name. v If the message schema uses namespaces, the namespace prefix is shown before the element name, separated by a colon. Use the Source pane to invoke a number of actions, a list of which is displayed when you right-click within the Source pane. The following table describes the available actions. Action
Description
Undo
Undo previous action
Redo
Redo previous action
Revert
Discard
Related tasks
Message mappings
1705
Action
Description
Open Declaration (message)
Display the element definition from the message set.
Related tasks
For this action to be available, select any source message element except LocalEnvironment or Headers. Open Declaration (database)
Display the database, schema, or table definition from the database. For this action to be available, select any source database object.
Show Derived Types
Hide or display derived types for an element in the source or target pane. For this action to be available, select a target element displayed as a specialization folder in the source pane.
Show Substituting elements
Hide or display the substituting elements of the head element in the source or target pane. For this action to be available, select a target element displayed as a substitutions folder in the source pane.
Add Sources and Targets
Add a message definition or a database table to a source. For this action to be available, select any source object.
Go To
For this action to be available, select any source object.
Delete (message)
Remove a message and any existing maps from the source. For this action to be available, select the source message root ($source).
1706
Message Flows
“Adding messages or message components to the source or target” on page 548, “Adding a database as a source or target” on page 549
Action
Description
Delete (database)
Remove a database and any existing maps from the source.
Related tasks
For this action to be available, select the source database root ($db:select). Map from Source
Create a map between the “Mapping a target element focus source element and the from source message focus target element. elements” on page 538, “Mapping from source: by For this action to be selection” on page 528 available, select compatible source and target elements.
Map by Name
Create a map between the “Mapping a target element focus source element and the from source message focus target element. elements” on page 538, “Mapping from source: by For this action to be name” on page 529 available, select compatible source and target elements.
Accumulate
If the source and target fields “Configuring a repeating source and a non-repeating contain numeric data types, target” on page 544 this action maps all occurrences of a repeating source field to a non-repeating target, resulting in the sum of all the source elements. For this action to be available, select the source and target element.
Create New Submap
For this action to be available, select source and target elements that are either elements of complex types or wildcard elements.
“Creating and calling submaps and subroutines” on page 559, “Creating a new submap” on page 559, “Creating a new submap for a wildcard source” on page 560
Call Existing Submap
Call an existing submap
“Creating and calling submaps and subroutines” on page 559, “Calling a submap” on page 563
Call ESQL Routine
Call an ESQL routine
“Creating and calling submaps and subroutines” on page 559, “Calling an ESQL routine” on page 565
Save
Save the .msgmap file
Message Mapping editor Target pane Details of the elements present in the Target pane of the Message Mapping Editor.
Message mappings
1707
The following example shows the “Message Mapping editor” on page 1703. The pane that is labelled as 2 in the example is the Target pane:
1
2
3
4
The following list describes the elements that are present in the Target pane: v A target message is identified by $target. v A mapped entry is indicated by a yellow triangle alongside the element. In this example, Customer_ID, Order_Number, and Order_Date are mapped. v Square brackets contain minimum and maximum occurrences of an element. v An optional field is indicated by [0,1]. In this example, First_Class is optional. v A repeating field is indicated by [minoccurs, maxoccurs]. v A choice field is indicated by a choice line; under the choice line are the possible choices. In this example, First_Class, Second_Class, and Airmail are choices of Delivery_Method. v The type of each element is indicated in round brackets after the element name. v If the message schema uses namespaces, the namespace prefix is shown before the element name, separated by a colon. Use the Target pane to invoke a number of actions, a list of which is displayed when you right-click within the Target pane. The following table describes the available actions.
1708
Message Flows
Action
Description
Undo
Undo previous action
Redo
Redo previous action
Revert
Discard
Related tasks
Action
Description
Open Declaration (message)
Display the element definition from the message set.
Related tasks
For this action to be available, select any target message element except LocalEnvironment or Headers. Open Declaration (database)
Display the database, schema, or table definition from the database. For this action to be available, select any target database object.
Show Derived Types
Hide or display derived types for an element in the source or target pane. For this action to be available, select a target element displayed as a specialization folder in the target pane.
Show Substituting elements
Hide or display the substituting elements of the head element in the source or target pane. For this action to be available, select a target element displayed as a substitutions folder in the target pane.
Add Sources and Targets
Add a message definition or a database table to a source. For this action to be available, select any target object.
Go To
For this action to be available, select any target object.
Delete (message)
Remove a message and any existing maps from the source.
“Adding messages or message components to the source or target” on page 548, “Adding a database as a source or target” on page 549
For this action to be available, select the target message root ($target).
Message mappings
1709
Action
Description
Related tasks
Map from Source
Create a map between the “Mapping a target element focus source element and the from source message focus target element. elements” on page 538, “Mapping from source: by For this action to be selection” on page 528 available, select compatible source and target elements.
Map by Name
Create a map between the “Mapping a target element focus source element and the from source message focus target element. elements” on page 538, “Mapping from source: by For this action to be name” on page 529 available, select compatible source and target elements.
Enter Expression
For this action to be available, select any target object except $target
Accumulate
If the source and target fields “Configuring a repeating source and a non-repeating contain numeric data types, target” on page 544 this action maps all occurrences of a repeating source field to a non-repeating target, resulting in the sum of all the source elements.
“Setting the value of a target element to a constant” on page 539, “Setting the value of a target element using an expression or function” on page 541
For this action to be available, select the source and target element. Create New Submap
For this action to be available, select source and target elements that are either elements of complex types or wildcard elements.
“Creating and calling submaps and subroutines” on page 559, “Creating a new submap” on page 559, “Creating a new submap for a wildcard source” on page 560
Call Existing Submap
Call an existing submap
“Creating and calling submaps and subroutines” on page 559, “Calling a submap” on page 563
Call ESQL Routine
Call an existing ESQL routine “Creating and calling submaps and subroutines” on page 559, “Calling an ESQL routine” on page 565
Save
Save the .msgmap file
Message Mapping editor Edit pane Details of how you use the Edit pane of the Message Mapping Editor.
1710
Message Flows
The following example shows the “Message Mapping editor” on page 1703. The pane that is labelled as 3 in the example is the Edit pane:
1
2
3
4
When you have selected a source or target element, use the Edit pane to enter an expression. Right-click inside the Edit pane to invoke a list of available actions, most of which are standard Windows functions, such as cut, copy, and paste. Click Edit → Content Assist (or press Ctrl+Space) to access ESQL Content Assist, which provides a drop-down list of functions that are available in a Mapping node. To display the definition associated with a selected element or database object, right-click in the Edit pane, and click Open Declaration. The appropriate editor opens to display the definition associated with the element or database definition.
Message Mapping editor Spreadsheet pane Details of the actions available to you in the Spreadsheet pane of the Message Mapping Editor. The following example shows the “Message Mapping editor” on page 1703. The pane that is labelled as 4 in the example is the Spreadsheet pane:
Message mappings
1711
1
2
3
4
Use the Spreadsheet pane to invoke a number of actions, a list of which is displayed when you right-click within the Spreadsheet pane. The following table describes the available actions. Action
Description
Undo
Undo previous action
Redo
Redo previous action
Revert
Discard
Open Declaration (message)
Display the element definition from the message set.
Related tasks
For this action to be available, select any message element except LocalEnvironment or Headers. Open Declaration (database)
Display the database, schema, or table definition from the database. For this action to be available, select any database object.
1712
Message Flows
Add Sources and Targets
Add a message definition to a target.
Copy
Copy the selected item to the clipboard.
“Adding messages or message components to the source or target” on page 548, “Adding a database as a source or target” on page 549
Action
Description
Paste
Paste the item from the clipboard.
Delete
Remove a row from the Spreadsheet.
For
Define a repeating condition. “Configuring a repeating source and a non-repeating target” on page 544, “Configuring a repeating source and a repeating target” on page 545
| | |
If
Define what must evaluate to “Configuring a repeating ’true’ to process subsequent source and a non-repeating mappings. target” on page 544, “Configuring conditional mappings” on page 543
|
ElseIf
Define what must evaluate to ’true’ to process subsequent mappings if previous If or Elseif does not evaluate to ’true’..
Else
“Configuring conditional Placeholder to process mappings” on page 543 subsequent mappings if previous If or ElseIf does not evaluate to ’true’.
Select Data Source
Define a database to be used in the mapping.
|
Insert Children
Expand a structure so that each of its children has a row in the spreadsheet.
|
Insert Sibling After
“Configuring a non-repeating Create a number of new source and a repeating rows in the spreadsheet to target” on page 545 set the values of specific instances of a repeating field. Can also be used to insert any non-repeating element, attribute or database column if valid at the selected location.
|
Insert Sibling Before
“Configuring a non-repeating Create a number of new source and a repeating rows in the spreadsheet to target” on page 545 set the values of specific instances of a repeating field. Can also be used to insert any non-repeating element, attribute or database column if valid at the selected location.
Replace
Substitute an element, attribute or database column in the spreadsheet with a similar item, retaining the mapping expression and any child mapping statements.
Save
Save the .msgmap file.
| | |
|
Related tasks
“Configuring a repeating source and a non-repeating target” on page 544, “Configuring conditional mappings” on page 543
Message mappings
1713
Mapping node The Mapping node has one or more mappings that are stored in message map files (with a .msgmap file extension). These files are configured using the “Message Mapping editor” on page 1703. A Mapping node must contain the following inputs and outputs: v Zero or one source (input) messages v Zero or more source (input) databases v One or more target (output) messages You must define, in message definition files in a message set, the source and target messages that are to be mapped. You can specify the parser of the source message at run time (for example, in an MQRFH2 header), but the target message is built using the runtime parser that is specified by the Message Domain property of the message set. If a message mapping is between elements of different types, you might need to include casts in your mapping definitions, depending on which runtime parser is specified by the Message Domain property of your message set. The Mapping node uses a language to manipulate messages that are based on XPath. To develop message mappings for a Mapping node, use the Message Mapping editor, which provides separate panes for working with sources, targets and expressions.
Mapping node syntax In a Mapping node, the source message, if present, is identified in the “Message Mapping editor” on page 1703 by $source. The message tree is represented in XPath format. For example, if you have an element called Body within a source message called Envelope, this is represented in the Mapping node as: $source/soap11:Envelope/soap11:Body
Where soap11 is a namespace prefix. The first target message is identified by $target; additional target messages are identified by $target_1, $target_2, etc. The first source database is identified by $db:select; additional source databases are identified by $db:select_1, $db:select_2, etc. The database element is represented in the following format: $db:select.DB.SCH.TAB.COL1
where: DB is the database name SCH is the database schema name TAB is the table name
1714
Message Flows
COL1 is the column name You can also use the Mapping node to: v make comparisons v perform arithmetic v create complex conditions The comparison operators are: = equals != not equals > greater than >= greater than or equals < less than <= less than or equals The arithmetic operators are: + plus - minus * multiply div divide Conditional operators ‘or’ and ‘and’ are supported (these are case-sensitive). The following objects can be mapped: v Local Environment – – – –
Destination WrittenDestination File SOAP
– TCPIP – ServiceRegistry – Adapter – Wildcard – Variables v Message headers (optional) – MQ Headers – HTTP Headers – JMSTransport – Email Headers v Message elements v Database columns
Naming restrictions for database objects The names of objects in Oracle databases can contain certain characters, such as the dollar sign ($) and number sign (#), which the Mapping node cannot process correctly. Database table names, table column names, stored procedure parameter names, and column names in stored procedure result sets, must not contain any of the following characters:
Message mappings
1715
~ ! @ # $ % ^ & * ( ) + = - ` { } | \ ] [ " : ' ; ? > < , . /
Mapping node functions You can configure your message mappings to use a variety of predefined and user-defined functions. The following predefined functions are available to use in your message maps: v ESQL - prefixed esql: v XPath - prefixed fn: v Mapping - prefixed msgmap: v Schema casts - prefixed xs: Not all ESQL functions can be used in a Mapping node. For information about which functions are supported, and for a description of how to achieve equivalent processing for ESQL functions that are not supported, see the ESQL topics. For information about the predefined ESQL functions, see “Predefined ESQL mapping functions.” The fn:true() function (which always returns true) and the fn:false() function (which always returns false) are examples of XPath functions. You can get more information about the other XPath functions and XPath syntax from the online W3C XML Path Language document. For information about the predefined XPath functions, see “Predefined XPath mapping functions” on page 1719. For information about the predefined mapping functions, see “Predefined mapping functions” on page 1723. See “Mapping node casts” on page 1724 for a list of the schema casts. The Mapping node can also: v Set the value of a target to a WebSphere MQ constant. The expression to set the value looks similar to a function with $mq: used as the prefix. v Call a Java method directly. The expression to set the value looks similar to a function with java: used as a prefix.
Predefined ESQL mapping functions A table of predefined ESQL functions for use with message maps. This table details the predefined ESQL mapping functions that are available to use with message maps: Name
ESQL equivalent
Notes
Numeric functions: abs absval acos asin atan atan2 bitand bitnot bitor bitxor ceil ceiling cos cosh cot degrees exp floor in log log10 mod power radians rand sign sin sinh sqrt tan tanh truncate
ESQL function of the name same name such as ABS and ABSVAL.
The same parameters apply as for ESQL.
String functions: left length lower lcase ltrim replace replicate right rtrim space translate upper ucase
ESQL function of the same name such as LEFT and LENGTH.
The same parameters apply as for ESQL.
Field functions: bitstream ESQL function of the same name such as BITSTREAM fieldname fieldnamespace and FIELDNAME. fieldtype fieldvalue lastmove samefield
1716
Message Flows
The same parameters apply as for ESQL.
Name
ESQL equivalent
Notes
asbitstream
These signatures are supported:
FieldRef is a source field reference such as $source/po:PurchaseOrder
ASBITSTREAM(FieldRef) ASBITSTREAM(FieldRef, typeExp, setExp, formatExp) ASBITSTREAM(FieldRef, typeExp, setExp, formatExp, encodingExp, ccsidExp) ASBITSTREAM(FieldRef, typeExp, setExp, formatExp, encodingExp, ccsidExp, options)
typeExp is a string literal of the name of the message body, such as purchaseOrder, optionally qualified with a namespace URI, such as {http:// www.ibm.com}:purchaseOrder setExp is a string literal of the name of the message set, such as PurchaseOrder formatExp is a string literal of the wire format of the message, such as XML1 encodingExp and ccsidExp evaluate to integers with values corresponding to ESQL ENCODING and CCSID constants. options is an ESQL constant or bit-or of ESQL constant that evaluates to an integer.
cardinality
CARDINALITY
The same parameters apply as for ESQL.
coalesce
COALESCE
The same parameters apply as for ESQL.
current-date
CURRENT_DATE
No parameters apply.
current-gmtdate
CURRENT_GMTDATE
No parameters apply.
current-gmttime
CURRENT_GMTTIME
No parameters apply.
current-gmttimestamp
CURRENT_ GMTTIMESTAMP
No parameters apply.
current-time
CURRENT_TIME
No parameters apply.
current-timestamp
CURRENT_TIMESTAMP
No parameters apply.
date
DATE
for
FOR (expression)
gmttime
GMTTIME
gmttimestamp
GMTTIMESTAMP
interval-year
INTERVAL YEAR
interval-year-to-month
INTERVAL YEAR TO MONTH
interval-month
INTERVAL MONTH
interval-day
INTERVAL DAY
interval-day-to-hour
INTERVAL DAY TO HOUR
interval-day-to-minute
INTERVAL DAY TO MINUTE
interval-day-to-second
INTERVAL DAY TO SECOND
interval-hour
INTERVAL HOUR
interval-hour-to-minute
INTERVAL HOUR TO MINUTE
interval-hour-to-second
INTERVAL HOUR TO SECOND
interval-minute
INTERVAL MINUTE
interval-minute-to-second
INTERVAL MINUTE TO SECOND
interval-second
INTERVAL SECOND
is-null
Operand IS NULL
Optional parameters are not supported.
The same parameters apply as for ESQL. Some examples: esql:interval-minute('90') esql:interval-year-to-month('1-06')
Some examples: esql:is-null($source/po:purchaseOrder/po:comment) esql:is-null ($db:select.ACME.PARTS.INVENTORY.LAST_TRANSACTION)
like
source LIKE pattern
For example: esql:like ($source/po:purchaseOrder/shipTo/first_name,'Fred')
source LIKE pattern ESCAPE EscapeChar
For example: esql:like ($source/po:purchaseOrder/shipTo /zip,'L6F$_1C7','$')
local-timezone
LOCAL_TIMEZONE
Message mappings
1717
Name
ESQL equivalent
nullif
NULLIF
Notes The same parameters apply as for ESQL.
overlay
OVERLAY Str1 PLACING Str2 FROM Start
For example: esql:overlay ($source/po:purchaseOrder/shipTo/city,'abc',2)
OVERLAY Str1 PLACING Str2 FROM Start For Length
For example: esql:overlay ($source/po:purchaseOrder/shipTo/city,'abcde',2,3)
position
POSITION searchExp IN SourceExp
For example: esql:position ('aet',$source/po:purchaseOrder/shipTo/first_name)
POSITION searchExp IN SourceExp FROM FromExp
For example: esql:position ('do',$source/po:purchaseOrder/shipTo/last_name,1)
POSITION searchExp IN SourceExp FROM FromExp REPEAT RepeatExp
For example: esql:position ('a',$source/po:purchaseOrder/billTo /first_name,1,2)
round
ROUND
Optional parameters are not supported.
sqlcode
SQLCODE
No parameters apply.
sqlerrortext
SQLERRORTEXT
sqlnativeerror
SQLNATIVEERROR
sqlstate
SQLSTATE
time
TIME
timestamp
TIMESTAMP
The same parameters apply as for ESQL. For example: esql:gmttimestamp ('1999-12-31 23:59:59.999999')
trim-leading
TRIM LEADING FROM Source
For example: esql:trim-leading ($source/po:purchaseOrder/shipTo/state)
TRIM LEADING Singleton FROM Source
For example: esql:trim-leading ('G',$source/po:purchaseOrder/shipTo/zip)
trim-trailing
TRIM TRAILING FROM Source
For example: esql:trim-trailing ($source/po:purchaseOrder/billTo/last_name)
TRIM TRAILING Singleton FROM Source
For example: esql:trim-trailing ('e',$source/po:purchaseOrder/billTo/street)
trim-both
TRIM BOTH FROM Source
For example: esql:trim-both ($source/po:purchaseOrder/shipTo/city)
TRIM BOTH Singleton FROM Source
For example: esql:trim-both (",$source/po:purchaseOrder/shipTo/city)
1718
Message Flows
Name
ESQL equivalent
Notes
trim
TRIM Source
For example: esql:trim ($source/po:purchaseOrder/shipTo/city)
TRIM Singleton FROM Source
For example: esql:trim (",$source/po:purchaseOrder/shipTo/city)
uuidasblob
UUIDASBLOB
uuidaschar
UUIDASCHAR
Takes zero or more parameters as in ESQL.
Predefined XPath mapping functions A table of predefined XPath functions for use with message maps. This table details the predefined XPath functions that are available for use with message maps. You can get more information about XPath functions and XPath syntax from the online W3C XML Path Language document. Name
Parameters
Notes
true false
| | | |
sum
avg
Source supports an XPath predicate. An XPath predicate Source field from the message or database or is an expression enclosed in square brackets, serving to “XPath ″for expression″” on filter a sequence, retaining some items and discarding page 1721. others.
| | | | | | | |
Predicates are supported on the XPath aggregate functions of avg, count, max, min, and sum. max
Predicates must be in one of the two forms: v An integer literal – aggregation is done for elements whose context position equals the integer.
min
v A Boolean expression – aggregation is done for elements that make the Boolean expression evaluate to true.
count
| |
See “Aggregating XPath expressions conditionally” on page 1720 for more information. concat
Two, or more, strings.
not
1- Expression resolved to a Boolean value.
exists
Source field from the message or database.
empty substring
You cannot use fn:concat($source/myElem) to concatenate instances of ’myElem’.
1- String 2- Zero-bases starting index 3- Length
For example: fn:substring ($source/po:purchaseOrder/billTo/street, 3, 5)
| |
substring-before
Two strings
Returns the substring of the first string that precedes the first occurrence of the second string.
| |
substring-after
Two strings
Returns the substring of the first string that follows the first occurrence of the second string.
Message mappings
1719
Name
Parameters
Notes
| |
starts-with
Two strings
Returns a Boolean value indicating whether the first string starts with the second string.
| |
ends-with
Two strings
Returns a Boolean value indicating whether the first string ends with the second string.
| |
contains
Two strings
Returns a Boolean value indicating whether the first string contains the second string.
year-from-dateTime
1- xs:dateTime
For example:
month-from-dateTime
fn:month-from-dateTime (xs:dateTime($source/po:purchaseOrder /shipTo/datetime))
day-from-dateTime hours-from-dateTime minutes-from-dateTime
where $source/po:purchaseOrder/shipTo/datetime is xs:string.
seconds-from-dateTime year-from-date
1-xs:date
For example:
month-from-date
fn:year-from-date(xs:date ($source/po:purchaseOrder/billTo/date))
day-from-date
where $source/po:purchaseOrder/billTo/date is xs:string.
hours-from-time
1- xs:time
minutes-from-time
fn:hours-from-time(xs:time("13:20:10:5")) fn:hours-from-time(xs:time ($source/po:purchaseOrder/shipTo/time))
seconds-from-time years-from-duration
Some examples:
1- xdt:dayTimeDuration
months-from-duration
For example: fn:minutes-from-duration (xdt:dayTimeDuration(PT47H30M))
days-from-duration hours-from-duration minutes-from-duration seconds-from-duration
|
Aggregating XPath expressions conditionally:
| |
You can perform calculations using conditions, called predicates in XPath, on the aggregate functions, which are avg, count, max, min, and sum.
|
XPath aggregate functions
| | | | | |
fn:count($arg as item()*) as xs:integer fn:avg($arg as xs:anyAtomicType*) as xs:anyAtomicType? fn:max($arg as xs:anyAtomicType*) as xs:anyAtomicType? fn:min($arg as xs:anyAtomicType*) as xs:anyAtomicType? fn:sum($arg as xs:anyAtomicType*) as xs:anyAtomicType?
| |
where the atomic value can be, for example, an integer, a string, or a Boolean value.
|
In an aggregation
XPath aggregate functions take a sequence as their argument:
1720
Message Flows
|
fn:sum($source/inventory/category/product/price)
| |
the node
|
is put into its typed value, which is a sequence of Atomictype price values.
| | |
In the following aggregation, the argument is a node tns:price, which is contained in tns:product, which is in turn contained in tns:category, and so on.
| | |
How aggregation works in this sequence depends upon the scope of the iteration (or for) loop for product and category. For example, if there is no iteration loop, summation is done for all instances of all prices in all products in all categories.
| | |
However, if there is an iteration loop on category, one summation is calculated for each category. The summation is obtained from all prices of all products of a particular category being iterated upon.
| | | |
You can add a predicate ( see predicates for further information) to make the result more specific. For example: fn:sum($source/tns:Inventory/tns:category[$source/tns:Inventory/tns:category/ tns:c_id='abc' ]/tns:product[3]/tns:price)
| | |
has a predicate of tns:c_id='abc' on category, and a predicate of 3 on product. The result that you obtain is the third product in the category that has tns:c_id='abc'.
| |
In both of the preceding examples, whether the expression contains a condition or not, you reference one source item only; it is price that is aggregated.
| | | |
Predicates are supported only when they are used in message sources. For example, the [ boolean expression ] must be used within a segment of a path that represents a message source. Predicates are not supported in $db:select or $db:proc.
| | | |
Consider a more complicated scenario, where product prices are kept in a database table, and the input message contains the quantity of the product being ordered. The objective is to calculate a total price by adding up all prices multiplied by quantity.
| |
fn:sum($source/inventory/product/quantity × $db:select/PRICE_TB/PRICE)
| | | |
However, the first step of evaluating an XPath arithmetic expression is to evaluate its operands. If any operand is evaluated into a sequence of more than one item, either only the first item is used in the arithmetic expression, or an error is raised; for further information, see Arithmetic expressions.
| | |
You, therefore, cannot add up the product of quantity and PRICE for each product. If you want to aggregate the result of an arithmetic expression, see “XPath ″for expression″.”
|
XPath ″for expression″:
$source/inventory/category/product/price
fn:sum($source/tns:Inventory/tns:category/tns:product/tns:price)
It might seem to be straightforward to write the following aggregation function:
Message mappings
1721
| |
You can use the ″for expression″ to perform specific calculations as the argument of an aggregation function.
|
For expressions
| |
To perform a specific operation you can use the XPath for expression iteration facility; see for expression for further information.
| | |
You can express a sequence of price multiplied by quantity in many ways using the for expression. For example: v for $i in $source/inventory/category/product return $i/price * $i/quantity
| | | | | |
You can use a similar expression when all operands of the return expression (price and quantity) are defined in the same repeatable container (product). Only one variable is needed in the for expression. v for $i in $db:select, $j in $source/inventory/category/product [$i.db1.sch2.PRICE_TB.PROD_ID=$j/product_id] return $i.db1.sch2.PRICE_TB.PRICE * $j/quantity
You can use a similar expression when some operands of the return expression (price) are kept in a database table, and other operands (quantity) are kept in a message. At least one variable is needed for the path to a database result set, and another variable is needed for the path to a repeatable XML element.
| | | | | |
v for $i in $source/order_info/product1, $j in $source/price_record/product2 [$i/product_id=$j/product_id] return $i/quantity * $j/price
| | |
You can use a similar expression when the operands (price and quantity) are defined in different repeatable elements (product1 and product2) in the source message.
| |
When you have an expression that represents a sequence of items, aggregation can be done by using the for expression as the argument of the aggregation function.
|
Examples
| | |
Obtain the average cost - that is, price multiplied by quantity - for all products: fn:avg(for $i in $source/inventory/category/product return $i/price * $i/quantity)
| | | | |
Obtain the total cost of all products where prices are from a database, and quantities are from a message and paired up based on product identifier:
| | |
Obtain the length of the longest product identifier text:
| | | |
Obtain the minimum price when the price was stored in a message as a string, and convert each source item into a numeric value before using an aggregate function:
| |
The aggregation functions that are supported in WebSphere Message Broker Version 6.1.0.2, and earlier, can be expressed using a for expression.
fn:sum(for $i in $db:select, $j in $source/inventory/category/product [$i.db1.sch2.PRICE_TB.PROD_ID=$j/product_id] return $i.db1.sch2.PRICE_TB.PRICE * $j/quantity)
fn:max(for $i in $source/inventory/category/product return esql:length($i/id))
fn:min(for $i in $source/inventory/category/product return xs:decimal($i/price))
1722
Message Flows
| |
For example, in WebSphere Message Broker Version 6.1.0.2 you can have:
| | |
and this format is still supported. This expression is equivalent to:
|
Predefined mapping functions
fn:sum($source/inventory/category/product/price)
fn:sum(for $i in $source/inventory/category/product return $i/price)
A table of predefined mapping functions for use with message maps. This table details the predefined mapping functions that are available to use with message maps: Name
Parameters
Return
Notes
cdata-element
One string
Nothing
Create an XML element with CData content in the following target message domains: v XMLNSC v SOAP v XMLNS v XML v JMSMap v JMSStream For example: msgmap:cdata-element('<month>05 11 2008 ')
| |
occurrence
Source field from the message or database
The index of the source field.
Often used in a condition statement when source repeats to execute specific statements for a specific occurrence. For example: msgmap:occurrence ($source/po:purchaseOrder /items)=2 means the second field, po:purchaseOrder is being processed. Use code similar to the previous example if you want to specify a particular source occurrence. If you only want to assign the index value to a target you can specify the following code: msgmap:occurrence ($source/po:purchaseOrder /items)
exact-type
1- Source field from the message or database 2- Namespace prefix 3- Name of the type
True if the source is of Often used in a condition to execute the specified type in the specific statements for a specific source specified namespace. type. For example: msgmap:exact-type ($source/tn1:msg2,'tn1', 'extendedMsgType')
Message mappings
1723
Name
Parameters
Return
Notes
empty-element()
None
Nothing
Creates an XML element with an empty tag. For example, if an element is named MyElement and the mapping expression for MyElement is set to msgmap:empty-element(), the output message will contain an element with no content: <MyElement/> Call this function only for an XML element.
element-frombitstream
These signatures are supported: msgmap:element-from-bitstream(StreamRef) msgmap:element-from-bitstream(StreamRef, typeExp, setExp, formatExp) msgmap:element-from-bitstream(StreamRef, typeExp, setExp, formatExp, encodingExp, ccsidExp) msgmap:element-from-bitstream(StreamRef, typeExp, setExp, formatExp, encodingExp, ccsidExp, options)
Nothing
Used to parse a bitstream. This function can be called only for a message element target. The parsed bit stream is placed in the target message tree as the target element. StreamRef is a reference to a BLOB of stream, such as $source/BLOB or $db:select.dsn.schema.table.column typeExp is a string literal of the name of the message body, such as purchaseOrder, optionally qualified with a namespace URI, such as {http:// www.ibm.com}:purchaseOrder setExp is a string literal of the name of the message set, such as PurchaseOrder formatExp is a string literal of the wire format of the message, such as XML1 encodingExp and ccsidExp evaluate to integers with values corresponding to ESQL ENCODING and CCSID constants options is an ESQL constant or bit-or of ESQL constants that evaluate to an integer.
Mapping node casts Source and target elements can be of different types in a Mapping node, Depending on which runtime parsers are used, automatic casting cannot be done. In these cases, use one of the following cast functions: v xs:boolean v xs:date v xs:dateTime v v v v v
xs:dayTimeDuration xs:decimal xs:duration xs:double xs:hexBinary
v xs:int v xs:integer v v v v
1724
Message Flows
xs:string xs:long xs:time xs:yearMonthDuration
Headers and Mapping node This topic lists the headers that can be manipulated by the Mapping node. You can map these headers: v MQ Headers MQMD MQCFH header with root element MQPCF MQCIH MQDLH MQIIH MQMDE MQRFH MQRFH header with MQRFH2 or MQRFH2C parser MQRMH MQSAPH MQWIH SMQ_BMH v Email Headers EmailOutputHeader v HTTP Headers HTTPInputHeader HTTPReplyHeader HTTPRequestHeader HTTPResponseHeader v JMSTransport
Migrating message mappings from Version 5.0 Use the mqsimigratemfmaps command to migrate message mappings to the Version 6.1 format. The mqsimigratemfmaps command creates Version 6.1 mapping files (.msgmap) from your Version 5.0 mapping files (.mfmap). When you migrate message mappings from Version 5.0, read the restrictions that apply. The following table lists the mapping functions that are supported in Version 5.0 but not supported in Version 6.1, and shows the error messages that you might see. Mappings that contain these Version 5.0 functions cannot be migrated to Version 6.1; you must re-create and redeploy these mappings using another node, such as a JavaCompute node. Alternatively, migrate as much of the mapping as possible using the migration command, view the error report to see details of the functions that could not be migrated, and create a new node that can execute those functions that were not migrated.
Message mappings
1725
Supported in Version 5.0
Migration utility error message
Expressions that involve multiple instances of a repeating source element, for example:
Error:102: Unexpected index ’2’ encountered for target mappable ’e’. The expected index is ’1’. Migration currently provides no support for expressions involving more than one instance of the same repeating-element.
src_msg.e[1] + src_msg.e[2] -> tgt_msg.e
ESQL field references that contain Error:130: ESQL field-reference ’src_msg.e.*’ the asterisk wildcard character cannot be migrated. Migration currently provides ″*″. For example: no support for field-references containing ’*’. src_msg.e.* or src_msg.e.*[] Dynamic ESQL field references. For example:
Error:131: ESQL field-reference ’src_msg.e.{’a’ || ’b’}’ cannot be migrated. Migration currently provides no support for dynamic field-references.
src_msg.e.{'a' || 'b'} ESQL expressions that contain a reference to the temporary index-variable ″#I″. For example:
Error:128: ESQL expressions containing the variable ’#I’ anywhere other than the index of a repeating-element cannot be handled by the migration.
src_msg_e || "#I" -> tgt_msg.e Expressions within an index of a repeating element. For example: src_msg.e[src_msg.a] or src_msg.e["#I" +5] or src_msg.e[< 3]
Error:116: ESQL field-reference ’src_msg.e[< 3]’ cannot be migrated. Migration currently provides no support for indexes other than the variable ’#I’ and plain integer indexes.
Error:135: The ESQL expression ’SELECT Aggregation functions MIN, MAX, and COUNT, used with the MAX(″#T″.FIRSTNAME) FROM Database.CUSTOMER AS ″#T″ WHERE ″#T″.CUSTOMERID = 7’ could not be migrated. ESQL SELECT expression. For The expression contains syntax which has no direct example: equivalent in the new map-script language. SELECT MAX("#T".FIRSTNAME) FROM Database.CUSTOMER AS "#T" WHERE "#T".CUSTOMERID = 7 ESQL IN operator. For example: src_msg.e IN (1, 2, 3)
Error:135: The ESQL expression ’SELECT MAX(″#T″.FIRSTNAME) FROM Database.CUSTOMER AS ″#T″ WHERE ″#T″.CUSTOMERID = 7’ could not be migrated.
Restrictions on migrating message mappings In certain scenarios, restrictions apply to the migration of .mfmap files from Version 5.0. This topic explains why migration is not automatic in these situations, and provides instructions for how to complete a successful migration. This topic also provides information about restrictions that apply when you migrate submaps. The programming model for message maps is different between Version 5.0 (where the file format is .mfmap) and Version 6.1 (where the format is .msgmap). Version 5.0 message maps have a procedural programming model, which is essentially an alternative ESQL, where you describe all the steps that are required to perform a transformation. Version 6.1 uses a declarative programming model, where you describe the result of the transformation, and the tools determine how to achieve that result.
1726
Message Flows
Most migration failures result from message maps that contain too much information about the steps that perform the transformation, and not enough information about the desired result. For these message maps, migration is enabled by changing the .mfmap file so that specific ″how to″ sections are separated into an ESQL function or procedure that can be called by the message map. The .mfmap file calls the ESQL function instead of containing it as an expression. The mqsimigratemfmaps command then migrates the .mfmap file, but calls the ESQL function instead of logging a migration error. A limitation is that ESQL (the run time for .mfmap and .msgmap files) cannot define functions that return complex element (or REFERENCE) values. The following procedure explains how to work around this complex element target limitation; in many cases, you must rewrite the map as an ESQL function. For more examples and information about calling ESQL from maps, refer to the following sample: v Message Map sample You can view samples only when you use the information center that is integrated with the Message Broker Toolkit. 1. Determine whether you can define an ESQL function for the .mfmap file. a. When the target value is a complex element, or in ESQL terms a REFERENCE, the individual mapping must be rewritten in the .msgmap file. Delete the mapping from the .mfmap file, and proceed to Step 4. b. Use a function for all other cases: CHAR string, numbers, date, and time. Proceed to Step 2. 2. Determine the source parameters and returns type for your function. a. For each source path in the mapping, there must be one parameter in the function or procedure. For a function, all parameters are unchangeable. The type of the parameter must match the source data type. b. The function return type is the ESQL data type identified above. 3. Update the .mfmap file to enable migration. Change the .mfmap file to invoke the function in the mapping, passing the source parameters to the function in the order in which they were listed in step 2a. 4. Re-run the mqsimigratemfmaps command to migrate the modified .mfmap file. 5. Repeat Steps 1 to 4 until no errors are reported in the migration log. 6. Start the Version 6.1 Message Broker Toolkit and open the migrated .msgmap file. a. For ESQL that is migrated as functions, there should be no errors. b. For complex element targets, rewrite the mapping using the Version 6.1 features. The following examples illustrate migration of .mfmap files to .msgmap files. v To migrate a multiple reference to a repeating source expression: src_msg.e[1] + src_msg.e[2]
compute the result in an ESQL function like: CREATE FUNCTION addOneAndTwo(IN src_msg) BEGIN RETURN src_msg.e[1] + src_msg.e[2]; END;
In the .msgmap file, call the ESQL function addOneAndTwo using the parent element src_msg as a parameter. Message mappings
1727
v An expression that does not use element names: src_msg.*
or src_msg.*[]
can be processed using a function that takes the parent of the repeating field: CREATE FUNCTION processAny(IN src_msg) BEGIN DECLARE nodeRef REFERENCE TO src_msg.e.*; DECLARE result ; WHILE LASTMOVE nodeRef DO --expression goes here SET result = result; END WHILE; RETURN RESULT; END;
In the .msgmap file, call the ESQL function processAny using the parent element src_msg as a parameter. v Expressions that dynamically compute element names: src_msg.{'a' || 'b'}
can be processed by ESQL functions that process the parent of the repeating field: CREATE FUNCTION processDynamicName(IN src_msg) BEGIN RETURN src_msg.{'a' || 'b'}; END;
In the .msgmap file, call the ESQL function processDynamicName using the parent element src_msg as a parameter. v Expressions that use the select MIN, MAX, and COUNT functions: SELECT MAX("#T".FIRSTNAME) FROM Database.CUSTOMER AS "#T" WHERE "#T".CUSTOMERID = custId
can be processed by ESQL functions that process the parent of the repeating field: CREATE FUNCTION processMAX(IN custId) BEGIN RETURN SELECT MAX("#T".FIRSTNAME) FROM Database.CUSTOMER AS "#T" WHERE "#T".CUSTOMERID = custId END;
In the .msgmap file, call the ESQL function processMAX using the element custId as a parameter. v .mfmap files that use mfmap index variables in expressions: e || "#I"
must be rewritten entirely in ESQL. By definition, there must be a complex repeating parent element, and this is not supported by ESQL functions. v Expressions that use source expressions to compute values: src_msg.e[src_msg.a]
1728
Message Flows
must be rewritten using if rows, msgmap:occurrence() functions, and ESQL functions: for src_msg.e if condition msgmap:occurrence(src_msg/e) = src_msg/a
v For expressions that use index expressions to compute values: src_msg.e["#I" +5] src_msg.e[< 3]
the entire .msgmap file must be rewritten in ESQL, because the .msgmap files do not support indexed access to repeating fields. v .mfmap files that use ROW expressions to compute values: src_msg.e IN (1, 2, 3)
must be rewritten in ESQL, because .msgmap files do not support ESQL ROW expressions.
Restrictions on migrating maps that call ESQL If there is a mismatch between the case that has been in the ESQL call in the message map, and the name of the routine defined in the ESQL file, an error is produced during migration of the message map. To prevent an error occurring during migration, ensure that the ESQL call in the message map uses the same case as the ESQL defined in the routines in the ESQL file. Alternatively you can manually edit the message map after migration to call the ESQL routine with matching case.
Restrictions on migrating submaps In Version 5.0 message maps, any complex element type can be a root of a submap. However, in Version 6.1, only a global element or a global attribute can be the root of a submap. When a Version 5.0 message map with a call to a submap with a non-global element as the map root is migrated, the submap is not migrated as a standalone submap. Instead, the call to the submap in the main message map is replaced by the migrated content of the submap. Alternatively, if the submap has a global element as the map root, the submap is migrated to a standalone Version 6.1 submap instead. For Version 6.1, you must define reusable schema structures as global elements and types. If you have Version 5.0 submaps that use local elements, you must change the schema to add definitions of global elements for the local elements, and then use the new schema after migration. If the new global elements have the same name and type as the local elements, the Version 5.0 submaps do not need to be changed. You must qualify a local element in a Version 5.0 submap with a namespace to ensure its successful migration to Version 6.1, because the global element that replaces it after migration must be qualified by the namespace. If your submap contains local elements, you must re-create the submap and re-create the call to the submap from the main message map. The following table shows differences between the features that are supported in a submap for Version 5.0 and Version 6.1.
Message mappings
1729
Version
Supported feature
Version 5.0
global elements and global attributes as map source global elements and global attributes as map target local elements and local attributes as map source local elements and local attributes as map target
Version 6.1
global elements, global attributes, and global types as map source global elements and global attributes as map target
1730
Message Flows
Part 5. Appendixes
© Copyright IBM Corp. 2000, 2008
1731
1732
Message Flows
Appendix. Notices for WebSphere Message Broker This information was developed for products and services offered in the U.S.A. IBM may not offer the products, services, or features discussed in this information in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user’s responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this information. The furnishing of this information does not give you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 U.S.A. For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to: IBM World Trade Asia Corporation Licensing 2-31 Roppongi 3-chome, Minato-ku Tokyo 106-0032, Japan The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION ″AS IS″ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the information. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this information at any time without notice. Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk. © Copyright IBM Corp. 2000, 2008
1733
IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you. Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact: IBM United Kingdom Laboratories, Mail Point 151, Hursley Park, Winchester, Hampshire, England SO21 2JN Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee. The licensed program described in this information and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Programming License Agreement, or any equivalent agreement between us. Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurements may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. All statements regarding IBM’s future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only. This information includes examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. COPYRIGHT LICENSE: This information contains sample application programs in source language, which illustrate programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not
1734
Message Flows
been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. Each copy or any portion of these sample programs or any derivative work, must include a copyright notice as follows: (C) (your company name) (year). Portions of this code are derived from IBM Corp. Sample Programs. © Copyright IBM Corp. _enter the year or years_. All rights reserved.
Trademarks in the WebSphere Message Broker information center IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at Copyright and trademark information at www.ibm.com/legal/ copytrade.shtml. Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. Intel and Pentium are trademarks of Intel Corporation in the United States and other countries. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of others.
Appendix. Notices for WebSphere Message Broker
1735
1736
Message Flows
Index Special characters
application clients (continued) Web services (continued) ″for expression″ 1454, 1722 WSDL applications 683 @MessageBrokerCopyTransform 443 XML domain message flows @MessageBrokerLocalEnvironmentTransform archive 444 data 142 @MessageBrokerRouter 444 resetting 625 @MessageBrokerSimpleTransform 442
A accounting and statistics data 141 accounting origin 143 collecting 619 collection options 142 details 1408 example output 1420 output data formats 1409 output formats 144 parameters, modifying 624 parameters, viewing 623 resetting archive data 625 setting accounting origin 621 starting 620 stopping 623 accounting origin 143 setting 621 Adapter Connection wizard 280 Adapters (WebSphere) connecting 280 developing applications 269 additional instances, file processing 776 AggregateControl node 808 AggregateReply node 810 AggregateRequest node 813 aggregating XPath expressions 1452, 1720 aggregation 146 database deadlocks, resolving 644 exceptions, handling 644 fan-in flows, creating 632 fan-out flows, creating 628 multiple AggregateControl nodes 640 requests and responses, correlating 641 timeouts, setting 639 alignment, nodes 268 annotations 442 application clients MQGet node message processing 209 request-response, MQGet node 213 Web services call existing 756 HTTP flows 752 implement existing interface 764 implement existing interface to new 768 implement new 760 scenarios 755 SOAP applications 677 SOAP domain message flows 745 © Copyright IBM Corp. 2000, 2008
correlation names logical message tree 79 XML constructs 1462 751
B bend points 60 adding 266 removing 267 BLOB parser 116 broker properties, message flow broker schema 123 creating 241 business objects PeopleSoft 49
119, 288
C Check node 815 cluster queues 185 code dependencies, Java 500 code pages conversion 150 converting with ESQL 341 collector node collection expiry, setting 652 collection name, setting 653 control messages, using 655 event coordination, setting 654 event handler properties, setting 649 input terminals, adding 649 persistence mode, setting 654 Collector node 818 collector node, configuring 648 collector node, using 646 comment and path, message flows 59 complex types broker properties 119, 288 Compute node 823 conditional mappings, configuring 543 conditional mappings, creating 568 configurable properties, message flow 1398 configurable services 58 connections 60 creating with the mouse 264 creating with the Terminal Selection dialog box 265 listing 1382 removing 266 WebSphere MQ 1381 coordinated message flows, configuring 196 coordination database connections 1424 database support 1424
D data conversion 150 configuring message flows 207 data source z/OS Compute node 1477 Database node 1477 data types BLOB message 1428 DestinationData subtree 1427 elements 1425 fields 1425 Properties subtree 1426 support for 1687 WebSphere MQ header fields 1426 XMLNSC parser 101 database connections listing 1382 quiescing 1382 database definitions, adding 551 Database node 831 DatabaseRetrieve node 836 DatabaseRoute node 844 databases adding 551 code page support 1385 data type support 1687 DBCS restrictions 1382 definitions, creating 551 Java 515 listing connections 1382 quiescing 1382 stored procedures in ESQL 359 Unicode string functions 1384 DataDelete node 852 datagram message, sending 956 DataInsert node 855 DataUpdate node 858 DBCS, database restrictions 1382 deployment Version 5 or Version 6 authored ESQL to a Version 2.1 broker 296 Destination (LocalEnvironment), populating 337 destination lists creating 184 using 178 DTD support XMLNS parser 105 XMLNSC parser 102 dynamic terminals, adding 262
1737
E editors Message Mapping 1436, 1703 palette customizing 253 layout, changing 252 settings, changing 253 EIS, connecting 280 EJB, calling 518 element definitions for message parsers 1425 EmailOutput node 861 empty elements XMLNSC parser 95 Empty elements XMLNS parser 103 encoding 150 EndpointLookup node 867 Enterprise Information System, connecting 280 Environment tree 71 accessing with ESQL 338 errors connecting failure terminals 230 handling 227 input node 230 MQInput node 232 TimeoutNotification node 235 TryCatch node 236 errors, from saving 251 ESQL accessible from Java 119, 288 accessing databases 195 adding keywords 348 BLOB messages 435 Broker attributes 119, 288 constants 1692 converting EBCDIC NL to ASCII CRLF 344 data casting 340 converting 341 transforming 340 data types 284 database columns referencing 350 selecting data from 351 database content, changing 357 database state 365 database updates, committing 358 databases, interacting with 348 datetime representation 1484 deploying Version 5 or Version 6 to a Version 2.1 broker 296 Destination, populating 337 developing 282 elements accessing 309 setting or querying null 309 elements, multiple occurrences accessing known 313 accessing unknown 314 Environment tree, accessing 338 errors 360 example message 1701 ExceptionList tree, accessing 339 exceptions 364
1738
Message Flows
ESQL (continued) explicit null handling 309 field references 289 anonymous 315 creating 316 syntax 1494 field types, referencing 309 fields copying those that repeat 324 creating new 317 manipulating those that repeat in a message tree 328 files copying 301 creating 294 deleting 305 moving 302 opening 295 renaming 301 saving 300 functions 291 headers, accessing 329 IDoc messages 432 implicit null handling 309 JMS messages 431 keywords non-reserved 1698 reserved 1698 like-parser-copy 346 list type elements, working with 326 LocalEnvironment tree, accessing 334 mapping between a list and a repeating element 327 mapping functions 1448, 1716 message body data, manipulating 308 message format, changing 346 message tree parts, manipulating 329 MIME messages 433 modules 292 MQCFH header, accessing 331 MQMD header, accessing 330 MQPCF header, accessing 331 MQRFH2 header, accessing 330 MRM domain messages handling large 428 working with 425 MRM domain messages, accessing attributes 418 elements 416 elements in groups 419 embedded messages 422 mixed content 421 multiple occurrences 417 namespace-enabled messages 423 MRM domain messages, null values querying 424 setting 424 multiple database tables, accessing 355 nested statements 290 node creating 296 deleting 304 modifying 299 numeric operators with datetime 321 operators 289
ESQL (continued) complex comparison 1502 logical 1504 numeric 1505 rules for operator precedence 1506 simple comparison 1500 string 1506 output messages, generating 320 overview of 1479 preferences, changing 303 procedures 292 Properties tree, accessing 333 returns to SELECT, checking 357 SELECT function 367 settings editor 303 validation 304 special characters 1696 statements 290 stored procedures, invoking 359 subfield, selecting 323 syntax preference 1480 tailoring for different nodes 307 time interval, calculating 322 unlike-parser-copy 346 variables 284 XML domain, manipulating messages in the 415 XML messages complex message, transforming 371 data, translating 377 message and table data, joining 378 message data, joining 375 scalar value, returning 373 simple message, transforming 367 XMLNS domain, manipulating messages in the 405 XMLNSC domain, manipulating messages in the 391 ESQL data types BOOLEAN 1480 database, ROW 1488 Datetime 1480 DATE 1481 GMTTIME 1481 GMTTIMESTAMP 1482 INTERVAL 1482 TIME 1481 TIMESTAMP 1481 ESQL to Java, mapping of 1490 ESQL to XPath, mapping of 1491 list of 1480 NULL 1485 numeric 1486 DECIMAL 1486 FLOAT 1487 INTEGER 1488 REFERENCE 1488 string 1489 BIT 1489 BLOB 1490 CHARACTER 1490 ESQL functions 1592
ESQL functions (continued) ESQL functions (continued) CAST numeric (continued) formatting and parsing dates as BITXOR 1609 strings 1656 CEIL and CEILING 1610 formatting and parsing numbers as COS 1610 strings 1654 COSH 1611 formatting and parsing times as COT 1611 strings 1656 DEGREES 1611 complex 1646 EXP 1611 CASE 1647 FLOOR 1612 CAST 1648 LN and LOG 1612 data types from external LOG10 1613 sources 1687 MOD 1613 LIST constructor 1670 POWER 1613 ROW and LIST combined 1671 RADIANS 1614 ROW and LIST comparisons 1672 RAND 1614 ROW constructor 1669 ROUND 1614 SELECT 1663 SIGN 1618 Supported casts 1674 SIN 1618 database state 1596 SINH 1618 SQLCODE 1596 SQRT 1618 SQLERRORTEXT 1596 TAN 1619 SQLNATIVEERROR 1597 TANH 1619 SQLSTATE 1598 TRUNCATE 1620 datetime 1600 string manipulation 1620 CURRENT_DATE 1603 CONTAINS 1621 CURRENT_GMTDATE 1604 ENDSWITH 1622 CURRENT_GMTTIME 1604 LEFT 1622 CURRENT_GMTTIMESTAMP 1604 LENGTH 1622 CURRENT_TIME 1603 LOWER and LCASE 1623 CURRENT_TIMESTAMP 1603 LTRIM 1623 EXTRACT 1601 OVERLAY 1624 LOCAL_TIMEZONE 1605 POSITION 1625 field 1633 REPLACE 1626 ASBITSTREAM 1633 REPLICATE 1626 BITSTREAM 1637 RIGHT 1627 FIELDNAME 1637 RTRIM 1627 FIELDNAMESPACE 1638 SPACE 1628 FIELDTYPE 1638 STARTSWITH 1628 FIELDVALUE 1641 SUBSTRING 1629 FOR 1641 TRANSLATE 1630 LASTMOVE 1643 TRIM 1631 SAMEFIELD 1643 UPPER and UCASE 1632 implicit casts 1682 ESQL statements 1507 arithmetic operations 1684 ATTACH 1508 assignment 1686 BEGIN ... END 1510 comparisons 1682 BROKER SCHEMA 1513 list 1644 PATH clause 1513 CARDINALITY 1644 CALL 1515 EXISTS 1645 CASE 1518 SINGULAR 1645 CREATE 1521 THE 1646 CREATE FUNCTION 1528 miscellaneous 1688 CREATE MODULE 1537 COALESCE 1688 CREATE PROCEDURE 1539 NULLIF 1689 DECLARE 1553 PASSTHRU 1689 DECLARE HANDLER 1558 UUIDASBLOB 1692 DELETE 1562 UUIDASCHAR 1692 DELETE FROM 1560 numeric 1605 DETACH 1562 ABS and ABSVAL 1606 EVAL 1563 ACOS 1607 FOR 1564 ASIN 1607 IF 1565 ATAN 1607 INSERT 1567 ATAN2 1607 ITERATE 1570 BITAND 1608 LEAVE 1571 BITNOT 1608 list of available 1507 BITOR 1609 Local error handler 1558
ESQL statements (continued) LOG 1572 LOOP 1573 MOVE 1574 PASSTHRU 1576 PROPAGATE 1578 REPEAT 1581 RESIGNAL 1582 RETURN 1583 SET 1585 THROW 1588 UPDATE 1589 WHILE 1592 event store PeopleSoft adapter 47 exception handling, Java 520 ExceptionList tree 76 accessing with ESQL 339 exceptions, message tree content Extract node 870
66
F failure terminals, connecting 230 fan-in flows, creating 632 fan-out flows, creating 628 Favorites category (palette) 254 FileInput node 872 mqsiarchive subdirectory 782 parsing file records 775 reading a file 783 FileOutput node 886 mqsiarchive subdirectory 782 writing a file 791 files file processing 773 additional instances 776 file name patterns 780 LocalEnvironment variables 777 mqsiarchive subdirectory 782 parsing file records 775 reading a file 783 shared access 776 writing a file 791 parsing file records 775 reading 783 writing 791 Filter node 896 FlowOrder node 900
G global environment, Java
513
H headers 568 accessing 329 Java accessing 511 copying 511 mapping 1457, 1725 HTTPHeader node 902 HTTPInput node 906 HTTPReply node 913 HTTPRequest node 915 Index
1739
I IBM Tivoli License Manager activating for WebSphere Adapters 270 IDOC parser 116 IMS 49 connecting 206 Database Manager 49 nodes 50 Transaction Manager 49 transactions 50 IMSRequest node 929 Information Management System (IMS) 49 Input node 935
K
L
J Java accessing attributes 513 accessing elements 503 accessing the global environment 513 calling a method from a mapping node 566 calling an EJB 518 classloading 501 code dependencies 500 copying a message 505 copying headers 511 creating a filter 507 creating a new message 505 creating code 498 creating elements 507 deploying code 501 developing 497 exception handling 520 headers, accessing 511 interacting with databases 515 keywords 515 logging errors 520 managing files 497 manipulating messages 502 MQMD 512 MQRFH2 512 opening files 499 propagating a message 508 saving files 499 setting elements 506 transforming messages 505 updating the Local Environment 513 user-defined properties 514 writing 502 XPath 508 Java, broker attributes accessible from 119, 288 JavaCompute node 937 accessing databases 515 using mbSQLStatement 515 using SQLJ 515 using types 2 and 4 JDBC 515 calling an EJB 518 JDBC, types 2 and 4 used by JavaCompute node 515 JMS provider, adding 205 JMSHeader node 940
1740
Mapping node (continued) functions (continued) Xpath mapping functions 1451, 1719 syntax 1446, 1714 mappings 568 adding headers and folders 547 conditional keywords 804 configuring 543 description properties 803 creating 568 displaying 248 configuring 526 ESQL 348 creating 524 Java 515 database subflows 180 adding 549 XSL style sheet 1234 BLOB message to database 558 change operation 554 database to database 557 database to message 559 source 554 Label node 971 databases 550 list of available 1592 deleting data 557 local environment, Java 513 deleting source and target 543 LocalEnvironment tree 72 derived types 523 accessing with ESQL 334 hiding 528 file processing 777 showing 528 LocalEnvironment.File structure 777 LocalEnvironment.Wildcard.WildcardMatch developing 520 ESQL routines, calling 565 structure 777 examples 572 LocalEnvironment.WrittenDestination.File from database tables 554 structure 777 from source populating Destination 337 by name 529 using as scratchpad 336 by selection 528 LocalEnvironment.File structure 777 mapping by same name 531 LocalEnvironment.Wildcard.WildcardMatch selecting matches 530 structure 777 similarity values 531 LocalEnvironment.WrittenDestination.File synonym file, algorithm to structure 777 match 537 logical message tree synonym file, creating 536 contents after exception 66 synonym file, format of 533 correlation names 79 from source messages 538 Environment tree 71 headers and folders 547 ExceptionList tree 76 headers, configuring 547 LocalEnvironment tree 72 Java methods, calling 566 message body 69 list types 523 Properties folder 69 LocalEnvironment, configuring 546 structure 68 map file, creating 525 logical message tree, viewing 189 map file, creating from DataDelete lost messages, avoiding 225 node 553 map file, creating from DataInsert node 552 map file, creating from DataUpdate map file, creating 525 node 553 map file, creating from DataDelete map file, creating from mapping node 553 node 526 map file, creating from DataInsert mappable headers 1457, 1725 node 552 Mapping node casts 1456, 1724 map file, creating from DataUpdate Mapping node functions 1448, 1716 node 553 ESQL mapping functions 1448, map file, creating from node 526 1716 Mapping node 973 predefined mapping casts 1456, 1724 functions 1455, 1723 functions 1448, 1716 XPath mapping functions 1451, ESQL mapping functions 1448, 1719 1716 Mapping node syntax 1446, 1714 predefined mapping Message Mapping editor 1436, 1703 functions 1455, 1723 Edit pane 1442, 1711 JMSInput node 943 JMSMQTransform node JMSOutput node 956 JMSReply node 967 JVM heap size 183
Message Flows
M
955
mappings (continued) Message Mapping editor (continued) Source pane 1437, 1704 Spreadsheet pane 1443, 1711 Target pane 1440, 1708 message, adding 548 migrating 1457, 1725 restrictions 1458, 1726 overview 521 populate 546 removing headers and folders 547 repeating elements, configuring 544 restrictions 569 scenarios 572 schema structure 523 SOAP 567 statements, order 568 submaps 559 calling 563 converting a message map 562 converting an inline mapping 562 creating 559 modify database 561 wildcard source 560 subroutines 559 calling from ESQL 564 user-defined, calling 565 substituting elements hiding 527 showing 527 substitution groups 523 target, setting the value to a constant 539 to a WebSphere MQ constant 540 to an ESQL constant 540 using a function 541 using an expression 541 union types 523 wildcards 523 mbSQLStatement used by JavaCompute node 515 message assembly 68 message body 69 ESQL, accessing with 308 message collection 148 collector node, configuring 648 collector node, using 646 message definitions importing from WSDL WSDL validation 684 message destination mode 956 message flow nodes 806 AggregateControl 808 AggregateReply 810 AggregateRequest 813 Check 815 Collector 818 Compute 823 Database 831 DatabaseRetrieve 836 DatabaseRoute 844 DataDelete 852 DataInsert 855 DataUpdate 858 dynamic terminals, adding 262
message flow nodes (continued) EmailOutput 861 EndpointLookup 867 Extract 870 FileInput 872 FileOutput 886 Filter 896 FlowOrder 900 HTTPHeader 902 HTTPInput 906 HTTPReply 913 HTTPRequest 915 IMS nodes 50 IMSRequest 929 Input 935 JavaCompute 937 JMSHeader 940 JMSInput 943 JMSMQTransform 955 JMSOutput 956 JMSReply 967 Label 971 Mapping 973 MQeInput 978 MQeOutput 986 MQGet 989 MQHeader 1000 MQInput 1005 MQJMSTransform 1018 MQOptimizedFlow 1019 MQOutput 1021 MQReply 1028 Output 1032 Passthrough 1034 PeopleSoftInput 1035 PeopleSoftRequest 1039 PHPCompute 1042 Publication 1045 Real-timeInput 1047 Real-timeOptimizedFlow 1050 RegistryLookup 1052 ResetContentDescriptor 1055 Route 1061 RouteToLabel 1064 SAPInput 1066 SAPRequest 1070 SCADAInput 1073 SCADAOutput 1080 SiebelInput 1083 SiebelRequest 1086 SOAPAsyncRequest 1090 SOAPAsyncResponse 1100 SOAPEnvelope 1104 SOAPExtract 1107 SOAPInput 1112 SOAPReply 1122 SOAPRequest 1124 TCPIPClientInput 1134 TCPIPClientOutput 1146 TCPIPClientReceive 1155 TCPIPServerInput 1166 TCPIPServerOutput 1177 TCPIPServerReceive 1186 Throw 1197 TimeoutControl 1199 TimeoutNotification 1202 Trace 1206
message flow nodes (continued) TryCatch 1210 TwineballInput 1212 TwineballRequest 1216 Validate 1218 Warehouse 1222 WebSphere Adapters 7 PeopleSoftInput 1035 PeopleSoftRequest 1039 SAPInput 1066 SAPRequest 1070 SiebelInput 1083 SiebelRequest 1086 TwineballInput 1212 TwineballRequest 1216 XSLTransform 1225 message flows 4 accessing databases 193 from ESQL 195 accounting and statistics data 141 accounting origin 143 collecting 619 collection options 142 details 1408 example output 1420 output data formats 1409 output formats 144 parameters, modifying 624 parameters, viewing 623 resetting archive data 625 setting accounting origin 621 starting 620 stopping 623 aggregation 146 database deadlocks, resolving 644 exceptions, handling 644 fan-in flow, creating 632 fan-out and fan-in flows, associating 637 fan-out flow, creating 628 multiple AggregateControl nodes 640 requests and responses, correlating 641 timeouts, setting 639 unknown and timeout message exceptions 645 bend points 60 adding 266 removing 267 broker properties 119, 288 broker schemas creating 241 deleting 248 built-in nodes 806 Chinese code page GB18030 1381 cluster queues 185 code page support 1353 collector node control messages, using 655 comment and path 59 configurable properties 1398 Additional Instances 1398 Commit Count 1398 Commit Interval 1398 Coordinated Transaction 1398
Index
1741
message flows (continued) configuration for globally coordinated transactions 196 connections 60 adding with the mouse 264 adding with the Terminal Selection dialog 265 removing 266 conversion exception trace output 1394 coordination 122 database connections 1424 database support 1424 copying 244 correcting save errors 251 creating 242 creating ESQL code 296 creating using a Quick Start wizard 153 customizing nodes with ESQL 305 data conversion 207 data integrity 1385 data types 1425 BLOB message 1428 DestinationData subtree 1427 headers 1426 Properties subtree 1426 database listing connections 1382 database exception trace output 1392 default version 803 defining content 252 deleting 247 description properties 803 keywords 803 designing 161 destination lists creating 184 using to route messages 178 errors 227 catching in TryCatch 236 connecting failure terminals 230 input node 230 MQInput node 232 TimeoutNotification node 235 ESQL 283 events exporting monitoring schemas 137 reporting monitoring settings 140 exception list structure 1390 exceptions, catching in TryCatch 236 execution model 61 generating events 125 globally coordinated transaction 122 input nodes configuring JMS nodes 199 defining characteristics 175 using more than one 174 JVM heap size 183 keywords description properties 803 guidance 804 logical message tree, viewing 189 lost messages, avoiding 225 managing ESQL files 293 message collection 148
1742
Message Flows
message flows (continued) collection expiry, setting 652 collection name, setting 653 collector node, configuring 648 collector node, using 646 event coordination, setting 654 event handler properties, setting 649 input terminals, adding 649 persistence mode, setting 654 message content, testing 178 message parser element definitions 1425 message structure, testing 177 MIME message details 112 tree details 114 monitoring 125 activating 135 basics 126 configuring event sources 130, 133 deciding how to configure events 128 enabling and disabling event sources 136 event 1406 exporting schemas 137 profile 1401 reporting 140 types of 127 moving 246 nodes 5 adding with the GUI 255 adding with the keyboard 256 aligning 268 arranging 268 configuring 259 connecting with the mouse 264 connecting with the Terminal Selection dialog 265 deciding which to use 163 decision making 176 dragging resources from the Navigator 257 dynamic terminals, adding 262 removing 262 renaming 258 opening 243 order, imposing 177 palette 56 Favorites category 254 Parse Timing property 1389 parser exception trace output 1396 parsers 82 BLOB 116 DataObject 109 IDOC 116 JMS 110 MIME 110 MQCFH 1429 MQCIH 1429 MQDLH 1430 MQIIH 1430 MQMD 1431 MQMDE 1432 MQRFH 1433
message flows (continued) parsers (continued) MQRFH2 1433 MQRFH2C 1433 MQRMH 1433 MQSAPH 1434 MQWIH 1434 MRM 107 SMQ_BMH 1435 SOAP 87 XML 107 XMLNS 103 XMLNSC 94 porting considerations 1400 preferences 803 projects 5 creating 239 creating using a Quick Start wizard 153 deleting 240 managing 238 promoted properties 119 converging 617 promoting 612 removing 616 renaming 615 properties 118 relationship with ESQL and mappings 57, 522 renaming 245 response time, optimizing 180 restrictions for code page GB18030 1381 save errors, correcting 251 saving 249 saving as 250 shared queues 186 stack size, determining 183 style sheet keywords 1234 subflows 5 adding 258 configuring 259 keywords 180 removing 262 renaming 258 using 179 supported code sets 1353 system considerations 183 terminals 60 dynamic terminals, adding 262 threading 61 timeout control automatic messages 661 multiple messages 660 performance considerations 662 sending a message 658 sending messages at a specified time 660 transaction support 122 TryCatch catching exceptions 236 user database DBCS restrictions 1382 quiescing 1382 Unicode string functions 1384 user exception trace output 1396 user exits 151
message flows (continued) deploying 626 developing 625 exploiting 222 user-defined nodes 1235 user-defined properties 120 validating messages 187 validation properties 1386 version and keywords 59 version and keywords, displaying 248 WebSphere Adapters 269 WebSphere MQ connections 1381 WebSphere MQ message groups receiving messages 663 sending messages 665 WebSphere MQ message segments sending segments 665 which XML parser 85 XML parsers 90 z/OS data sources Compute node 1477 Database node 1477 message groups receiving 663 sending 665 Message Mapping editor 1436, 1703 Edit pane 1442, 1711 Source pane 1437, 1704 Spreadsheet pane 1443, 1711 Target pane 1440, 1708 message segments sending 665 message set files creating using a Quick Start wizard 153 message set projects creating using a Quick Start wizard 153 message sets creating using a Quick Start wizard 153 using existing message set in a Quick Start wizard 156 message tree options XMLNSC parser 100 messages Java, manipulating 502 parsing on demand 1389 partial parsing 1389 self-defining and predefined 81 validating Fix property 1386 in message flows 187 Include All Value Constraints property 1386 Validate property 1386 migration mappings 1457, 1725 restrictions 1458, 1726 MIME message details 112 tree details 114 monitoring 125 activating 135 adding an event source 130, 133 basics 126
monitoring (continued) configuring event sources 130, 133 deciding how to configure events 128 enabling and disabling event sources 136 event 1406 exporting a monitoring profile 140 exporting schemas 137 profile 1401 reporting settings 140 types of 127 MQCFH header accessing with ESQL 331 MQeInput node 978 MQeOutput node 986 MQGet node 989 request-response scenario 213 example message trees 218 MQHeader node 1000 MQInput node 1005 MQJMSTransform node 1018 MQMD (message descriptor) accessing with ESQL 330 MQOptimizedFlow node 1019 MQOutput node 1021 MQPCF header accessing with ESQL 331 MQReply node 1028 MQRFH2 header accessing with ESQL 330 mqsiarchive subdirectory 782
N namespace support XML parsers 106 null values XMLNSC parser 95 NULL values XMLNS parser 103 numeric order in data conversion
150
O opaque parsing XMLNSC parser 97 Opaque parsing XMLNS parser 104 Oracle naming restrictions for database objects 1446, 1714 order imposing within a message flow Output node 1032
P palette 56 customizing 253 Favorites category 254 layout, changing 252 settings, changing 253 parsers 82 BLOB 116 choosing 84
177
parsers (continued) DataObject 109 IDOC 116 JMS 110 MIME 110 MQCFH 1429 MQCIH 1429 MQDLH 1430 MQIIH 1430 MQMD 1431 MQMDE 1432 MQRFH 1433 MQRFH2 1433 MQRFH2C 1433 MQRMH 1433 MQSAPH 1434 MQWIH 1434 MRM 107 null handling 117 partial parsing 1389 SMQ_BMH 1435 SOAP 87 message details 88 tree details 88 XML 107 XMLNS 103 XMLNSC 94 parsing messages 82 Passthrough node 1034 PeopleCode 1335 PeopleSoft dependencies 277 PeopleSoftInput node 1035 PeopleSoftRequest node 1039 PeopleTools custom event project 279 performance message flow response time 180 PHP accessing broker properties 457 accessing headers 456 accessing user-defined properties 458 annotations 442 @MessageBrokerCopyTransform 443 @MessageBrokerLocalEnvironmentTransform @MessageBrokerRouter 444 @MessageBrokerSimpleTransform 442 arrays 445 associating code with the PHPCompute node 441 calling Java 458 creating code 439 deploying code 448 developing 438 element tree, traversing 449 elements accessing the message tree 449 creating 453 manipulating 452 elements, accessing information 450 Global Environment, updating 457 Local Environment, updating 456 MbsElement arrays 447 messages accessing the message tree 455 copying 451 creating 451 routing 454 Index
1743
444
PHP (continued) messages (continued) transforming 450 overview 439 writing code 439 XML namespace support 454 PHPCompute node 1042 policy sets associating with message flows and nodes 711 implementing web services security 702 overview 703 populate 546 predefined messages 81 projects message flows 5 promoted properties 119 converging 617 promoting 612 removing 616 renaming 615 properties complex 119, 288 message flow 118 PeopleSoft adapter 1333 SAP adapter 1235 Siebel adapter 1311 WebSphere Adapters nodes 1235 Properties folder 69 Properties tree, accessing with ESQL 333 Publication node 1045
Q queues cluster 185 shared 186 Quick Start wizards Create New Web Service Usage wizard 157 introduction 152 overview 153 Start from adapter connection 157 Start from existing message set wizard 156 Start from scratch wizard 153 Start from WSDL and/or XSD files wizard 154 quiescing databases 1382
R Real-timeInput node 1047 Real-timeOptimizedFlow node 1050 RegistryLookup node 1052 repeating elements, configuring mappings 544 reply message, sending 956 request message, sending 956 ResetContentDescriptor node 1055 Route node 1061 RouteToLabel node 1064
1744
Message Flows
S SAP configurable services 281 connection details, changing 281 dependencies 271 server, configuring 272 SAPInput node 1066 SAPRequest node 1070 SCADAInput node 1073 SCADAOutput node 1080 schemas, broker 123 self-defining messages 81 setting accounting origin 621 shared access, file processing 776 shared queues 186 Siebel application, configuring 275 dependencies 274 SiebelInput node 1083 SiebelRequest node 1086 snapshot data 142 SOAP parser example usage of 678 main message flow 678 testing using HTTP 683 using integrated client 682 SOAPAsyncRequest node 1090 SOAPAsyncResponse node 1100 SOAPEnvelope node 1104 SOAPExtract node 1107 SOAPInput node 1112 SOAPReply node 1122 SOAPRequest node 1124 specifying opaque elements XMLNSC parser 98 SQLJ used by JavaCompute node 515 stack size increasing 183 statistics and accounting data 141 accounting origin 143 collecting 619 collection options 142 output formats 144 parameters, modifying 624 parameters, viewing 623 resetting archive data 625 setting accounting origin 621 starting 620 stopping 623 subflows 5 adding 258 configuring 259 keywords 180 removing 262 renaming 258 using 179
T TCP/IP 470 connection management nodes 473 overview 470
476
TCP/IP (continued) Scenarios Message Broker using TCP/IP 481 TCP/IP only 478 Working with 482 TCPIPClientInput node 1134 TCPIPClientOutput node 1146 TCPIPClientReceive node 1155 TCPIPServerInput node 1166 TCPIPServerOutput node 1177 TCPIPServerReceive node 1186 terminals dynamic 60 dynamic terminals, adding 262 message flows 60 Throw node 1197 timeout control automatic messages 661 multiple messages 660 performance considerations 662 sending a message 658 sending messages at a specified time 660 timeout request messages, example XML 658 timeout request messages, predefined schema definition 658 timeout request messages, sending 656 TimeoutControl node 1199 TimeoutNotification node 1202 error handling 235 timeouts aggregation 639 Trace node 1206 trademarks 1735 transactions, IMS 50 TryCatch node 1210 catching exceptions 236 TwineballInput node 1212 TwineballRequest node 1216
U user databases accessing 193 from ESQL 195 user exits 151 deploying 626 developing 625 exploiting 222 user-defined nodes 1235 user-defined properties message flow 120
V Validate node 1218 validation XMLNSC parser 98 validation, message 187 version default value 803 displaying 248 version and keywords, message flows 59
W Warehouse node 1222 Web services 669 using MTOM 688 web services addressing example usage building the logger message flow 748 building the main message flow 746 deploying the message flows 749 testing the message flows 750 example use 697 how to use 691 information in LocalEnvironment 695 overview 688 SOAPAsync nodes, using with 694 SOAPInput node, using with 691 SOAPReply node, using with 693 SOAPRequest node, using with 693 WebSphere Adapters nodes 7 EIS, connecting 280 Enterprise Information System, connecting 280 IBM Tivoli License Manager, activating 270 message flows, developing 269 PeopleCode 1335 PeopleSoft dependencies 277 PeopleSoftInput 1035 PeopleSoftRequest 1039 PeopleTools custom event project 279 properties 1235 PeopleSoft 1333 SAP 1235 Siebel 1311 SAP configurable services 281 connection details, changing 281 dependencies 271 server, configuring 272 SAPInput 1066 SAPRequest 1070 Siebel application, configuring 275 dependencies 274 SiebelInput 1083 SiebelRequest 1086 TwineballInput 1212 TwineballRequest 1216 WebSphere MQ connections 1381 message groups receiving messages 663 sending messages 665 message segments sending segments 665 WebSphere Service Registry and Repository 720 Cache 727 configuring loading options 728 loading strategy 728 setting up Cache Notification 730 LocalEnvironment 732 defining search criteria 732
WebSphere Service Registry and Repository (continued) LocalEnvironment (continued) EndpointLookup node output 733 RegistryLookup node output 735 nodes changing configuration parameters 724 configuration parameters 721 displaying configuration parameters 723 secure 725 wildcards in file name patterns 780 writing messages 82 WS-Security capabilities 714 implementing 702 mechanisms 701 security 699 WSDL applications 683 configuring message flows 686 use in a Quick Start wizard 154 validation 684
XMLNSC parser data types 101 DTD support 102 empty elements 95 message tree options 100 null values 95 opaque parsing 97 specifying opaque elements 98 validation 98 XPath 508 mapping functions 1451, 1719 aggregating XPath expressions 1452, 1720 for expression 1454, 1722 XPath property editors 1492 XSD use in a Quick Start wizard 154 XSL style sheet, keywords 1234 XSLTransform node 1225
Z z/OS data sources Compute node 1477 Database node 1477
X XML parsers namespace support 106 XML self-defining message AttributeDef 1472 AttributeList 1472 DocTypeComment 1473 DocTypeDecl 1469 DocTypePI 1473 DocTypeWhiteSpace 1473 document type declaration 1469 DTD 1469 example 1474 ElementDef 1472 example message 1462 external DTD 1469 inline DTD 1469 message body 1464 AsIsElementContent 1465 Attribute 1465 BitStream 1465 CDataSection 1466 Comment 1466 Content 1467 Element 1467 EntityReferenceEnd 1467 EntityReferenceStart 1467 example 1468 ProcessingInstruction 1468 NotationDecl 1470 WhiteSpace 1473 XML declaration 1463 example 1464 XML entities 1470 XMLNS parser DTD support 105 Empty elements 103 NULL values 103 XMLNS parsers Opaque parsing 104 Index
1745
1746
Message Flows
Printed in USA