Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to start a job flow definition with a decider #4411

Closed
fmbenhassine opened this issue Jul 4, 2023 Discussed in #4359 · 1 comment
Closed

Add ability to start a job flow definition with a decider #4411

fmbenhassine opened this issue Jul 4, 2023 Discussed in #4359 · 1 comment

Comments

@fmbenhassine
Copy link
Contributor

fmbenhassine commented Jul 4, 2023

Discussed in #4359

Originally posted by acktsap April 12, 2023
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?


References:

@seonWKim
Copy link
Contributor

Hi! @fmbenhassine. I've created a draft PR about this issue. Please feel free to check it anytime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants