The Process keeps on Running , doesnot throw exception - Retry Scope activivty

Hi

I have a process to Login into a carrier site using MFA login.

I have 3 sequences
1.) Main
2.)Two factor authenticaton
3.)get OTp code

Whenever the bot is not picking up the email in first attempt -

Howeover in my Two factor authentication sequence , I have a Pick branch activity

one branch : with check app state activivty-> it checks whether my screen appeared ? if appeared it will simply print a log message and process closes

another pick branch branch-> has a check app state for the condition when a wrong verification code is entered by the bot → then it goes to run the action part of the pick branch

action part has the retry scope → retry scope should be done two times or unless my condition of counter retryCounter>=2 is met , but it still keeps on running. , and doesnot throw a exception

my pick branch activites are as foolows

the gcounter gets icremented when invoke twofactor xaml

can someone suggest me , how can throw a exception after retried for two times ?? or what am i doing wrong here ? to stop the bot ?

@ashokkarale i have tried removing the check app state target appears and targe didnt appeared, but since my retry scope is here , it keeps on trying

The incrementation of in_retrycounter seems a bit odd. If you increment it inside Twofactor.xaml, the direction should be “in/out”, as you are changing the value. Otherwise you should first increment it in an assign, before passing value to the other workflow.

actually the workflow i am using is the same workflow i am again calling at the bottom

i incremented the counter on the top and then passed the value , but then also pick branch activivty runs the retry scope

the bot is not stopping

i have a condition to stop for the retry bot check false when counter>=3 it still keeps on running despite exceptions are thrown

When an exception is thrown from inside Retry scope, a retry is triggered until the maximum amount of retries is reached. It seems are using a recursive pattern, which generally is not that advisable with workflows.

I suggest to move away from recursion. Don’t invoke the same workflow inside the Retry scope. Not sure of your requirements, but maybe you want to have the Retry on the level of the workflow which invokes your “Twofactor.xaml”. Or as the topmost scope inside it.

Also not sure if you noticed, but Retry scope has the amount of retries in the properties section. You could place 2 there instead of checking the retrycounter in the Condition (do you always need the 2 retries or are you ok if the action is done successfully on the first try?).

yes thanks for the clarification

i actually want the retry scope to run two times only , as per the portal conditions
but still it keeps on running so i had to put that condition

if i remove the condition will the retry stop after 2 times ?

because the retry is inside a check app state , so the state will be same but i want the condition to stop

@samantha_shah

Just configure the maxretry in the retry scope and remove the condition…

As per your condition even if it is successful it would retry as the condition is not met…you can leave the condition empty…that should not be a problem

Cheers

1 Like

@samantha_shah,

As many experts already discussed on this, no need to complicate the logic here!

No need of If condition as Retry scope already have MaxRetry property use that.
No need of Try Catch as every exception will trigger a new try if MaxRetry doesn’t exhausted.

Thanks,
Ashok :slight_smile:

1 Like

Thankyou so much @ashokkarale for sure !!

1 Like

@Anil_G Thanks for the answer

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.