Hello all,
this should be an easy one...although I can't find the answer. I had the same problem on version 6.0 and I though that there would be a built-in way to do this on version 6.1.
I'm calling a simple transformer (pub.date:dateTimeFormat for example) but it's giving me an error when my input is not provided in my input flat file. I know that we can put a Copy condition on the map but what this condition is doing is that if the condition doesn't match it will not pass the data to the input parameter but it will still try to execute the transformer.
What I'm actually looking for is that my transformer doesn't get called when my input parameter is Null. What I'm doing now is that I created a flow that is calling that pub.date:dateTimeFormat and I'm doing a branch at the beginning that will look for my input not to be $null and then decide if I'm doing something with it or not. That way, I don't get something like :Invalid date pattern or input. I just find it weird that there's no built-in way to do that simple task.
Does somebody have an idea for this one? Maybe I just didn't find it.
Thanks.
Yes,Branch operation is the only way of handling that will fit your requirement specified,ofcourse you are in the right direction.
Copy Onlyif Condition will work for normal condition mapping like if corresponding input is null or not null that will tell the source or target field to map the value or ignore the map.
HTH,
Mathieu,
Another approach would be to build a Flow or java service that invoked the pub.date:dateTimeFormat but that handled a null input condition more to your liking by producing an acceptable default value instead of throwing an exception.
Use the new service as your transformer to eliminate the need for extraneous BRANCH statements.
Mark
Mark,
that’s exactly what I’m doing but I though there would be a more intelligent way of doing it. I just find it strange that we have something like the Copy condition that will not pass the data to the transformer but there nothing built-in not to execute the transformer especially when this one is not coded to handle that kind of check at the beginning.
My only concern is that there A LOT of transformers like this one…almost all the math ones can return an error if the input is not provided or $null.
Thanks for your help and if there’s somebody from webMethods reading this, it would really be a good add-on for the next version.
Mathieu
There is an ExtraUtilities package on Advantage that contains a version of pub.date:dateTimeFormat that does not throw an exception when the input value is a null:
[url=“http://advantage.webmethods.com/cgi-bin/advantage/main.jsp?w=0&s=3261077040&targChanId=-536882954”]http://advantage.webmethods.com/cgi-bin/advantage/main.jsp?w=0&s=3261077040&targChanId=-536882954[/url]
Many of the existing WmPublic services were written before there were Flow Map Transformers, therefore, they may be more strict in exception throwing that one would need for a Transformer call. They cannot be modified in place for backward compatibility reasons and building in another set into WmPublic will bloat the core product for everyone. Also, ExtraUtilities can be updated without being dependent on a full Integration Server release.
Post the specific list of WmPublic services that throw exceptions that are inappropriate for use as a Flow Map Transformer and I’ll try to get ExtraUtilities to include them.
Cheers,
Fred
For the math functions some of these are covered in the PSUtilities package found on the same link. The package also contains a lot of other usefull services.
Cheers,
Bent
Thank you all for your answers!
Have a nice day.
Mathieu