Spring Batch在步骤之间传递数据

时间:2015-09-14 08:52:53

标签: spring spring-batch

在我的Spring Batch应用程序中,我配置了以下作业流程:

@Bean(name = REPORT_JOB_NAME)
public Job reportJob() {
    //@formatter:off
    return jobBuilderFactory
            .get(REPORT_JOB_NAME)
                .flow(createRequestStep())
                    .on("*").to(retriveDataStep())
                        .on("*").to(notifyAdminStep())
                .end().build();
    //@formatter:on
}

@Bean
public Step createRequestStep() {
    return stepBuilderFactory.get("createRequest").tasklet(new CreateRequestTasklet(reportService)).build();
}

@Bean
public Step retriveDataStep() {
    return stepBuilderFactory.get("retriveData").tasklet(new RetriveDataTasklet()).build();
}

我需要将requestId中创建的createRequestStep值传递给retriveDataStep

如何实施?

0 个答案:

没有答案