Error while Business Exception or System Exception

Hi Team,

I have some processes going on in Process Xaml, and then according to success or Business Exception or System Exception, i have designed my set Transacaction Xaml according to it.
I have one Status_DT in the Process Xaml as an arguement,which is the status datatable. I want to write it into excel in the set transaction state.
If the Bot is not encoutering an error, it is working absolutely perfect. But in case of Business or Syatem Exception, the value of Status_DT arguement is not fetched from Process Xaml.
How can we solve this issue, please help.

Any help is appreciated.

Thanks.

1 Like

@yash.choursia

you need to pass that argument in the businessexpection catch and system exception catch

or

can you share the way which you have passed ?

cheers

How can i pass that argument in Business exception Catch and System exception catch?
I have just used the argument as out_argument in Process Xaml and using it as in_argument in Set Transaction xaml invoke. I think that way is incorrect.

Hi @yash.choursia ,

Make that status_DT of in type argument in SetTransactionStatus.xaml and pass the status_DT whenever you are invoking this workflow.

For all succes, business and system exception, there is only a workflow (SetTransactionStatus.xaml), this way you will get a warning if you haven’t pass status_DT to your SetTransactionStatus.xaml.

See the image below, in Process Transaction state, you need to pass status_DT in all highlighted section:
image

Fine

to handle the issue of the Status_DT argument not being fetched from Process Xaml when the bot encounters a business or system exception:

Try
  Assign Status_DT = Status_DT_Argument
Catch
  End Catch

Finally
  If TransactionItem.Status = "Success" Then
    WriteToExcel Status_DT
  Else
    If TransactionItem.Status = "BusinessException" Then
      ' Handle business exception
    Else
      If TransactionItem.Status = "SystemException" Then
        ' Handle system exception
      End If
    End If
  End If
End Finally

This pseudocode will first try to assign the value of the Status_DT_Argument to the Status_DT variable. If an exception occurs, the pseudocode will catch the exception and continue executing the workflow.

In the Finally block of the pseudocode, the pseudocode will check the status of the transaction item. If the status of the transaction item is “Success”, then the pseudocode will write the value of the Status_DT variable to Excel. If the status of the transaction item is “BusinessException” or “SystemException”, then the pseudocode will handle the exception.

Change this pseudocode to fit your workflow

Cheers @yash.choursia

I have done exactly the same way, but when my process xaml is having a business or a system exception, the Status_DT value is not getting fetched in process xaml. It is showing as null

@yash.choursia

when an expection occured the value will not be fetched from the process xaml

you need to use assign activity and update the status_DT


t

from where will it take the Status_DT? how will it get assigned? It was in Process Xaml.

Whatever status be it
Capture that in final block and get that asa output argument from process xaml
so that it gets reflected in your main xaml

@yash.choursia

@yash.choursia

for your scenario you need to follow this

basically we use the status_Dt in the end process or finally block of process xaml

see when ever an exception occured inside the process.xaml the argument will not be passed outside

hope this helps

You said to assign the value in Exception catch, but my argument value is in Process Xaml, then i wont be able to use it in Business or System Exception case. Right?

@yash.choursia

yes
or
can you provide what was the value you want to get from the process as outargument
is it as datatable or just updating the status column value in a datatable

cheers

You’d need to create it before the Process.xaml, add it as an In/Out argument to Process.xaml and then it will be passed properly even on exceptions (as DataTables are reference type objects).

it is a datatable, which i want to write in case of a system or business exception.

@yash.choursia

  1. When exception occurs arguments will jot be passed back…
  2. If you are on windows compatibility…then try to create it as a global variable…so that this issue of not being passed when error occurs would not be there
  3. If not on windows then your option is to do the status_dt in the exception blocks and not in the process.xaml if feasible…

Cheers

I have tried creating it as global variable but issue still persists. Point Number 3 of yours is not clear to me. How to do it in exception block and not in Process Xaml, when my entire manipulations of Status_DT is in Process Xaml.

@yash.choursia

when its global variable…there is no passing or arguments needs to be done…can you check that

and for 3rd point if you are doing manipulations in process.xaml only then if you can do them outside then do it in the try catch block in the main.xaml where you invoke the process.xaml

if you need to do the manipulations only in process.xaml then one way would be use a try catch around the actvities inside process.xaml only and then write the data to excel or write the datatable to the exception variables and then re-throw the error

cheers

@yash.choursia

use try catch for the entire xaml inside the process

in catch block assign as mentioned below

the varaible which your are passing is strored in the exception.data(“Datatable”)

use assign activity if you want

datatablevariable=Ctype(exception.data(“Datatable”),Datatable)

hope this helps

The Rethrow is giving this error. Please help. @Shiva_Nikhil

@yash.choursia

Can you please sheo the error from locals panel exception details

Cheers