When i throw business rule exception and i want to stop the bot

when i throw business rule exception and i want to stop the bot and send email to business that files are not available

how can do this in try catch kindly let me know

You can put Send Mail at the Catches
image

@T_Y_Raju ,

Use Throw activity to throw Business rule exception in try block.
In catch block add your logic to send email to business.

That’s it.

Sample:

Thanks,
Ashok :slight_smile:

Hi @T_Y_Raju ,

  • Try Block:
    • Inside the Try block:
      • Assign the file path to a variable.
      • Check if the file exists using an If condition.
      • If the file exists, continue with the next steps.
    • Else, if the file doesn’t exist, throw a business exception.
  • Catch Block:
    • If an exception occurs (e.g., file not found), catch it.
    • Inside the Catch block, send an email notification with details about the exception.

Check Below Workflow, hope its helps you

Try block:

Catch Block:
image

Regards,
Vinit Mhatre

Hi @T_Y_Raju

In the Try Block, use File Exists activity and give the file path and store the output in a variable. The output is of DataType System.Boolean say isFileExists. Use an If activity and give the below condition:

If
  isFileExists
Then 
    \\ Do the required process
Else
   Throw -> New BusinessRuleException("Files are not available")
End If

In the Catch Block, use Send Outlook Mail message and give the required details about the exception.


Regards