AnsweredAssumed Answered

Sync objects and restarts

Question asked by daryl.brown_ACI on Oct 28, 2014
Latest reply on Oct 30, 2014 by Pete Wirfs
Background info: 
I'm working on a workflow that involves downloading two distinct files from a vendor, importing them in a particular order, and then running an extract once both files have been loaded.

In the interest of being able to restart the process to download-and-import each file, I've buried each process in its own subworkflow.  These two subworkflows will run in parallel when the overall workflow kicks off -- this way I can download the two files simultaneously -- but I use an sync object on the import jobs in each subworkflow to ensure the file from subworkflow #1 loads before the file from subworkflow #2.  

I've set up the sync object with the following states:
READY -- ready to start importing
LOCKED_IMP1 -- locked; importing file #1
DONE_IMP1 -- finished importing file #1; awaiting import of file #2
LOCKED_IMP2 -- locked; importing file #2

The import job for the first file will move the sync state from READY -> LOCKED_IMP1 -> DONE_IMP1.  The sync object will remain in LOCKED_IMP1 in the case of failure, as we don't want the second file to start importing until the first one has successfully completed.
The import job for the second file will move the sync state from DONE_IMP1 -> LOCKED_IMP2 -> READY.

Now this design works pretty well....but it gets a little messy whenever I run into a problem with the first import.  Since that first failed run has set the sync object to LOCKED_IMP1, when I go to restart the job, it sits in 'Waiting for SYNC' until I manually update the sync object back to 'READY'.

So I'm seeing a few different ways I could tackle this, but wanted to get the community's opinion on the best approach:
1)  Update the import job to set the status back to READY on abend?
2)  Update the import job to ERR_IMP1 on abend, and create a new action to (re)start that job from that starting state?
3)  redesign the workflow entirely so that it doesn't rely on sync objects?

Any other ideas?  Thoughts?
How elaborate are other folks' Sync objects' states and actions?