2

このユースケースを実装したいのですが、3 つのフローがあり、

<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>

split1 には 4 つのフローがあり、並行して実行する必要があります。step2 と step3 が完了すると、split2 の実行がトリガーされ、split1 で step4 と step5 を待機する必要はありません。

同様に、step4 と step5 が完了すると、step2 と step3 が完了するのを待たずに、split3 の実行をトリガーする必要があります。

また、ステップを追加してフローの下に分割することもできますか。たとえば、上記の分割 3 では、ステップ 9 とステップ 10 を強制的に実行してから、ステップ 11 とステップ 12 を並行して実行します。

このユースケースを構成するにはどうすればよいですか? 分割をネストできますか?

4

1 に答える 1

2

最初に次のようなことを試します。

<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>

ただし、 Spring Batch のバージョンが 2.1.5 以降であることを確認してください。

于 2014-04-08T15:01:13.910 に答える