Reputation: 11435
I have a spring batch job. The first task in the job is to create dummy data. I want to run this job only once, it does not matter how many times the job is run after that or let say be able to configure this task to run only once based on some property value in properties file. How do i achieve this functionality.
In production system, this could be same as creating the folder structures to copy different file types before processing the files.
Upvotes: 1
Views: 3556
Reputation: 5619
Tasklet interface of Spring Batch is what you are looking for. You must implement the execute
method.
public class FolderTasklet implements Tasklet{
public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {
//your copy folder structure logic goes here
}
}
Upvotes: 1