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 » getFirstElementByPath

Post new topic  Reply to topic
 getFirstElementByPath « View previous topic :: View next topic » 
Author Message
scravr
PostPosted: Tue Apr 23, 2013 5:43 am    Post subject: getFirstElementByPath Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

HI to All,

I have ESQL code coping data from SHARED into Env.Var.

lp : WHILE j <= i DO
SET ENV.IMSGWF.FLUSH_AREA_85.IMSGWF.DU_RCVD_TS[j] = IMSGWF_TABLE_85_ARRAY.IMSGWF.DU_RCVD_TS[j];
SET ENV.IMSGWF.FLUSH_AREA_85.IMSGWF.TECH_FNCTN_ID[j] = IMSGWF_TABLE_85_ARRAY.IMSGWF.TECH_FNCTN_ID[j];
SET j = j + 1;
END WHILE lp;

Data is passed into JCN:
for(int loop85=1;loop85<=Table85Cnti;loop85++) {
String TECH_FNCTN_ID = env.getFirstElementByPath("IMSGWF/FLUSH_AREA_85/IMSGWF/TECH_FNCTN_ID["+loop85+"]").getValueAsString();
String DU_RCVD_TS = env.getFirstElementByPath("IMSGWF/FLUSH_AREA_85/IMSGWF/DU_RCVD_TS["+loop85+"]").getValueAsString();

The first JAVA String TECH_FNCTN_ID always gets NULL.

What is the getFirstElementByPath syntax to get data from env.var array ?

Thanks,
MA
Back to top
View user's profile Send private message Send e-mail MSN Messenger
mqjeff
PostPosted: Tue Apr 23, 2013 5:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Never use [j] syntax to access or update ESQL tree members.

It's horrible for performance. When you ask it to access, say, [5], it has to navigate to first child and then navigate to next sibling four times. When you then ask it to access [6], it has to navigate to first child and then navigate to next child five times.

Your esql should be rewritten to use first child and next sibling and reference variables.

Likewise your Java code should explicitly loop over first child and next sibling references.

So you would do something like (and notice the magic of using [ code ] tags)
Code:

MbElement techFnctnId;
MbElement duRcvdTs;

techFnctnId = env.getFirstElementByPath("IMSGWF/FLUSH_AREA_85/IMSGWF/TECH_FNCTN_ID");
duRcvdTs = env.getFirstElementByPath("IMSGWF/FLUSH_AREA_85/IMSGWF/DU_RCVD_TS";

for(int loop85=1;loop85<=Table85Cnti;loop85++) {
String TECH_FNCTN_ID = tchFnctnID.getValueAsString();
String DU_RCVD_TS = duRcvdTs.getValueAsString();
tchFnctnID = tchFnctnID.getNextSibling();
duRcvdTs = duRcvdTs.getNextSibling();
}
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 » getFirstElementByPath
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.