Announcement Announcement Module
Collapse
No announcement yet.
steps dependency limitation? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • steps dependency limitation?

    Hi everyone,

    I'm running into an issue when writing my xml job file. I'm not sure I can quite achieve what I need. I have a case with 5 steps s1 to s5 which could be represented like this:

    Code:
    s1
      \
       s4
      /
    s2
      \
       s5
      /
    s3
    s1, s2 and s3 are independent and can run in parallel. s4 and s5 are independent and can run in parallel, except they both depend on s2 to be done.
    only if i use the '<split>/<flow>/next=""' mechanism, i will have to write it like so (simplified):

    Code:
    split s1/s2/s3 next=s4/s5
      flow s1
      flow s2
      flow s3
    split s4/s5
      flow s4
      flow s5
    and in that case, on top of waiting for s2, i will also have to wait for BOTH s1 and s3 to be done before being able to process s4 or s5. But really I could start say s4 provided that s2 and s1 are done, irrespective of whether s3 is finished or not.

    or is there another way i can specify such a workflow?
    hope that makes sense..!

  • #2
    I found a workaround by basically refering to s2 twice like so:

    Code:
    split s1/s2 next=s4
      flow s1
      flow s2
    split s3/s2 next=s5
      flow s1
      flow s2
    and using a simple trick in s2's tasklet:

    Code:
    	public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {
    		...
    		synchronized (this) {
    			if (this.executed) {
    				// ignore
    			} else {
    				// process
    				this.executed = true;
    			}
    		}
    		...
    this way only one of the references to s2 really does the processing wanted, the other simply waits for the lock to become available again and exit

    However, it makes my job configuration file much bigger (i have a much more complicated workflow in reality) and the following issue prevents me from externalizing as much as i'd like to: http://forum.springsource.org/showth...203#post378203

    again, any help would be greatly appreciated
    Thanks!
    Last edited by anthalamus; Sep 1st, 2011, 04:46 PM. Reason: clarification

    Comment

    Working...
    X