mardi 25 juin 2019

Which design pattern to use for a sequence of task in Java?

I want to build a sequence of task for a Java application in Dropwizard. The task should be stored inside a database

Consider a the following sequence of tasks:

Task 1
  Inputfile  : inputA
  Outputfile : outputA
Task 2 
  Inputfile  : outputA
  Outputfile : outputB

So simply the task 2 depends on output from task 1. The set of task is defined in a database. So that the java application can preform them only with the input files.

Since data base also stores each task I was thinking about using a job scheduler that handles checks periodically the existence of task and then runs them in succession. But then how can I wait for previous tasks? Is there a more elegant solution? Or a design pattern that can handles this issue?

Aucun commentaire:

Enregistrer un commentaire