ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to Extract Environment data from JCN

Post new topic  Reply to topic
 How to Extract Environment data from JCN « View previous topic :: View next topic » 
Author Message
gyadavil
PostPosted: Tue Sep 25, 2007 8:45 pm    Post subject: How to Extract Environment data from JCN Reply with quote

Acolyte

Joined: 01 Feb 2005
Posts: 62

I am trying to extract the environment variable inside a JCN which I set in a compute node. But I am always getting null for env. What's wrong with my code. Can someone help me out

ESQL:
Set Environment.Variables = Row(verb As Verb);

here verb is a variable.

JCN Code :

MbMessage inMessage = contact admin.getMessage();
MbMessage outMessage = new MbMessage(inMessage);
MbMessage env = contact admin.getGlobalEnvironment();
MbElement envElem = contact admin.getGlobalEnvironment().getRootElement();
byte[] envByte = envElem.toBitstream(null,null,null,0,1208,0);
String envStr = new String(envByte);

My Compute Node has the following properties set
Compute Mode: LocalEnvironment And Message

What is wrong with my code and why I am getting null for env variable.
Back to top
View user's profile Send private message
littlechild
PostPosted: Wed Sep 26, 2007 1:44 am    Post subject: Reply with quote

Novice

Joined: 22 Apr 2007
Posts: 17

i have written this code and it is working fine


ublic void evaluate(MbMessageAssembly assembly) throws MbException {
MbOutputTerminal out = getOutputTerminal("out");
MbOutputTerminal alt = getOutputTerminal("alternate");

MbMessage message = assembly.getMessage();

// ----------------------------------------------------------
// Add user code below


MbElement rootElement =message.getRootElement();
MbElement rootElement123 = rootElement.getFirstElementByPath("Properties").getFirstElementByPath("MQMD");
MbMessage env = assembly.getGlobalEnvironment();
MbElement envElem = assembly.getGlobalEnvironment().getRootElement();


the value for env is MbMessage
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Sep 26, 2007 3:58 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The root Environment tree does not have a parser assigned to it.

toBitstream only works on trees that have parsers assigned to them... this is why it has comments in the Javadoc for this method that tell you which trees it MUST be run against.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
gyadavil
PostPosted: Wed Sep 26, 2007 10:40 am    Post subject: Reply with quote

Acolyte

Joined: 01 Feb 2005
Posts: 62

[quote="jefflowrey"]The root Environment tree does not have a parser assigned to it.

toBitstream only works on trees that have parsers assigned to them... this is why it has comments in the Javadoc for this method that tell you which trees it MUST be run against.[/quote]

I am trying to do this

MbElement envElem = contact admin.getGlobalEnvironment().getRootElement().getFirstChild();

String envStr = (String) envElem.getValue();

my envStr is null after this.

My ESQL is
Set Environment.Variables = Row(InputRoot.Properties.MessageType As MsgType);

Set Environment.Variables = Row(verb As Verb);

What wrong I am doing. My objective is to copy the values of Verb and MsgType into Java variables.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Sep 26, 2007 10:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Your ESQL doesn't do what you think it does.

Your Java doesn't match up with what your ESQL actually does.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to Extract Environment data from JCN
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.