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

Question

Question

Try-Catch for Find Entry?

asked on January 8, 2018

It doesn't look like it is possible to setup a try-catch for a Find Entry because the Catch branch never runs, even when I selected the error type "Laserfiche.Workflow.Activities.FindEntry.FindEntryException". Is it possible to get this to work?

 

The idea is that the workflow will look for an entry and if it isn't there it will alert the admin, wait 1 day then retry again.

 

0 0

Replies

replied on January 8, 2018

Not finding the entry is not an error, so Try-Catch doesn't have anything to work with. But Find Entry generates an "EntryWasFound" token with true/false values. You can use that in conditions.

0 0
replied on January 8, 2018 Show version history

How about the Search activity? My current setup isn't ideal:

0 0
replied on January 8, 2018

That would work too. Search Repository exposes the results count as a token. You can check if it's 0.

0 0
replied on January 8, 2018

The problem with that setup is that it only retries once, would wrapping it in a repeat work?

0 0
replied on January 9, 2018

So this solution kind of works (note that I set the Repeat to run after because if you set before you will get an error and if you take your Search activity out of Repeat it will never truly retry). My repeat condition is "Token: Search Repository (Result Count) equals 0".

The reason that the solution isn't great is because:

A) if your Search returns a 1 for example, the repeat conditions will still run and delay because I set the conditions to be checked After. 

B) if your search initially returns a 0, it will run once regardless of the findings (see A), then two more times after that and it will finally find it on the 3rd try (all causerie the after).

 

Does anyone have any improvements to make on this setup? I would be so grateful!

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

Sign in to reply to this post.