Continue workflow after input error
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm building a workflow that should always continue if the error File used by other process occurs.
Error: Input Data (34): Error opening the file "[location/name]": The process cannot access the file because it is being used by another process. (32)
the file i'm accessing is a log file that if it is being written to (by other proces) the workflow i'm building should continue with default values if the log file is still in use by the other process.
I'm wondering if this is possible.
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Since it's an input file it is not possible for the workflow to proceed without the input data loaded in.
Hope this helps : )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@atcodedog05 yea, that was what i'm afraid of. Thanks for the quick response
Well that means I need to schedule this workflow right after the log workflow.
Seems a great job for the crew runner macro :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Happy to help : ) @MartWClimber
Cheers and have a nice day!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here's a somewhat related post: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Input-Data-resume-on-error/m-p/839100#...
You could determine if the file is locked, then pass either the unlocked file or a default file to a Dynamic Input tool. Attached is a sample workflow.
Here's some code from another language that writes out and runs a Powershell script, to check for a file lock:
"LIST UNFORMATTED" translates to "write to a text file"
com ************************************************************************************
com Determine if file is locked
com ************************************************************************************
LIST UNFORMATTED "try {" APPEND TO "%folder_name%powershell_script.ps1"
LIST UNFORMATTED " [IO.File]::OpenWrite($InputFolderAndFile).Close();" APPEND TO "%folder_name%powershell_script.ps1"
LIST UNFORMATTED " $host.SetShouldExit(100); # file is NOT locked by a process" APPEND TO "%folder_name%powershell_script.ps1"
LIST UNFORMATTED "}catch {" APPEND TO "%folder_name%powershell_script.ps1"
LIST UNFORMATTED " $host.SetShouldExit(101); # file IS locked by a process" APPEND TO "%folder_name%powershell_script.ps1"
LIST UNFORMATTED "};" APPEND TO "%folder_name%powershell_script.ps1"
com ************************************************************************************
com Run the Powershell script and set the output variable
com ************************************************************************************
EXECUTE "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden ""& '%folder_name%powershell_script.ps1'"""
ASSIGN v_Return_Code = RETURN_CODE
Chris
