2

I'm using batch jobs in wildfly 8.1 and I want to start by executing a batchlet and then make a decision and if the result is accepted I would like to run a number of steps in parallel. I'm just unsure how to accomplish this in my myJob.xml file

    <step id="availableRecords" next="anyRecordsAvailableDecider">
        <batchlet ref="availableRecords"/>
    </step>

    <decision id="anyRecordsAvailableDecider" ref="recordsAvailableDecider">
        <next on="recordesAvailable" to="getAvailableRecordsDetails"/>
        <stop on="noCardsAvailable"/>
    </decision>

<flow id="getAvailableRecordsDetails">
    <step id="getRecordTypeA">
        <batchlet ref="RecordTypeA"/>
    </step>
    <step id="getRecordTypeB">
        <batchlet ref="RecordTypeB"/>
    </step>
    <step id="getRecordTypeC">
        <batchlet ref="RecordTypeC"/>
    </step>
    <step id="getRecordTypeD">
        <batchlet ref="RecordTypeD"/>
    </step>
</flow>

So is it possible to put a split around the getAvailableRecordsDetails flow or should i somehow use Partition ?? Using Partition would be nice since i could then use the PartitionMapper to get some properties into these steps.

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
jka_dk
  • 421
  • 1
  • 4
  • 17

1 Answers1

2

I found the answer :

    <step id="availableRecords" next="anyRecordsAvailableDecider">
        <batchlet ref="availableRecords"/>
    </step>

    <decision id="anyRecordsAvailableDecider" ref="recordsAvailableDecider">
        <next on="recordesAvailable" to="split1"/>
        <stop on="noCardsAvailable"/>
    </decision>

    <split id="split1">
        <flow id="getAvailableRecordsDetails">
            <step id="getRecordTypeA">
                <batchlet ref="RecordTypeA"/>
            </step>
        </flow>
        <flow>
            <step id="getRecordTypeB">
                <batchlet ref="RecordTypeB"/>
            </step>
        </flow>
        <flow>
            <step id="getRecordTypeC">
                <batchlet ref="RecordTypeC"/>
            </step>
        </flow>
        <flow>
            <step id="getRecordTypeD">
                <batchlet ref="RecordTypeD"/>
            </step>
        </flow>
    </split>
jka_dk
  • 421
  • 1
  • 4
  • 17