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
  • 1.  Scheduler timing

    Posted Wed December 10, 2014 01:17 AM

    Hi All,

    I got a requirement to run a scduled service every last day of the month, any clues how to achieve this?

    Regards
    sandeep


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Scheduler timing

    Posted Wed December 10, 2014 01:32 AM

    I suggest you may need three scheduler tasks:

    1> 31 Jan, Mar, May, Jul, Aug, Oct, Dec
    2> 30 Apr, Jun, Sep, Nov
    3> 28 Feb and also check for (29 Feb in a leap year)

    What is your approach on this? Can you share to assist you better.


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Scheduler timing

    Posted Wed December 10, 2014 12:27 PM

    Hi Sandeep,

    You better write a Unx Shell Script, using this single one you can easily meet your requirement. Kindly let me know if you face any issues in designing.

    Thanks,


    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Scheduler timing

    Posted Wed December 10, 2014 12:33 PM

    So you suggest create a unix script and call from IS via command line execution and schedule this service to run periodically and based on the script result flag it?

    Can you elaborate design a bit more for the users if possible?

    I am sure this can be done via OS script or custom JS logic.

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Scheduler timing

    Posted Thu December 11, 2014 12:08 PM

    Why don’t we write a wrapper service which checks if today is the last day of the month and then execute the service.
    And then schedule the wrapper service everyday??

    Calendar cal = Calendar.getInstance();
    cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
    Date lastDayOfMonth = cal.getTime();

    get this date and compare it with today’s date and then branch .


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Scheduler timing

    Posted Fri December 12, 2014 12:46 AM

    Hi RMG,

    Here you go with it:

    Use Developer to generate a java application that will invoke your service from the command line and then code your script to do so.

    In Developer, go to Tools->Generate Code->For calling this service from a client->Java.

    And in shell script you follow below one:

    #!bin/sh
    path/to/java test

    where test is the name of java class.

    Please try to implement and let us know if any hinderances.

    Thanks,


    #Integration-Server-and-ESB
    #webMethods