Spring batch: 如果没有写入项目则停止批处理作业
Spring batch: Stop the batch job if no items are written
我正在处理 spring 批处理作业。流程如下
第 1 步:(读取、处理、写入 File1)
第 2 步:邮件条目
第 3 步:(读取、处理、写入文件 2)
第 4 步:File2 的邮件条目。
如果没有写任何项目,我想跳过邮寄步骤。
我遇到了像
这样的决策控制
<batch:decision id="decision" decider="com/Decider">
<batch:next on="FAILED" to="step_3"/>
<batch:next on="COMPLETED" to="step_2"/>
</batch:decision>
但是如何获得从上一步到这个决定的写入计数class?
JobExecutionDecider#decide
has a StepExecution
parameter where you can find how many items were written during last step execution (StepExecution#getWriteCount
)
我正在处理 spring 批处理作业。流程如下
第 1 步:(读取、处理、写入 File1)
第 2 步:邮件条目
第 3 步:(读取、处理、写入文件 2)
第 4 步:File2 的邮件条目。
如果没有写任何项目,我想跳过邮寄步骤。
我遇到了像
这样的决策控制<batch:decision id="decision" decider="com/Decider">
<batch:next on="FAILED" to="step_3"/>
<batch:next on="COMPLETED" to="step_2"/>
</batch:decision>
但是如何获得从上一步到这个决定的写入计数class?
JobExecutionDecider#decide
has a StepExecution
parameter where you can find how many items were written during last step execution (StepExecution#getWriteCount
)