IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Compare date to current system date

  • 1.  Compare date to current system date

    Posted Thu June 01, 2006 06:09 PM

    Hello everyone.

    I need to do the following:

    •      Get the system date
      
    •      Get the date from a field on a flat file
      
    •      If the date field on the flat file is more than 7 days older than the system date, do something
      

    Can someone provide tips as to how to accomplish this?

    Thanks.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: Compare date to current system date

    Posted Thu June 01, 2006 06:31 PM

    Kendrix,

    If you have PSUtilities package installed on your IS, it contains PSUtilities.date:calculateDateDifference service which gives out “dateDifferenceDay”.So put a logic to branch on the dateDifferenceDay value it works as expected.Or else build a custom Javaservice using Java calendar API’s to achieve this.

    HTH,
    RMG


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: Compare date to current system date

    Posted Thu June 01, 2006 06:42 PM

    Hi Kendrix,
    There is no built-in service in IS which accepts 2 dates as input and gives you the out the noOfDaysDiff. So write a Java service.

    Just do a google search and you will find lots of Java code snippet which does that.

    First try yourself, if you find difficulty writing such code, we can send you the code.

    This is very common utility we all webMethods veteran frequently need and so we have it.

    Regards,
    Bhawesh.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB