Example usage for org.springframework.batch.core.job.builder FlowBuilder FlowBuilder

List of usage examples for org.springframework.batch.core.job.builder FlowBuilder FlowBuilder

Introduction

In this page you can find the example usage for org.springframework.batch.core.job.builder FlowBuilder FlowBuilder.

Prototype

public FlowBuilder(String name) 

Source Link

Usage

From source file:uk.ac.ebi.eva.pipeline.jobs.PopulationStatisticsJob.java

@Bean
public Flow optionalStatisticsFlow() {
    SkipStepDecider statisticsSkipStepDecider = new SkipStepDecider(getPipelineOptions(), SKIP_STATS);

    return new FlowBuilder<Flow>(STATS_FLOW).start(statisticsSkipStepDecider).on(SkipStepDecider.DO_STEP)
            .to(statsCreate()).next(statsLoad()).from(statisticsSkipStepDecider).on(SkipStepDecider.SKIP_STEP)
            .end(BatchStatus.COMPLETED.toString()).build();
}

From source file:uk.ac.ebi.eva.pipeline.jobs.GenotypedVcfJob.java

@Bean
@Qualifier("genotypedJob")
public Job genotypedJob() {
    logger.debug("Building variant genotyped job");

    JobBuilder jobBuilder = jobBuilderFactory.get(jobName).incrementer(new RunIdIncrementer());

    Flow parallelStatisticsAndAnnotation = new FlowBuilder<Flow>(PARALLEL_STATISTICS_AND_ANNOTATION)
            .split(new SimpleAsyncTaskExecutor()).add(optionalStatisticsFlow, optionalAnnotationFlow).build();

    FlowJobBuilder builder = jobBuilder.flow(normalize()).next(load(variantLoaderStep))
            .next(parallelStatisticsAndAnnotation).end();

    return builder.build();
}

From source file:uk.ac.ebi.eva.pipeline.jobs.AnnotationJob.java

@Bean
public Flow annotationFlow() {
    EmptyFileDecider emptyFileDecider = new EmptyFileDecider(getPipelineOptions().getString("vep.input"));

    return new FlowBuilder<Flow>(VARIANT_VEP_ANNOTATION_FLOW).start(variantsAnnotGenerateInputBatchStep)
            .next(emptyFileDecider).on(EmptyFileDecider.CONTINUE_FLOW).to(annotationCreate())
            .next(annotationLoadBatchStep).from(emptyFileDecider).on(EmptyFileDecider.STOP_FLOW)
            .end(BatchStatus.COMPLETED.toString()).build();
}

From source file:uk.ac.ebi.eva.pipeline.jobs.AnnotationJob.java

@Bean
public Flow optionalAnnotationFlow() {
    SkipStepDecider annotationSkipStepDecider = new SkipStepDecider(getPipelineOptions(), SKIP_ANNOT);

    return new FlowBuilder<Flow>(OPTIONAL_VARIANT_VEP_ANNOTATION_FLOW).start(annotationSkipStepDecider)
            .on(SkipStepDecider.DO_STEP).to(annotationFlow()).from(annotationSkipStepDecider)
            .on(SkipStepDecider.SKIP_STEP).end(BatchStatus.COMPLETED.toString()).build();
}

From source file:com.github.jrrdev.mantisbtsync.core.jobs.JobProjectsConfiguration.java

/**
 * Build the syncProjectsJob job. This job will retrieve all informations
 * for the given project and its subprojects.
 *
 *
 * Parameters for this job are ://from  www.  j a va2  s  .c  o m
 *    - mantis.username
 *       MantisBT username. If anonymous access is used, should be an empty string.
 *  - mantis.password
 *     MantisBT password. If anonymous access is used, should be an empty string.
 *  - mantis.project_id
 *     The id of the project
 *
 * @param jobs
 *          Job build factory
 * @param mantisProjectsListStep
 *          Step retrieving all subprojects
 * @param projectInitFlow
 *          Flow for project syncing
 * @param jobProjectInitFlowDecider
 *          Decider which decides if the flow must be repeated (if a subproject
 *          is still not synced)
 * @param authProjectsStep
 *          Step for portal authentication at the begining of the job
 * @param closeProjectsListener
 *          Listener for closing the portal authentication connection at the end of the job
 * @return the job
 */
@Bean
public Job syncProjectsJob(final JobBuilderFactory jobs, final Step mantisProjectsListStep,
        final Flow projectInitFlow, final JobExecutionDecider jobProjectInitFlowDecider,
        final Step authProjectsStep, final CloseAuthManagerListener closeProjectsListener) {

    final FlowBuilder<Flow> loopBuilder = new FlowBuilder<Flow>("projectInitLoop");
    final Flow loop = loopBuilder.start(projectInitFlow).next(jobProjectInitFlowDecider).on("LOOP")
            .to(projectInitFlow).from(jobProjectInitFlowDecider).on("END_LOOP").end().build();

    return jobs.get("syncProjectsJob").incrementer(new RunIdIncrementer()).listener(closeProjectsListener)
            .flow(authProjectsStep).next(mantisProjectsListStep).next(loop).end().build();
}

From source file:com.github.jrrdev.mantisbtsync.core.jobs.JobProjectsConfiguration.java

/**
 * Build the main flow to sync a project.
 *
 * @param mantisProjectExtractorStep/*  www. j a v a  2  s .co  m*/
 *          Step poping the id of the project from the list stored in the execution context
 * @param projectCategoriesStep
 *          Step syncing the categories related to the project
 * @param projectCustomFieldsStep
 *          Step syncing the custom fields related to the project
 * @param mantisLoginStep
 *          Step retrieving the access_level
 * @param projectUsersStep
 *          Step syncing users related to this project
 * @param projectVersionsStep
 *          Step syncing the versions related to this project
 * @return the flow
 */
@Bean
public Flow projectInitFlow(final Step mantisProjectExtractorStep, final Step projectCategoriesStep,
        final Step projectCustomFieldsStep, final Step mantisLoginStep, final Step projectUsersStep,
        final Step projectVersionsStep) {

    final FlowBuilder<Flow> builder = new FlowBuilder<Flow>("projectInitFlow");
    builder.start(mantisProjectExtractorStep).next(projectCategoriesStep).next(projectCustomFieldsStep)
            .next(mantisLoginStep).next(projectUsersStep).next(projectVersionsStep);

    return builder.build();
}