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 access the last two in a chain of exceptions

Post new topic  Reply to topic
 how to access the last two in a chain of exceptions « View previous topic :: View next topic » 
Author Message
pcelari
PostPosted: Wed Dec 01, 2010 12:14 pm    Post subject: how to access the last two in a chain of exceptions Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

Hi,

the ExceptionList can be very long, containing many subtrees, typically

ExceptionList.parserException.ParserException...ParserException.

But of interest are normally only the last two children in the last layer. I'm thinking to capture only these last two and write to a file or email.

However, without knowing the number of layers, how can I access them?

Can anyone please share some insight?


_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
j.f.sorge
PostPosted: Wed Dec 01, 2010 1:04 pm    Post subject: Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

I think there was an error handling sample delivered with the toolkit, but you can do it on you're own by using a REFERENCE and move it to the LASTCHILD until you cannot move further. Than go back to the Exception tree you want to store / parse / etc.
_________________
IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
harish_td
PostPosted: Wed Dec 01, 2010 5:56 pm    Post subject: Reply with quote

Master

Joined: 13 Feb 2006
Posts: 236

Code:
      
      DECLARE ErrorNumber INTEGER 0;  /* Error number extracted from exception list */
      DECLARE ErrDesc CHARACTER '';  /* Error Description extracted from exception list */
      DECLARE ErrType CHARACTER ''; /* Type of Message Broker exception */

-- Declare a reference for the InputExceptionList
      DECLARE ptrException REFERENCE TO InputExceptionList.*[1];      
      WHILE lastmove(ptrException) DO
         -- store the current values for the error number and text
         IF ptrException.Number is not null THEN
              SET ErrorNumber = ptrException.Number;
              SET ErrDesc = ptrException.*[<].Text;
              --The nature of the exception would be contained in this structure. Print this out to the user
            SET ErrType = FIELDNAME(ptrException);
              
           END IF;
              
           -- now move to the last child which should be the next exceptionlist
         move ptrException lastchild;
      END WHILE;
Back to top
View user's profile Send private message Yahoo Messenger
pcelari
PostPosted: Thu Dec 02, 2010 5:39 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

thanks so much for the input!

here's my code that now works. I didn't realize it could be so simple.

DECLARE start REFERENCE TO InputExceptionList.*[<].*[<];
WHILE start.Number IS NOT NULL DO
-- Move start to the last child of the field to which it currently points
MOVE start LASTCHILD;
END WHILE;

MOVE start PARENT;


_________________
pcelari
-----------------------------------------
- a master of always being a newbie
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 access the last two in a chain of exceptions
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.