1

I'm facing a problem of what to use to handle this question, I just need some suggestion like using what approach to do it, or others.

My question is like this: below here is the process flow of my question: I may need to read the text file, inside the text file will contain the task, like task 1, 2,4,7. Based on all these task numbers, I'll need to get the correct script that is placed in another folder, then start the process.

It will be processed one by one, until all the task in the text file have been processed.

I just need some suggestion on how can I run the script after I read the text file, the script actually need to be manually copy into the console, I need to make it more automated, this is the point.

Any suggestion for me? Or any idea on it? thanks for your answer.

enter image description here

salemkhoo
  • 325
  • 1
  • 2
  • 11

1 Answers1

2

I assume you have to process only one file at a time.

Can make a timer if need to do it repetitively.

Open text file in a class. In another class have a thread pool executor to do the tasks (if tasks must be done sequentially then do not use a thread pool, instead do it in the method call) a good design would be to have this as a parameter to the main program.

can use ProcessBuilder class to run the process as it sounds external to the JVM See http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ProcessBuilder.html and Executing another application from Java for how to use.

Community
  • 1
  • 1
Sukhdev
  • 36
  • 4