WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Updating the local environment with a .NETCompute node

The local environment tree is part of the logical message tree where you can store information while the message flow processes the message.

In the following example, the C# Evaluate method, which is executed by a .NETCompute node, creates an output message assembly based on the input message assembly. The local environment that enters the .NETCompute node is copied and then updated with the name of a queue which can be used as a DestinationList to dynamically control the behavior of a later MQOutput node.
        public override void Evaluate(NBMessageAssembly inputAssembly)
        {
            NBOutputTerminal outTerminal = OutputTerminal("Out");
            // This code creates an output Assembly based on the input Assembly
            // The Local Environment is copied and editted to provide a dynamic override for the MQOutput node
            NBMessage inputLocalEnvironment = inputAssembly.LocalEnvironment;
            NBMessage outputLocalEnvironment = new NBMessage(inputLocalEnvironment);
            NBElement mqLE = outputLocalEnvironment.RootElement.CreateFirstChild(null, "Destination").CreateFirstChild(null, "MQ");
            mqLE.CreateFirstChild(null, "DestinationData").CreateFirstChild(null, "queueName", "DOTNET.OUT");
            NBMessageAssembly outAssembly = new NBMessageAssembly(inputAssembly, inputAssembly.Message, outputLocalEnvironment, inputAssembly.ExceptionList);                              
            outTerminal.Propagate(outAssembly);
        }
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:47:58


Task topicTask topic | Version 8.0.0.7 | bc34217_