This problem has confounded me for a while now. I have a flat file with segments and tag identifiers. One of the segments is optional. That is fine, but i need logic to determine if this segment exists. If it does not exist i need to do something else. All works as planned if the segment exists. If it doesn't, it appears BizTalk does not even recognize or execute any functoids related to the segment.
Here is the flat file segment:
And here is my Logical Existence connected to a Logical NOT:
Again, if the segment is completely gone (meaning no flat file xml nodes are created/translated), the Logical Existence does not even execute. I've tried scripts, functoids. I'm becoming convinced this is a bug in the mapper. Any help appreciated.
Since your input file is a flat file, the FFDASM is creating an empty node. The test run by
Logical Existence
evaluates to true on an empty node.Logical String
should work here (I was previously thinking it would return true for an empty string but it shouldn't).However, in this case, I'd probably replace all of that (including the value mapper) with a C# scripting functoid:
Give it the input of the node currently linked to
Logical String
first, and the second input to yourValue Mapping(flattening)
second, and output it directly to your destination node.You could put that into a helper assembly if it's something you use in multiple places.
If you wanted to keep it as XSLT, you could do a custom call template: