UiPath framework - looping in BusinessRuleException


I follow UiPath framework tutorial. I’m getting issue in infinite loop in handing Business Rule Exception in SetTransactionStatus.xaml. I throw business rule as follow in Process.xaml .

Here’s my business rule flow. it increase data table index and set io_RetryNumber as 0. it keeps looking in this flow , rather than going back to SetTransactionStatus main flow and transit back to GetTransactionData to process next datarow.

Appreciate any help.


hello @htay_khaing

Any branch of the SetTransactionStatus workflow, be it Success, Handle Business Rule Exception or Handle System Error, needs to at some point increment the TransactionNumber variable, so that the workflow can continue with…the next transaction. If that doesn’t happen, it keeps trying to process the same transaction and getting Business Rule Exception

The screenshot you attached isn’t of the whole Handle BusinesRuleExc flow, but i suspect you are missing this incrementation step, that should look like this:

So, you assign to io_TransactionNumber = io_TransactionNumber +1

Hope this helps :slight_smile:

Thanks @Serban

I added increasing TransactionNumber in all 3 branches. but i renamed it . would it be the root cause?

hmm, might be, not sure.
If you did this renaming you might want to check your whole workflow for how this variable is imported as argument wherever it’s needed, and if these imports are done ok.

First step i’d try would be to run in debug mode and check the ouptut pane for what happens after the BRE is thrown. That should give you a starting point.

Yes. it’s no issue for success status,it increase the number and transit to next transaction. but only happen in BusinessRuleException. In Debug mode, it loops in increasing transaction number.

yeah, i’m a bit lost here :slight_smile:

Hope i’m not wrong, but from what i can tell from your screenshot, it does appear stuck in a loop inside the Set Transaction Status workflow. Not sure how, i’d have to take a look at the workflow.

Try adding a breakpoint at the throw activity in Process.xaml and then go step by step in debug mode and see the activity where it starts looping.


Did you ever find a solution to this? I’m having the exact same issue. I have not modified the io_TransactionNumber variable.

@Palaniyappan Do you have any ideas why a process would not exit a workflow? I’ve tried deleting the project and local files and reinstalling. The package versions are the same as other successful workflows I’ve completed. There is no logical reason that it keeps looping in the BusinessRuleException.

It’s strange. I deleted Business Exception handling branch in SetTransactionStatus.xaml and re-created it. It solved the issue.

1 Like

Experienced the same continuous loop issue and eventually spotted the culprit.
See the little arrow at the bottom of the flow. Select, delete, and all sorted.
Hope this saves hours in someone’s work day :slight_smile:


Thanks :pray: I wasted 4 hrs debugging the infinite loop issue until I saw your screenshot and solution

Omg…this hideous culprit seems to be the result of messing around with the original template. I found exactly the same but on Handle System Error side lol

It is unfortunately too easy to replicate:
Just grab the small square anchor of a sequence as if you are about to link it to another sequence or action in a flow, but then release it on itself next to the anchor.

I suspect it happens when trying to re-position the sequence quickly, but accidentally grab the anchor instead. Late in the day, you automatically click + drag the mouse again and don’t notice your new little loop arrow friend.
Would be helpful with a warning pop-up:
“You have just created and infinite loop!! Are you sure you want to do that?. Only option is 'No”