locked
Handling Job Dependency RRS feed

  • Question

  • How can one specify Jobs dependency on the successful execution of another job?

    Say I would like to tigger my dispatch job only after the payment job has finished executing successfully?

    Can this be done at code level during job creation or is it more of an admin functionality, to be taken care of as part of job template?

    Thanks,

    Sanal

    Friday, November 5, 2010 5:19 PM

Answers

  • Hi Sanal,

    There is no build-in solution to handle Job Dependencies right now (only task dependencies supported), but this can be handled from your own application with use of our .NET / COM APIs.

    You can build job scheduler client application which will:

    • Monitor selected jobs,
    • React on job state change events,
    • When specified job reaches 'Finished' state another job can be submitted.

    Some sample code can be found here:

    Thank you,
    Łukasz

    • Marked as answer by Santhev Friday, November 12, 2010 1:41 PM
    Wednesday, November 10, 2010 4:15 PM

All replies

  • Instead of using 2 jobs, can you use 1 job with 2 tasks to implement this? You can pragrammatically specify task dependency when you create job and tasks.

    Monday, November 8, 2010 7:45 AM
  • Due to sensitivity reasons I cant elaborate on the Jobs.

    But the jobs are insurance specific heavy calculations/simulations - which I am splitting into smaller calculations tasks.

    In the scenario below, CalculationJob2 can be started only after CalculationJob1 has finished.

    CalculationJob1

       - Task1

       - Task2

     ...

     - TaskN

     

    CalculationJob2

     - Task1

     - Task2

     ...

      - TaskM

    As of now the work around I have thought of is to check at the end of task - if it is TaskN (logging each task status in db) and if it is indeed the last one fire a request to a client WCF to initiate CalculationJob2.

    I was hoping that there was a much easier approach available at the framework/admin level for HPC.

     

     

    Monday, November 8, 2010 11:22 AM
  • Hi Sanal,

    There is no build-in solution to handle Job Dependencies right now (only task dependencies supported), but this can be handled from your own application with use of our .NET / COM APIs.

    You can build job scheduler client application which will:

    • Monitor selected jobs,
    • React on job state change events,
    • When specified job reaches 'Finished' state another job can be submitted.

    Some sample code can be found here:

    Thank you,
    Łukasz

    • Marked as answer by Santhev Friday, November 12, 2010 1:41 PM
    Wednesday, November 10, 2010 4:15 PM
  • Hi Lukasz,

     

    This seems like the only available solution as of now, however since we are firing off the jobs from a website - It is not possible to track the jobstates i.e keep the OnJobstate delegate alive. Please correct me if I am wrong here.

     

    Hence the solution of tasks updating (and the application tracking ) a custom table with the state when they start and finish successfully.

     

    Thanks,

    Sanal

    Friday, November 12, 2010 1:45 PM