Terminate workflow how to use

I need to use terminate workflow in reframework if any system exception happen in my workflow i need to terminate flow and i need to write excel log file that this is error occurred send mail to report team how could i capture system exception what is different between throw and terminate workflow how can i catch exception

Please check: How to stop execution of the program, but without Exception message? - #9 by Manish_Pandey

If you use REF please stay to the logic. Use “Throw” activity for new BusinessRuleException. Open SetTransactionStatus in Framework and add there what you want to do in this case. Thats the clean way, everything else is a quick and dirty hack.

Hi @airwaveexporter

Please refer this link. Terminate workflow activity

Happy Learning :slightly_smiling_face:

Surround your activities that can throw the error with try-catch, add “Exception” in the catches block as one exception case,
and inside there you can use the Exception variable to extract some info about what exception happened,
stuff like Exception.Message, Exception.Source (check out .Net exception for more) that you can use in your excel log to your file.

Try
your activities that you think will throw the error sometimes
catch
Exception:
log your to excel Exception.Message, Exception.Source, date, process name, whatever you want (append range or whatever way you prefer)
Terminate Workflow with parameter “Exception” so Orchestrator also logs it
end-of-try

something like that

Hey @airwaveexporter
You can get your system exception message by using the below variable
in_systemException.message

So in SET TRANSACTION STATUS you will get the variable, use it as per your requirement

Surround your activity using try catch and handle a system exception in the catch block give a terminate workflow activity.

Regards,