简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM