You are viewing limited content. For full access, please sign in.

Question

Question

Can I have a Workflow depend on the completion of the previous instance before it initiates?

asked on February 26, 2016

I have a workflow that monitors a folder for documents. Upon creation it initiates.

 

However the documents arrive in batches so I will get 3 docs per say at the same time. Each document is an xml to either create or update an existing entry.

Because the files arrive in batch the workflow will kick off 3 times at almost the exact same time. I would like to make a dependency that is does not initiate until the previous instance completes?

0 0

Answer

SELECTED ANSWER
replied on March 3, 2016

Refer to the following Post trying to accomplish via Single Instance Mode.

http://answers.laserfiche.com/questions/93368/Workflow-Single-Instance-Mode-Logic

0 0

Replies

replied on March 1, 2016 Show version history

I could be wrong but I don't believe you can.  The only way you can control another workflow is if you Use the Invoke activity and even then you can only "wait until the other workflow is complete" before moving on with the current.  Is it a problem that the workflow has 3 running instances?  One for each of the documents?

Since the documents arrive at the same time can you change the workflow starting rule to run on a schedule instead of document creation?  If the workflow runs on a schedule it can kick off and the first action in your workflow can be to find the 3 documents (Find Entries or Search Repository activity).  Then do a For Each and do your workflow.  That would keep all 3 documents in the same instance of the workflow instead of separate ones.

If you want each document to run through a separate instance, you could do the same as above but instead of returning all results with your Search or Find you just return one result.  Then you do not need the For Each loop but still do your normal workflow activities.  At the end, use Invoke Workflow and simply Invoke the same workflow that just ran.  This of course assumes that during the workflow, the document is moved out of the starting folder.  So now, the invoked workflow will run again but now there are only 2 documents in the starting folder.  Still have your Search or Find Entries returning one result.  Then the second document will go through.  Finally it will Invoke again and now there is just one remaining document and that will go through.  So basically you are running the same workflow on all three documents one at a time and through its own instance.  Not sure if that made sense, but this would only work on a schedule too. 

However maybe someone knows a better way.

1 0
replied on March 3, 2016

Interesting I had similar thoughts. Problem with the schedule is I can not guarantee, dependent upon the number docs, it will complete prior to the next one starting (unless I use large time delays which are not acceptable).

I used the Invoke Workflow but now running into the below problem.

http://answers.laserfiche.com/questions/57726/Workflow-Error-0700WF10-with-Invoke-Workflow-Activity

Thanks very much for the feedback.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.