I’ve had some success with the code below. It takes 3 params - a query (object), FromDate and ToDate (both strings) as input. It then maniputes the query object so the query date period is set to these dates. The modified query object is returned as output.
Note: the code is pretty skeletal (no error handling).
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String ToDate = IDataUtil.getString( pipelineCursor, “ToDate” );
Object query = IDataUtil.get( pipelineCursor, “query” );
String FromDate = IDataUtil.getString( pipelineCursor, “FromDate” );
pipelineCursor.destroy();
SimpleDocQuery sdq=null ;
try
{
sdq = (SimpleDocQuery) query;
FromDate = FromDate.trim();
ToDate = ToDate.trim();
SimpleDateFormat simpledateformat = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”);
Date date = simpledateformat.parse(FromDate);
Date date1 = simpledateformat.parse(ToDate);
if(date1.after(date))
sdq.setTimeInterval(new Timestamp(date.getTime()), new Timestamp(date1.getTime()));
}
catch(Throwable throwable)
{
}
finally
{
}
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
Object query_1 = new Object();
IDataUtil.put( pipelineCursor_1, “query”, sdq );
IDataUtil.put( pipelineCursor_1, “queryDesc”, sdq.toString() );
pipelineCursor_1.destroy();
#Integration-Server-and-ESB#B2B-Integration#webMethods