void processBatchWaitTasks ( ) { Channel channel = context . registry . getChannelOrSystem ( Model . CHANNEL_BATCH ) ; // channel TedBW or TedSS int maxTask = context . taskManager . calcChannelBufferFree ( channel ) ; Map < String , Integer > channelSizes = new HashMap < String , Integer > ( ) ; channelSizes . put ( Model . CHANNEL_BATCH , maxTask ) ; List < TaskRec > batches = context . tedDao . reserveTaskPortion ( channelSizes ) ; if ( batches . isEmpty ( ) ) return ; for ( final TaskRec batchTask : batches ) { channel . workers . execute ( new TedRunnable ( batchTask ) { @ Override public void run ( ) { processBatchWaitTask ( batchTask ) ; } } ) ; } }
if finished then move this batchTask to his channel and then will be processed as regular task