So I have a Workflow that is routing documents through a review process. What I'd like to do is when the last document within that folder is moved to the next folder, I'd like the empty folder to be deleted. What is the easiest way to do this? I tried setting up a delete entry activity right after the route to folder entry and use the "Entry to Delete" Other "Routing Folder", however, it does not seem to work. Am I missing something here?
Question
Question
Answer
The activities are performed in a top-down order. If Workflow finds a wait condition, it will wait for it to be satisfied first before performing the next activity. So currently, your workflow is waiting for JohnR. Update Instructions and Delete Entry will only be executed after that condition is satisfied.
If you want to delete the empty folder and update instructions before the document is assigned to JohnR, then move the doc to JohnR's folder first, then update the instructions and delete the empty subfolder. Then add a wait condition for the action JohnR needs to do.
Replies
It seems to work for me. To be clear, your Delete Entry activity comes after the one that moves the document out of the folder you're trying to delete.
Yes, but I get a message that "The Folder is Not Empty"...however, there is nothing in the folder. What happens is under the Afyia's Folder, a subfolder gets created based upon a Batch #. When that folder becomes empty, I want it to be deleted...so I think the issue is that the Delete Entry is trying to delete the "Afyia's Folder" and can't because there is an empty subfolder. I don't want it to delete Afyia's Folder, but rather, the Empty Subfolder(s).
From your diagram, the subfolder does not become empty until the WF runs one of the branches in "Routing Decision based upon Afyia's Review" and runs one of the routing activities that moves the document out of Afyia's folder.
So do I need to change the location of my Delete Entry or will it not work in my case? If not, is there another way to accomplish it?
Right, the Delete Entry activity needs to be in a place where the folder could possibly be empty. In its current location, the document will always still be there, so there is no way for the deletion to succeed at that point.
So I spoke to soon...so I'm able to get it to work in 2 of my 3 routing decisions, but when it goes down the "Needs Changes" branch...I can't get my the folder to delete nor can I get the Business Process Instructions to update??
What activity is currently running when you check the instructions?
So I changed my workflow and just made that Routing Decision a Business Process as I have the other 2 Routing Decisions as well, so that I don't have to "Check the Instructions"...but even then, it still doesn't delete...below are the activites running when I get to the point where the document has gone through the Routing Deicsion of "Needs Changes".
The activities are performed in a top-down order. If Workflow finds a wait condition, it will wait for it to be satisfied first before performing the next activity. So currently, your workflow is waiting for JohnR. Update Instructions and Delete Entry will only be executed after that condition is satisfied.
If you want to delete the empty folder and update instructions before the document is assigned to JohnR, then move the doc to JohnR's folder first, then update the instructions and delete the empty subfolder. Then add a wait condition for the action JohnR needs to do.