Java Spring batch如何在循环中运行作业,直到它满足条件?

Java Spring batch如何在循环中运行作业,直到它满足条件?,java,spring,spring-boot,spring-batch,batch-processing,Java,Spring,Spring Boot,Spring Batch,Batch Processing,是,一个作业的控制流可以通过“外部化流定义”定向到另一个作业。您只需在第一个作业中使用While(condition),然后指定到达第二个作业的流 一种方法是简单地将流声明为对其他流的引用: <job id="firstJob" restartable="true" xmlns="http://www.springframework.org/schema/batch"> <step id="FirstStep"> <tasklet&g

是,一个作业的控制流可以通过“外部化流定义”定向到另一个作业。您只需在第一个作业中使用While(condition),然后指定到达第二个作业的流

一种方法是简单地将流声明为对其他流的引用:

<job id="firstJob" restartable="true"
    xmlns="http://www.springframework.org/schema/batch">
    <step id="FirstStep">
        <tasklet>
            <chunk reader="read" writer="write"
                commit-interval="1" />
        </tasklet>
    </step>
</job>



<job id="second_job" restartable="false"
    xmlns="http://www.springframework.org/schema/batch">
    <step id="second_step" ">
        <tasklet>
            <chunk reader="reader_again" writer="writera_gain"
                commit-interval="500" />
        </tasklet>      
</job>

详情

<job id="job">
   <flow id="job1.flow1" parent="flow1" next="step3"/>
   <step id="step3" parent="s3"/>
</job>

<flow id="flow1">
   <step id="step1" parent="s1" next="step2"/>
   <step id="step2" parent="s2"/>
</flow>