The relevant part of batch spec (JSR 352):
8.9.3 Loop definition
The specification prohibits ‘next’ and ‘to’ attribute values that result in a “loop”. More precisely, this means that no execution element can be transitioned to twice within a single job execution.
This wording is purposely written this way rather than merely saying no execution element can be executed twice within a single job execution. Say “step1” executed to completion during an initial execution which ultimately failed, and upon restart we transitioned past “step1” without executing it since it had already completed, but we subsequently transitioned (back) to “step1”. This may only be a single execution of “step1” during a single job execution, but it still violates the looping prohibition.
The runtime may detect potential loops in an initial validation phase, as described in section 13.1, or may only detect loops once they occur.
So your job flow would violate the batch spec. It may even cause your job to hang and wait forever, if the targeted web service never returns. Other options you can try is to implementing your logic inside one single step, or to avoid polling by registering some notification callback in your application.
Cheng Fang, thank you for your reply.
Hmm, so I will change my project to avoid repeated operations.
Thanks to explain.