Updating the LocalEnvironment with the JavaCompute node

The LocalEnvironment tree is part of the logical message tree in which you can store information while the message flow processes the message.

The following information shows how to update the LocalEnvironment:

  1. Make a new copy of the local environment to update it. Use the full version of the copy constructor to create a new MbMessageAssembly object, as shown in the following example:
    MbMessage env = assembly.getLocalEnvironment();
    MbMessage newEnv = new MbMessage(env);
    
    newEnv.getRootElement().createElementAsFirstChild(
    		MbElement.TYPE_NAME_VALUE,
    		"Status",
    		"Success");
    
    MbMessageAssembly outAssembly = new MbMessageAssembly(
    		assembly,
    		newEnv,
    		assembly.getExceptionList(),
    		assembly.getMessage());
    
    getOutputTerminal("out").propagate(outAssembly);
  2. Edit the copy to update the LocalEnvironment.
Related concepts
Local environment tree structure
Message flows overview
Related tasks
Writing Java
Designing a message flow
Creating destination lists
Defining message flow content
Related information
Java user-defined extensions API
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009.
Last updated : 2009-01-07 15:20:38

ac30470_