0

我正在为 Grails 使用 Spring 批处理插件(spring-batch-1.0.RC2)。到目前为止工作正常,但我想拆分流程来执行……支持吗?这是我要执行的代码......但结果是 Step1、Step2、Step3、Step 4。

beans {
  xmlns batch:"http://www.springframework.org/schema/batch"

  jobLauncher(org.springframework.batch.core.launch.support.SimpleJobLauncher){
     jobRepository = ref("jobRepository")
     taskExecutor = bean(org.springframework.core.task.SimpleAsyncTaskExecutor)
     taskExecutorParallel = bean(org.springframework.core.task.SimpleAsyncTaskExecutor)
  }

  batch.job(id: 'endOfDayJob') {
     batch.step(id: 'logStart', next:'createContext') {
        batch.tasklet(ref: 'printStartMessage')
     }

  batch.step(id: 'createContext', next:'split1') {
    batch.tasklet(ref: 'context')
  }

  batch.split(id: 'split1',taskexecutor:'taskExecutorParallel', next:'logFinish'  ) {
    batch.flow{ 

       batch.step(id:'step1Id', next:'step2Id'){
            batch.tasklet(ref: 'step1')
        }           
        batch.step(id: 'step2Id') {
            batch.tasklet(ref: 'step2')
        }
    }
    batch.flow{
        batch.step(id:'step3Id', next:'step4Id'){
            batch.tasklet(ref: 'step3')
        } 
        batch.step(id: 'step4Id') {
            batch.tasklet(ref: 'step4')
        }
    }
  }

  batch.step(id: 'logFinish') {
    batch.tasklet(ref: 'printEndMessage')
  }
}

谢谢!

4

1 回答 1

0

我明白了......它被支持......我在这行有一个错误:

batch.split(id: 'split1','task-executor':'taskExecutorParallel', next:'logFinish'  ) {
于 2013-08-12T11:45:01.743 回答