Skip to content

[Question] Any way to set decider first? #4350

@acktsap

Description

@acktsap

In xml based job configuration, we can set decider first like this.

<job id="decisionJob1" >
    <decision id="decider1" decider="stepFlowDecider">
        <end on="EXIT" exit-code="COMPLETED"/>
        <next on="*" to="job1Step1" />
    </decision>

    <step id="job1Step1">
        <tasklet ref="createFileTasklet"/>
    </step>
</job>

But when using code based job configuration, no way to start with decider. JobBuilder only provides start methods taking Step, Flow only.

/**
* Create a new job builder that will execute a step or sequence of steps.
* @param step a step to execute
* @return a {@link SimpleJobBuilder}
*/
public SimpleJobBuilder start(Step step) {
return new SimpleJobBuilder(this).start(step);
}
/**
* Create a new job builder that will execute a flow.
* @param flow a flow to execute
* @return a {@link SimpleJobBuilder}
*/
public JobFlowBuilder start(Flow flow) {
return new FlowJobBuilder(this).start(flow);
}
/**
* Create a new job builder that will execute a step or sequence of steps.
* @param step a step to execute
* @return a {@link SimpleJobBuilder}
*/
public JobFlowBuilder flow(Step step) {
return new FlowJobBuilder(this).start(step);
}

It there any way to set decider first on code based job configuration?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions