Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Wait for file timeout is an "error" with ErrorNumber 0
Topic Summary: a time when an error isn't an error
Created On: 04/22/2014 04:34 PM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 04/22/2014 04:34 PM
User is offline View Users Profile Print this message

Author Icon
JohnScott
Artisan (200-499)

Posts: 231
Joined: 10/27/2010

(No response required unless what I describe here differs from what you folks at N.A. expect.)

Usually when I'm doing error trapping I create a pair of local variables, initialize the one for the error number to 0, then in the step where I want to trap possible errors, I set error actions in the On Error tab to put %AMError.ErrorNumber% into one variable, put %AMError.ErrorDesc% into the other, set the After Error Event to "Continue..", then have my next step test for ErrorNumber = 0 (or <> 0).

I've found that this doesn't work when I want to capture the timeout error from a "Wait for file" action.

I have a task where I want to detect whether another process consumes the file I put there in my workflow. So I set a Wait for file step to watch for the file to disappear. On the Error Causes tab I set it to time out after a certain number of minutes. The Error Causes tab and the help system say that if that timeout expires, the step will have an error (but the problems list doesn't document the error number that would result from a timeout). So I set my usual code to watch for ErrorNumber = 0. When I tested it, I found that a timeout set the ErrorNumber to 0, which my followup logic interpreted as a lack of an error.

I found that I could only detect a timeout by initializing my variable to a negative number, then testing for ErrorNumber < 0 as the sign that the step had completed because the file had really been deleted from the path. (Sample code below.)

I recommend this as a point that could profitably be clarified in the documentation.


 Category Survey
AutoMate BPA Server 8 version: 8.0.1
Windows version: Windows 2003 R2



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 04/23/2014 04:50 PM
User is offline View Users Profile Print this message

Author Icon
Valentineo McGowan
HelpSystems

Posts: 766
Joined: 09/03/2013

Hello John,

Have you not tried simply using the logic to compare the value of the variable against "0" instead?
If %nErrNum% 'is not' 0; then error.
This logic may work if you are receiving an error code that is NOT going to be 0. Which would be most cases.



 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------

Valentineo McGowan | Technical Consultant
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1 213.738.6966 | F: +1.213.738.7665
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 2677 guests browsing this forum, which makes a total of 2677 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog