Results 1 to 3 of 3

Thread: Determine next step by code

  1. #1
    Join Date
    Nov 2010
    Posts
    2

    Default Determine next step by code

    Hi,
    Is there a way to determine next step by code ?

    Decision is not good to me, I want to take the name of the next step inside a configuration file depending some business logic.

    Any way to do this ? It's seams not possible to modify the next value of a step definition

    Regards,

  2. #2

    Default

    Try using Spring EL (SpEL) expression language to manipulate an object graph at runtime. Assuming your running a newer version of the Spring framework. 3.0.5?

    <batch:job id="Job1">
    <batch:step id="#{ myBean.nextStep }" />
    <batch:step id="#{ myBean.nextStep }" />
    <batch:step id="#{ myBean.nextStep }" />
    </batch:job>

    Where myBean.nextStep queries the job for the next step and based on its current state the next step could change.

    I've yet to try it but I think its worth a shot.

    Jeff

  3. #3
    Join Date
    Nov 2010
    Posts
    2

    Default

    Hi,
    Thanks for the answer but I already tried this. SpEL is not allowed on the next parameter of a step.
    I look at the code of Spring batch and it seems impossible to change this dynamically.
    Seems that Spring Batch need to be able to know the whole job sequence at initialization

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •