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 » XML to XML Nested Mapping Transform - XML Element Missing

Post new topic  Reply to topic
 XML to XML Nested Mapping Transform - XML Element Missing « View previous topic :: View next topic » 
Author Message
bdaoust
PostPosted: Wed Oct 21, 2015 12:10 pm    Post subject: XML to XML Nested Mapping Transform - XML Element Missing Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Hi all:

I have a map that does a For Each transformation within an XML sequence.

Basically for each for each - it evaluates short description and tranforms to the matching element on the output of the map.

Example:

If shortdescription = 'Yellow" >>>> transform to XML Element "TotalYellow"

If shortdescription = "Blue" >>>>> transform (move) to XML element "TotalBliue"

During the map - some colors may be missing, but I need to maintain the XML Output structure, so output elements I set Nillable to 'true'

So I did a simple test where I had a Yellow but not Blue. The output I got TotalYellow XML element, but I did not get TotalBlue even though I set it to nullable.

For giggles I removed the Blue transform/condition from the map - redeployed - and got the TotalBlue (blank element) which is what I want.

So seems like even if the output element is set to nillable - if I have a transformed wire to element in a map and the condition isn't mapped - I don't get the XML elelemt.

Any ideas?
Back to top
View user's profile Send private message
bdaoust
PostPosted: Wed Oct 21, 2015 12:32 pm    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Just did another test were i had a single XML element mapped to another single XML element, so no for each stuff going on.

The input had a null value and I did get the resulting XML element.

Appears to be something within the For/Each - If transforms.

Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Oct 21, 2015 12:45 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You need to conduct the mapping inside the foreach submap (I'm sure you know that).

Then you need to conduct each individual mapping with an if that checks the existance, or a default value (whatever mapping calls those).
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
bdaoust
PostPosted: Wed Oct 21, 2015 4:19 pm    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Ya, I'm doing submaps.

For Each >> IF >>> Move

Where I'm stuck is that if IF is false, then I still want to Move to that element (TotalBlue) with a null value.

So I need to do this in the second submap I would think.

I see I can do custom ESQL, but is that overkill?

Recommendations?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Oct 22, 2015 5:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You wouldn't need a submap?

Just an ELSE clause?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
bdaoust
PostPosted: Thu Oct 22, 2015 10:33 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

I ended up just created a proper DFDL with a header and a record. In the header, I just made each element's default value be equal to the element's name. Getting what I need now.

Found some good labs on message modeling.

Wish the classes I took did more hands on labs. I one of those people that learns by example and many mistakes!
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 » XML to XML Nested Mapping Transform - XML Element Missing
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.