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 » Graphical Mapping - Filter unexistant elements

Post new topic  Reply to topic
 Graphical Mapping - Filter unexistant elements « View previous topic :: View next topic » 
Author Message
Sovesky
PostPosted: Fri Nov 29, 2013 9:57 am    Post subject: Graphical Mapping - Filter unexistant elements Reply with quote

Novice

Joined: 30 Aug 2013
Posts: 17

Hello all,

I'm using MB 8.0.0.2 and I'm having a problem using graphical mapping and xpath.

Imagine I want to map a text element to the leaf of the following tree (Level3):

Level1.Level2.Level3

The problem is that sometimes my service does not receive that text input. When that happens the graphical tool creates the following in my root:

Level1.Level2, where the leaf (Level2) is empty.

I want to use an xpath condition to prevent this from happening, therefore I used as a condition: $variable[not(node())] to stop that tree from being created.

Unfortunately this does not work, and the tree is still being created!

Am I missing something here? Using other approaches (ESQL, Java, etc) is not an option in my situation.

EDIT:

People shouldn't make post when they're tired. Solved with just $variable.
Back to top
View user's profile Send private message
Simbu
PostPosted: Sun Dec 01, 2013 10:21 pm    Post subject: Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

Please provide us much more information on what is the input and expected output message and how you are performing the mapping.

There is a mapping functions to check the existence of a field like ESQL EXISTS but before that you may have to check your mapping whether it is actually required.
Back to top
View user's profile Send private message
martinb
PostPosted: Fri Dec 13, 2013 9:20 am    Post subject: Reply with quote

Master

Joined: 09 Nov 2006
Posts: 210
Location: UK

Just to add you can also use the following XPath functions to implement conditional processing for mapping missing elements or the XML NULL value:

fn:empty tests whether an element has an empty value. The logical data tree NULL value is considered to be empty.

fn:nilled tests whether an XML element has the xsi:nil attribute set.

fn:exists tests whether an element is present. An XML element that has the xsi:nil attribute set is considered to be present.

By using the "Local map" (or submap) mapping construct at the high-level folder to folder would mean that if the input folder is not present the nested sub mappings of the leaf nodes will not be entered into.

Additionally the Mapping node will itself take into consideration the optionally of the source and target elements as defined in the message schema (minOccurs) when performing unconditional Move of leaf elements, so it will not always be necessary to explicitly add conditions.
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 » Graphical Mapping - Filter unexistant elements
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.