Hejk
Hejk

Reputation: 195

Spring batch: conditional execution of steps

I am working on a Spring Batch job which contains several steps (more than 10).

I have a properties file which indicates if one step should be executed or not.

For instance, in my properties file : EXECUTE_STEP1=0 EXECUTE_STEP2=1

indicates that step2 should be executed and step1 should not.

How can I translate this in my Spring Batch configuration? Is it possible?

Thanks for your answers.

Upvotes: 1

Views: 1163

Answers (1)

Hejk
Hejk

Reputation: 195

Here is what I did: - once my properties are set, I put all the step names which has to be executed in a Stack, - I have created a Decider which pops the Stack, and decides which step has to be executed by returning a new FlowExecutionStatus.

Hejk

Upvotes: 0

Related Questions