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 » Mapping Node question

Post new topic  Reply to topic
 Mapping Node question « View previous topic :: View next topic » 
Author Message
bartimaeus
PostPosted: Tue Sep 15, 2009 8:38 am    Post subject: Mapping Node question Reply with quote

Newbie

Joined: 30 Aug 2009
Posts: 5

I am just starting out with message broker flows/ maps and have a question which may sound very basic to the experts here. But, please try to respond if possible.

I have an element returned by a service which is to be mapped using a broker's mapping node. The destination is expecting precisely 50 such elements one after the other. That is, if the service returns only 5 elements of that type, I need to map these 5 elements and return 45 "nulls" (ie, <element>null</element>)along with this.

I have applied a for loop over this element returned from the service. So, all the 5 occurrences are getting mapped. However, I am not able to figure out how to map the 45 "nulls" for the absent values. The for structure expects a source path as value and is not allowing something like "50 - msgmap:occurrence($src)".

Please help me with this problem.
Back to top
View user's profile Send private message
hopsala
PostPosted: Tue Sep 15, 2009 12:50 pm    Post subject: Reply with quote

Guardian

Joined: 24 Sep 2004
Posts: 960

I'm not sure this can be done using the mapping node. You can always use ESQL or Java Compute - should be pretty straightforward.
Back to top
View user's profile Send private message
bartimaeus
PostPosted: Tue Sep 15, 2009 10:40 pm    Post subject: Reply with quote

Newbie

Joined: 30 Aug 2009
Posts: 5

Thanks for suggestion! I was aware this. But, I am under the restriction of using the mapping node only. If it is proved that this cannot be done in the mapping node at all, then perhaps we would have a look at the ESQL/ Java options.
Back to top
View user's profile Send private message
Luke
PostPosted: Wed Sep 16, 2009 12:14 am    Post subject: Re: Mapping Node question Reply with quote

Centurion

Joined: 10 Nov 2008
Posts: 128
Location: UK

I'm afraid I can't add anything to hopsala's suggestions. But, I can't help reading this:

bartimaeus wrote:
The destination is expecting precisely 50 such elements one after the other. That is, if the service returns only 5 elements of that type, I need to map these 5 elements and return 45 "nulls" (ie, <element>null</element>)along with this.


and thinking ... urggghhhhh. Please don't take that personally, I'm sure there are good reasons for doing it, or the decision is out of your hands?

It just seems strange to me to use XML, but then restrict the format of the message to such an extent. Additional processing, longer messages ... etc
Back to top
View user's profile Send private message
hopsala
PostPosted: Wed Sep 16, 2009 1:49 am    Post subject: Re: Mapping Node question Reply with quote

Guardian

Joined: 24 Sep 2004
Posts: 960

Luke - this is actually not that uncommon a requirement. Some legacy (and even non-legacy) systems require a fixed message length or a fixed occurence number. I myself had to program such flows a number of times in the past.
Oh, and I don't think bartimaeus is talking about XML.

bartimaeus - You'll have a hard time proving that something is impossible. The only way is to read the literature cover to cover. Note however that if no one here knows how to do it, there's a decent chance that it can't be done.
As for me, when I had to do this I used ESQL or Java. I remember trying to do it in a mapping node with little success, but I admit that I didn't try too hard.

Good luck!
Back to top
View user's profile Send private message
Luke
PostPosted: Wed Sep 16, 2009 2:05 am    Post subject: Re: Mapping Node question Reply with quote

Centurion

Joined: 10 Nov 2008
Posts: 128
Location: UK

hopsala wrote:

Oh, and I don't think bartimaeus is talking about XML.

Ah, OK, if that's the case then please disregard my comments. I've done plenty of transformation to fixed format messages too, usually using the MRM (CWF). I guess I've made an assumption based on the way the question was described ...
Back to top
View user's profile Send private message
bartimaeus
PostPosted: Wed Sep 16, 2009 3:25 am    Post subject: Reply with quote

Newbie

Joined: 30 Aug 2009
Posts: 5

Thanks for the prompt replies guys!

hopsala nailed it right! The destination is indeed a legacy system which can only process messages having elements with fixed occurrences. And, since the client was insisting on using mapping node, I have created a Java compute node which precedes the mapping node and creates dummy elements for the missing values.

I agree this is a very crude and inefficient approach, but had to go with this to enable the client to start some testing. I will continue to read the "literature cover to cover" and post back if I find some success.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 16, 2009 5:19 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You should be able to create a fixed for loop in the mapping node that will run for 1 to 50.

Then you can map the input or a fixed empty value, depending on if the input exists or not.
Back to top
View user's profile Send private message
bartimaeus
PostPosted: Wed Sep 16, 2009 5:31 am    Post subject: Reply with quote

Newbie

Joined: 30 Aug 2009
Posts: 5

Can you post the syntax for such a loop in the mapping node? I tried adding constant value in the for loop and it was not compiling.
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 » Mapping Node question
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.