Frage

I want to implement this use case, I have 3 flows,

<split id="split1" task-executor="taskExecutor">
    <flow>
        <step id="step1" parent="s1" next="step2"/>
        <step id="step2" parent="s2"/>
    </flow>
    <flow>
        <step id="step3" parent="s3"/>
    </flow>
    <flow>
        <step id="step4" parent="s4"/>
    </flow>
    <flow>
        <step id="step5" parent="s5"/>
    </flow>
</split>


<split id="split2" task-executor="taskExecutor">
    <flow>
        <step id="step6" parent="s6"/>
        <step id="step7" parent="s7"/>
    </flow>
    <flow>
        <step id="step8" parent="s8"/>
    </flow>
</split>

<split id="split3" task-executor="taskExecutor">
    <flow>
        <step id="step9" parent="s9"/>
        <step id="step10" parent="s10"/>
        <split id="split3_1" task-executor="taskExecutor">
             <flow>
                 <step id="step11" parent="s11"/>
             </flow>
            <flow>
                  <step id="step12" parent="s12"/>
             </flow>
        </split>
    </flow>
</split>

In split1, there are 4 flows, which should run in parallel. Once step2 and step3 are completed, it should trigger split2 to run and should not wait for step4 and step5 in split1.

Similarly, if step4 and step 5 are completed, it should trigger the executio of split3 without waiting for step2 and step3 to finish.

Also is it possible to add steps and split under flow together e.g. in above split3 I want step9 and step10 to be compulsorily run and then run step11 and step12 in parallel.

How can I configure this use case ? Can splits be nested ?

War es hilfreich?

Lösung

I would first try something like the following:

<split id="split1" task-executor="taskExecutor">
    <flow>
        <split next="split2">
            <flow>
                <step id="step1" parent="s1" next="step2"/>
                <step id="step2" parent="s2"/>
            </flow>
            <flow>
                <step id="step3" parent="s3"/>
            </flow>
        </split>

        <split id="split2" task-executor="taskExecutor">
            <flow>
                <step id="step6" parent="s6"/>
                <step id="step7" parent="s7"/>
            </flow>
            <flow>
                <step id="step8" parent="s8"/>
            </flow>
        </split>
    </flow>

    <flow>
        <split next="split3" task-executor="taskExecutor">
            <flow>
                <step id="step4" parent="s4"/>
            </flow>
            <flow>
                <step id="step5" parent="s5"/>
            </flow>
        </split>

        <split id="split3" task-executor="taskExecutor">
            <flow>
                <step id="step9" parent="s9"/>
                <step id="step10" parent="s10"/>
            </flow>
            <flow>
                <step id="step11" parent="s11"/>
            </flow>
        </split>
    </flow>
</split>

but making sure the Spring Batch version is after 2.1.5.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top