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 use a Tag Name as an Error Description ?

Post new topic  Reply to topic
 How to use a Tag Name as an Error Description ? « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Mon Mar 24, 2003 7:58 am    Post subject: How to use a Tag Name as an Error Description ? Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

HI!

I have a message flow where I need to put a Tag name as a text Error Description. This tag name will always be in the same place, but will have different values depending on errors. Is there a way to code it so that I can always put that tag in my error description output field. I have included the XML and bolded the tag that I want. The tag will always be after the closing tag of </Original ApplicationArea>

Thanks for any help you can provide!! LiasB

[<ConfirmJob revision="1.0.0" environment="Test">
<ApplicationArea>
<Sender>
<Component>Identify The Application Of Origin</Component>
<Confirmation>Never</Confirmation>
<AuthorizationId>Identify The User Of Origin</AuthorizationId>
</Sender>
<CreationDateTime>CCYY-MM-DDThh:mm:ss</CreationDateTime>
<BODId>GUID - Globally Unique Identifier</BODId>
</ApplicationArea>
<DataArea>
<Confirm/>
<Job>
<Header>
<OriginalApplicationArea>
<Sender>
<Component>OriginalBOD.Component</Component>
<Confirmation>OriginalBOD.Confirmation</Confirmation>
<AuthorizationId>OriginalBOD.AuthorizationId</AuthorizationId>
</Sender>
<CreationDateTime>OriginalBOD.CreationDateTime</CreationDateTime>
<BODId>OriginalBOD.BODId</BODId>
</OriginalApplicationArea>
<CreateSuccess>
<JobNumber>1234</JobNumber>
</CreateSuccess>
</Header>
</Job>
</DataArea>
</ConfirmJob>
][/code]
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Mar 24, 2003 8:58 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

This code:
Code:
declare myRef REFERENCE TO OutputRoot.XML.ConfirmJob.DataArea.Job.Header.OriginalApplicationArea;
move myRef NEXTSIBLING;
set Environment.Variables.Test = FIELDNAME(myRef);


gave me this in a trace file:
Code:
Environment
(
  (0x1000000)Variables = (
    (0x3000000)Test = 'CreateSuccess'
  )
)


This is with WMQI 2.1, CSD04.
Back to top
View user's profile Send private message
LH33
PostPosted: Mon Mar 24, 2003 9:13 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Thank you!! I'm trying your code now!!
Back to top
View user's profile Send private message
LH33
PostPosted: Mon Mar 24, 2003 10:18 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

The suggested code works great! Now I need a way to reference the bolded tag below to move it to an output tag. The value in the NEXTSIBLING tag will vary, but the bolded tag will always be there. Examples of the NEXTSIBLING tag are "CreateSuccess', 'ChangeSuccess', and 'CloseSuccess'. For each of these there will be a <JobNumber> associated with it that I need to move to an output field. Is there a way to reference the <JobNumber> tag without hard coding the value of NEXTSIBLING?

Thanks for any help!!! LisaB


<CreateSuccess>
<JobNumber>1234</JobNumber>
</CreateSuccess>
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Mar 24, 2003 10:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Well, in your example, the Job Number would actually be the FIRSTCHILD of your CreateSuccess tag, and not it's next sibling.

You could either move the reference to the FIRSTCHILD in order to point to your job number tag:
Code:
 MOVE myRef FIRSTCHILD;

create a new reference that points to the first child of your reference:
Code:
declare newRef REFERENCE TO myRef.*[1];

Or explicitly reference it either by position or name:
Code:
set OutputRoot.XML.OutputMessage.JobNumber = myRef.*[1];
or
Code:
set OutputRoot.XML.OutputMessage.JobNumber = myRef.JobNumber;

Chapter 2 of the ESQL Reference manual has more information about accessing fields using anonymous references.


Last edited by jefflowrey on Mon Mar 24, 2003 10:53 am; edited 1 time in total
Back to top
View user's profile Send private message
LH33
PostPosted: Mon Mar 24, 2003 10:42 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Thank you so much!!!
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 use a Tag Name as an Error Description ?
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.