Error during processing actions

Discuss RoboTask here
John Long
Posts: 25
Joined: Thu Jul 22, 2004 12:23 pm

Error during processing actions

Post by John Long »

I have a task with multiple actions. The first action is to stop a
service, then there are a few actions, then the last action is to
restart the service. If the second action fails then the whole task
will stop and the service never restarts. If the second action fails I
do not want any of the following actions to process with the exception
of the last one. Is there a way to put in an action that says if action
2 fails then start task "X" or skip to the last action? And also how
can I set an action if this action or task fails send an e-mail? Thanks
for any feed back.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Error during processing actions

Post by Oleg »

There is "IsError" macrofunction. It returns a boolean value:   True - if error occured at previous action, False - otherwise. Put "If Then" action (with using IsError function) after action #2. Don't forget to change "If error occured" parameter at advanced options of the task. It must be equal to "Continue execution".
John Long
Posts: 25
Joined: Thu Jul 22, 2004 12:23 pm

Error during processing actions

Post by John Long »

Ok. Here is how I am going to write the task. I will call it task B:
Stop service
Delay 30000 ms
remove nonempty folder "X"
IF Then {IsError}
    Start Service
    Send EMail
    Stop Task B
Else



   Continue

End If
   remove nonempty folder "Y"
   IF Then {IsError}

      Start Service

      Send EMail

      Stop Task B

Else


   Continue
End If

Is this how it should be?

Thanks for the help.


Last edited by John Long on Thu Sep 23, 2004 10:32 am, edited 1 time in total.
John Long
Posts: 25
Joined: Thu Jul 22, 2004 12:23 pm

Error during processing actions

Post by John Long »

It seams that it would be easier if there was error handling
in each actions properties rather that having to create a whole bunch of If
Then statements. Maybe this could be built into future releases???
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Error during processing actions

Post by Oleg »

Is this how it should be?


Not absolutely... See below

Stop service
Delay 30000 ms
remove nonempty folder "X"
IF Then {IsError}
   Start Service
   Send EMail
   Stop Task
Else
   remove nonempty folder "Y"
   IF Then {IsError}
      Start Service
      Send EMail
      Stop Task
   end if
end if

If statement at "If Then" is TRUE then task execute actions between "If Then" and "Else". Otherwise - actions between "Else" and "End if" (when "else" is present, of course)

"Continue" action can be used inside any loops only. Without loop it have no sense.
                                                    
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Error during processing actions

Post by Oleg »

Probably you should do so ?

Stop service
Delay 30000 ms
remove nonempty folder "X"
IF Then {IsError}
   Start Service
   Send EMail
   Stop Task
end if
remove nonempty folder "Y"
IF Then {IsError}
   Start Service
   Send EMail
   Stop Task
end if
John Long
Posts: 25
Joined: Thu Jul 22, 2004 12:23 pm

Error during processing actions

Post by John Long »

If there is no error for the first IF Then {IsError} the task will go
to the action after the first end if. Then I can put more IF Then
{IsError} statment for each action and end if. And I don't have to use
else. That is better. I will try it and let you know how it goes.
John Long
Posts: 25
Joined: Thu Jul 22, 2004 12:23 pm

Error during processing actions

Post by John Long »

Worked Great.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Error during processing actions

Post by Oleg »

I am very glad
John Long
Posts: 25
Joined: Thu Jul 22, 2004 12:23 pm

Error during processing actions

Post by John Long »

Hold the applauds. When I introduce an error the task did
not stop and there was not an email sent. I am not sure why. Any suggestions?
Post Reply