Should the order of 'on conditions in a Decider affect the outcome of a Job? #4686
-
| 
         I have a decider that checks for the presence of a file. It has two possible outcomes defined as constants: 
 The outcome of the Job when the file is present unexpectedly depends on the order in which I specify the .on conditions in this Flow: I originally wrote the check with the NO_FILE check last:                .next(fileExistsDecider)
                .on(FILE_EXISTS).to(continueFlow)
                .on(NO_FILE).fail()
                .build();When this is executed with no file (result NO_FILE), it behaves as expected and the job fails. Reversing the order of these .on conditions, changes the behaviour of the Job. Option 2. 'success condition checked last':                .next(fileExistsDecider)
                .on(NO_FILE).fail()
                .on(FILE_EXISTS).to(continueFlow)
                .build();Now we have the fail condition checked first, and the success condition last. I would expect the order of these checks not to impact the final result of the job. Is this a bug, or am I missing something?  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
        
 No, the order should not matter. This is a bug in Spring Batch, I added a comment on #4478: #4478 (comment)  | 
  
Beta Was this translation helpful? Give feedback.
No, the order should not matter. This is a bug in Spring Batch, I added a comment on #4478: #4478 (comment)