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 » Temporary Variables in Mapping node

Post new topic  Reply to topic
 Temporary Variables in Mapping node « View previous topic :: View next topic » 
Author Message
sridhsri
PostPosted: Fri Jul 04, 2008 8:54 am    Post subject: Temporary Variables in Mapping node Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

I have an incoming message with an element that has an unbounded occurrence. From this message based on certain conditions on these elements, I need to generate the output message. The header of the output message must contain the number of elements that were created in the output.

1) I can only use the mapping node
2) The header must contain the number of records in the message

I know it can be done with two mapping nodes. But I am trying to see if it can be done with one mapping node and no calling esql or java from mapping.

The problem
1) How to fill the header record last although it appears first in the MRM ?
2) How can you use temporary variables (including localenvironment) as an counter to count the number of output items ?
Back to top
View user's profile Send private message
Gemz
PostPosted: Fri Jul 04, 2008 9:10 am    Post subject: Reply with quote

Centurion

Joined: 14 Jan 2008
Posts: 124

Do you mean you want to count the number of records in the message.

Can you please post a sample message?

Thanks
Back to top
View user's profile Send private message
sridhsri
PostPosted: Fri Jul 04, 2008 9:20 am    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

Yes. I want to count the number of records that will be generated in the output. This count is also part of the outgoing message.

Incoming Message:

<Root>
<Elem1></Elem1>
<Elem1></Elem1>
<Elem1></Elem1>
<Elem1></Elem1>
.
.
.
</Root>


Outgoing Message:

Header: 4
Elem1: ...
Elem1: ...
Elem1: ...
Elem1: ...
Back to top
View user's profile Send private message
sridhsri
PostPosted: Fri Jul 04, 2008 9:21 am    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

PS: Not all incoming <Elem1> elements need to be present in the output. It will be based on some condition.
Back to top
View user's profile Send private message
Gemz
PostPosted: Fri Jul 04, 2008 9:33 am    Post subject: Reply with quote

Centurion

Joined: 14 Jan 2008
Posts: 124

You can achieve this using 'fn:count()' method in the mapping node.

i.e. set 'fn:count($source/Root/Elem1)' in the Header field of the mapping node.
Now Header will hav the number of 'Elem1' elements in the input.
Back to top
View user's profile Send private message
sridhsri
PostPosted: Fri Jul 04, 2008 9:36 am    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

I don't think that will work. count() will only work on the source - as you pointed out. I am not interested in the number of incoming "elem1" elements. I am interested in the count of outgoing "elem1" elements.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Jul 04, 2008 9:57 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Moved to WMB Forum
_________________
Peter Potkay
Keep Calm and MQ On
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 » Temporary Variables in Mapping node
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.