Process Next Transaction Item In Case Of Business Rule Exception

Hi All,

I want to process the next transaction item in Re-Framework even if there is a business exception. For example in Transaction 3 there is a Business Exception but it should go to next Transaction Item. In my case the bot stops and does not process next transaction. In my current framework I am not using Queue. I am reading the data from Input file

Hi @marina.dutta

Even if you are using the Excel as input file with out taking queues it will move to next row if the business exception throws.
Did you check properly weather the bot is going to business or system exception in process state.

Check once!!

@mkankatala

It Throwing the Business Rule Exception but not going to catch block.

@marina.dutta

Follow these steps:

  1. In “Set Transaction Status” state, you’ll find a if condition like “If Business Exception”.
  2. Remove or modify the branch that handles the Business Exception.
  3. By removing the “Then” part of the If condition. This way, the bot will skip the actions inside this branch and move to the next condition.
  4. You can also add an “Else” part to the if condition. In the “Else” part, you can set the transaction status to “Retry” or “Success” (depending on your use case).
  5. Finally, make sure that the framework goes back to the “Get Transaction Data” state to fetch the next transaction item, even if a Business Exception occurs.

Hope it helps.

@supriya117

Here shall I remove the Business Exception completely ?

@marina.dutta

Can you do a step into activity and check if it is failing anywhere…or exactly where it is failing

Ideally it would continue to next transaction in case of system or business exception as well

Cheers

@marina.dutta

No, In that sequence modify the if condition according to your requirements.

No don’t delete that sequence check the transaction is go through this sequence or not when you are getting business exception in debug mode.

Hope you understand!!

@Anil_G Its going to the next Transaction and failing. The next Transaction File is empty. The bot goes to halt state when the file is empty in next Transaction.

@marina.dutta

Then you have to handle the file exception…what do you mean the file is empty?can you tel more details

You should handle it by checking if you are getting a value or not and exit smoothly in ideal scenario

Cheers

@marina.dutta

First check this

Not string.IsNullOrEmpty(YourTransaction.Tostring)

@Anil_G

The downloaded file has only headers but no data to process.

@marina.dutta

Then first read the data and then check the count if rows dt.Rowcount>0 and only then move aghead else smoothly exit

Cheers

@Anil_G

Do I need to put business rule exception if row count<0 or just exit

@marina.dutta

If when exception the rowcount is zero then dt.Rowcount=0 and then proceed to next

But as per your previous explanation it looks different…you said after business exception next transaction is failing…if the next transaction is failing because of count then check the row count and proceed accordingly…

Cheers

Since the data is empty it might go to end state as transaction item is nothing after the business exception occurs

@Anil_G

For any Business exception the flow is not going to catch block. Its going to Else part and performing the action

@marina.dutta

Can you explain what you are trying to acheive…

So when count is zero does it need to go to business exception? If so then on else part you need to throw busines exception

Apart from that after business exception what is happening is what we need as , you said initially the bot is stopping after business exception…if it is stopping then we have to handle that error what is occuring after business exception

Also did you change the business exception transition to end process? Instead of get transaction data

Cheers

@Anil_G

For two scenarios I should get business exception 1)If there are any Multiple Sales Order Throw Business Exception.

If The CSV file has row =0 business exception. Any business exception occurs , it should end the Transition and go to the next Transition.

In My case, its bypassing the catch block where Exception is caught and does the remaining task.