我正在使用Spring Batch 3.0.3 . 我有一个名为JBABC的工作,它包括3个步骤 . 是否可以,我可以在调用JBABC时运行用户定义的步骤 . 某些角色可能需要从ABC1启动/重新启动作业,而其他一些角色需要从ABC2启动/重启,而其他组可能需要从ABC3启动/重启 . 所以基本上我正在寻找基于自定义/用户定义的步骤参数运行作业 .
<job id="JBABC" xmlns="http://www.springframework.org/schema/batch">
<step id="ABC1" next="ABC2" >
<tasklet ref="abc1Tasklet"></tasklet>
</step>
<step id="ABC2" next ="ABC3">
<tasklet ref="abc2Tasklet"></tasklet>
</step>
<step id="ABC3">
<tasklet ref="abc3Tasklet"></tasklet>
</step>
</job>
1 回答
看看http://docs.spring.io/spring-batch/trunk/reference/html/configureStep.html第5.3.2章 .
您可以实现第一步,它根据参数返回特定状态 . 使用“”-tag,您将能够定义下一步应执行的步骤 .
根据您拥有的选项数量,您还可以定义不同的作业并使用特定的启动器来启动您必须使用的作业 .