I’m of the school that preaches “Avoid Java codes whenever possible”. That is, I think they’re too often used when people are too lazy to find built-in services that can accomplish the same thing (only much easier). Of course, some Java codes are unavoidable, especially relating to integrating backend systems, but in general, we really shouldn’t overuse them.
I think Java codes are harder to maintain (think deployment!), and require a different skill set (Java programming skils).
Okay, so with all that rumbling, how would one accomplish this with services?
- How do we check if date is after a certain date? (or if it’s within a range).
- Easy enough. Just compare with a branch (something like: “%inputDate% > ‘20041231’”).
- How to check it’s a valid date? Okay, pub.date:dateTimeFormat has a unique property of “rolling-over” dates. That is, it’ll accept 20051232 as a valid substitution for 20060101. But we’ll use this property to our advantage when checking for a valid date:
- pub.date:dateTimeFormat. currentPattern = “yyyyMMdd”, newPattern = “yyyyMMdd”.
Huh? Did I type that right?
Well, actually, yes. You just compared input and output values. If the date did roll-over, then they aren’t equal. That didn’t take much effort, did it? 8)
#webMethods-Architecture#webMethods#Integration-Server-and-ESB#webMethods-General