What doesn't "Path Exists" have a timeout?


#1

Let’s say I’m downloading a large file from the web, or I triggered some kind of local batch process that churns through a DB and emits an output file. Clearly I don’t know how long it’s going to take to fully arrive on my local disk before I can move along in my workflow.

If I use “Path Exists” right after I begin the download, it will fail. This forces me to either add a fixed “Delay” activity (always a bad idea)… or set up a loop where I retry “Path Exists”. Of course this forces me to also create and increment a counter to limit my retry attempts, etc.

Why doesn’t “Path Exists” simply have a timeout value (essentially a hidden retry under the covers)?

This would be huge.


#2

Did you explore File Change Trigger Activity?


#3

Unless I’m misreading it… that appears to apply to a file that already exists. I can’t hand it a path to a file that doesn’t exist yet.

Actually I see we can pass it a directory too. But which attribute of the directory do I monitor? Size?


#4

I think it will, try specifying NotifyFilters to create.


#5

Interesting.

However… that doesn’t have a timeout either.

How long will it wait before it gives up and allows me to retry if the file is never created?


#6

It actually goes into Monitor Events activity, please check the properties if that activity.


#7

Not documented very well. It’s not intuitive to me how I could retry a download 3X if it didn’t appear within a specific time period, for instance.


#8

Hi @octechnologist,

I am facing the exact same problem. Did you manage to find a solution?


#9

@FlpVsg
Just off the top of my head, you could simply use a Retry Scope with File Exists as the condition activity. You can set the time delay to like 00:00:01 then retry like 60 times for 1minute, and it will exit once the File Exists.


#10

Thanks for the response @ClaytonM.

I pulled off a similar solution, using a count variable inside while and setting condition as “count < 20” meaning I’ll try 20 times to find the file in the directory. However, if it finds the file before it breaks the loop and continue the flow.


#11

@FlpVsg Good idea. =)
Do While loop is something I used a while back but switched to Retry Scope cause I found it easier. Plus, the Retry scope will throw an error like if the file never shows up. In a Do While, you need additional logic so it doesn’t get stuck in an infinite loop and/or throws an error if file never shows up.


#12

Yeah I’m digging this Retry Scope approach. Thanks for that.


#13

Maybe I’ll try “retry scope” then to make the code a bit clearer.
Thnks!


#14

If i want to check path exists of one file that’s located on shared server,
because network speed’s slow, it will take time to access to the shared server
-> will timeout be reached in this case?


#15

That depends on the value you specify for the timeout of the chosen activity you use. You are free to make a timeout as long or short as your requirements dictate.