IMO the best approach would be to create something that is reusable. In this case I have created a Common Operation under Adapters (in the Enterprise Integrator).
The operation has input that is date format (i.e. the format of the date that is in the string value, according to the symbols for the java.text.SimpleDateFormat object) and the string itself.
Then you need one custom step that takes the same parameters and return a date.
Add in the code below to the custom step, and then assign the returned date as the output from the Common Operation. Now anytime you want to do a conversion from a string to a date, you can just add an operation step into your integration.
If it still sounds confusing I can just send you my implementation if you want.
// create a date formatter
SimpleDateFormat formatter = new SimpleDateFormat( javaSimpleDateFormat );
Date convertedDate = null;
try
{
// return the string as a date
convertedDate = formatter.parse( dateTime );
}
catch (ParseException e)
{
throw new RuntimeException (e.toString());
}
return new BrokerDate (convertedDate);
#webMethods#webMethods-General#Integration-Server-and-ESB