BOT Number of Executions before Failure

Dears,

Is it possible to add an activity in the main BOT xaml file to test how many times the BOT can execute before failure, this is to make sure that the BOT is running well prior to loading it to orchestrator? Thx in advance

1 Like

Hi @hsendel
–Well we can check with a simple assign Activity wuth a counter variable of type int32
–Define it with a default valuenof 0
–Increment the value With
counter = counter +1
Or we can check with tye value of Max no.of retries variable as per REFramework

Cheers @hsendel

1 Like

Hi @hsendel

Just to add to what @Palaniyappan mentioned, you also define the number of retries per activity. The max number of retries that @Palaniyappan mentioned is for the transaction basis when using REFramework which is quite useful and very important. Getting one level down is the activity level failure management and retry. This enables us to retry the same activity that failed couple of times to check whether it can get it successful before failing the entire process. This is done through global error handler. You ca find a sample snippet which can be used as plug and play here…

1 Like

Thanks Lahiru for the Great JOB you did.
I have added the following lines in my *.JSON file located in main folder of my project:


But still I get the following error message :

Thanks in Advance

1 Like

Hi @hsendel

You are welcome :slight_smile:

About the error, it’s normal. Here is a brief explanation. So if you check the snippet, it has a defined retry count under its retry variable. So let’s say you have an assign activity which tries to assign some value to a variable. And let’s say it is unable to do the assign for some error or a mismatch in data types. So basically it will try the same assign activity again and again until the maximum retry count is reached. If all those executions fail, it will throw that error and stop the execution. If either of those executions succeed, then you will be fine and it will continue to the next activity. This is also a good option to handle time out issues. Like for example first execution fails due to timeout and next try succeeds kind of stuff.

1 Like

Thanks for Clarifications, Last Questions:

1- Do we need to include this file : GlobalHandlerForExceptions.xaml or only the modification done on .JSON file.

2- How to see how many attempts till job succeeded ?

Thanks in Advance.

1 Like

Yes. You need to have the xaml file in your solution along with the change in project .json file. Change in the project .json file is what enables to execute the global handler when errors are encountered.

Retries through the global handler are recorded under logs. If you are running through Studio, if you check the output panel, you will see all the information on the retry attempts recorded. Once this is hosted I orchestrator, these logs will also be under job execution logs.

1 Like

Thx Lahiru, I will try that and update you :slight_smile:

1 Like

Cool… Glad to here that I could help!! Let me know if you come across any issues regarding this… Would be glad to help anytime :slight_smile:

To make the usage if this activity more clear to me could you please share an example where it’s used in one of the BOTs. Thanks in advance

1 Like