I am creating a workflow to update the metadata in a folder and all of the subfolders. I am trying to make it in such a way that i can run it from the laserfiche client by clicking on the folder and running the workflow from there. Should I use the Search Repository activity to do this or is there a better way?
Question
Question
Replies
If you want to run it from the client, then set it up as a Business Process and set rules regarding who is allowed to run it and what conditions must be met for it to run.
Next, set it up to require a starting entry and when you run it, the selected folder will be the starting entry.
In the workflow, use a Find Entries activity that will grab all the contents of your starting entry (the folder you selected before running the process).
Then, set up a For Each Entry loop to go through all of the results.
Inside the For Each put a Conditional decision
If Entry Type is Document > Update Metadata
If Entry Type is Folder > Invoke Workflow with the "Current Entry" as the Starting Entry and set it to Wait for the task to complete.
What this will do is loop through every item in your starting folder. If you encounter a document it will update the metadata.
However, if it encounters a folder, it will kick off the same process for that folder and wait for it to finish, and so on and on like a recursive loop.
You could use a Search Repository activity, but those have a lot of overhead and it will all run in one gigantic process. The nice thing about the recursive workflow approach is that you get a separate instance for each subfolder so it will run more efficiently.