webMethods

 View Only

 copy condition within a MAP

Chris kumar's profile image
Chris kumar posted Mon January 27, 2025 03:32 PM

Hi!
I want to use a “tokenize” service as a transformer within a MAP, but I want to use a copy condition to avoid the error “String field is missing.”

Is it possible to use this copy condition within a MAP?

I am using a regular expression to validate if the string is empty or exists in the pipeline, and it  (the copy condition) works only when I invoke this service outside the MAP.

I know I can add a branch to validate whether this field exists or not, but I would like to know if there is a way to do this.

Thank you for your help, Community!

Kailash Kumar Mishra's profile image
Kailash Kumar Mishra

Hi Chris,

Yes it is possible to use Copy Condition in a MAP step. But in your particular case wherein you are using a Transformer in the MAP step (pub.string:tokenize) and you want to pass Input inString to the Transformer only when your variable has an actual value can be achieved only when there are more than 1 source variables and all are mapped via a Copy Condition and at least one variable must contain a value else you will end up with same error  as the Transformer Input inString in Mandatory input: [ISS.0086.9249] Missing Parameter: inString


Something like below logic



Developer EDI's profile image
Developer EDI

Try setting a copy condition to the in string of the tokenizer like " %testkey%!=$null " , set default hardcoded value of instring to null , like below screen  shot and unselect overwrite pipeline value.

Gerardo Lisboa's profile image
Gerardo Lisboa

Hi,

The tokenizer service will most likely exit with an exception in error situations, which you have to catch and recover from.

I see that this is the situation you are trying to avoid, but remember to handle the output when the field is absent.

Best regards,

Christoph Jahn's profile image
Christoph Jahn

I had a number of comparable requirements a few years ago. What I ended up doing was my own wrapper services that would check on null/empty inputs.