admin管理员组文章数量:1122846
Context
I use Spring Batch and I use a JobExecutionDecider which can return two values "FAILED" or "COMPLETED" according to the writeCount value of the preceding step. Depending on the returned value of the decider, I execute then one step or another.
The Problem
But after I want to always execute a final step, whatever the decider choice. But I see that this final step is not executed when my decider chose one of the two steps.
- How can I make two branches of my flow merge again and execute a common step ?
Below is a sample code. The step stepMergeWithUserValidateStatus is the one I want to always execute before the end. Should I duplicate the call to this step ?
@Bean
public Job job(JobRepository jobRepository, MyDecider decider,
Step stepTruncateTable,
Step stepReadProcessWrite,
MyDecider receptionSucessDecider,
Step stepRestoreFromBackup,
Step stepBackupInsertedData,
Step stepMergeWithUserValidateStatus) {
return new JobBuilder("job", jobRepository)
.start(stepTruncateTable)
.start(stepReadProcessWrite)
.next(receptionSucessDecider).on("FAILED").to(stepRestoreFromBackup)
.from(receptionSucessDecider).on("COMPLETED").to(stepBackupInsertedData)
.next(stepMergeWithUserValidateStatus) // Not called after execution of stepRestoreFromBackup
.end()
.build();
}
Thanks in advance for your help !
本文标签: jobexecutiondeciderSpring Batch Next JOIN Step AFTER deciderStack Overflow
版权声明:本文标题:jobexecutiondecider - Spring Batch: Next JOIN Step AFTER decider - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736311602a1934798.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论