If bot crashes it should run from the activity where it failed

excel
uiautomation
orchestrator
activities
studio

#1

Hi,

Please share your ideas


#2

hi @tgopalas

while running from Orchestrator or Front Office

@Orchestrator:you can identify the bot exception in logs
@FrontOffice->You can identify where it got stopped

Thanks
Ashwin S


#3

Ideally, you want to clear the environment that caused the crash and then continue at a “section” of your process, not necessarily the activity that failed.

I think best way to continue where it left off at is keep a detailed spreadsheet of your process items that stores its status state during the process. Then, you can filter the items for each section of the process.

For a situational example,
if you had 10 items, and you needed to A) Download 1 document, B) Download 2nd document, C) Merge documents. Then, let’s say after 5 items in part A it fails, but you already downloaded 5 documents. The next time it runs (or retries if you have programmed that in), it filters your line items to the rows that have not been downloaded and starts from there.

As a result, it ends up skipping each item that has been completed already per part of the process.

Additionally, during the process, you can store each section or part of the process to a string or integer before the part is Invoked or entered to represent the state or current position in the process. By doing this, you can enter a Switch activity and jump to that part when an error had occurred (when performing a retry attempt)

An example of a stable design would look something like this:

— Initialize variables
— Clear Environment/Apps

Use Try/Catch around Process Flowchart/Sequence
— Enter Switch using string or integer that represents the process state/position
— Invoke or enter sequence for the desired process section
— Store “Next” process part to a string or integer to be used in the Switch
— Loop around to enter Switch and begin next process part
Catch
— store and/or log exception message using process state, Source, and Message

— Increment retry counter, Clear Environment/Apps, and loop back to Process until maxretries is met

— Closing Sequence

If it fails in Orchestrator where you need to run it again, then that’s where having the status of each line item stored in a file, so it can use that file to determine if a section has already been complete for that line. You can also use File.Exists() to identify if something has been downloaded already if desired.

I hope these ideas are helpful.

Regards.