One or another, you’ve got a lot of clicking and typing to
do! Using the map and “Copy only if” suffers from the need
to type in the fully-specified field name. In Rupinder’s
solution, it’s typed twice! Woe to the person that needs to
change a record or field name.
click…click…click…click…
I’d say using a branch is the way to go. It’s more obvious
what is happening and is easier to maintain.
/.+/ will get any characters, including field containing
only whitespace.
I use /[^ ]/ successfully to select only fields that are not
null and not spaces.
Another approach to consider is to create a service that
accepts an input and returns an output only if the input was
not null, not spaces, not whitespace, etc.
Service: copyIfNotEmpty
Input: srcField
Output: tgtField
BRANCH on \srcField
…/[^ ]/: MAP – srcField –> tgtField
…$default: MAP – drop tgtField (just to be safe)
Then you can use this service as a transformer, mapping
multiple fields as needed in a single map step. This keeps
the functionality of the “Copy only if…” but keeps field
names from being typed into text boxes.
Just a thought.
#webMethods#Adapters-and-E-Standards#Integration-Server-and-ESB