Strange behaviour of uipath workflow

Hi All ,
its really strange , i am using RE frame work ,
my coding style
when ever an exception happens in side my states init & process , i will set the necessary parameters to send email in case of exception but mailing code Will be in finally block .
now , the problem is when ever an exception occurs at the every begging in the try block of process transition state , it immediately calls the email code in the finally block of init state !!!
but once it comes to process transition , it is suppose to be in this state only until it fnishes this state !! why it is going to the code part of init state ???

now , more surprising thing is , it is calling the “finally” part of the process transition after it calls the finally part of “init” state !!!
how could these things happen??? @loginerror @Silviu any idea ?

Hi @Seetharaman_K

I don’t think I got the full picture quite clearly, but one thing to mention would be that the Finality state executes all the time, with and without the exception.

1 Like

May I know how this is made

That sounds very strange. I’ve tried it myself and it seems to work accordingly.

Are you able to create a new ReFramework project and reproduce this strange behaviour? If so, could you attach it here so we can examine it together.

Hello @Seetharaman_K

I actually tested this last night in my version as well… I’m not sure what is going wrong in yours… it worked fine in my one…

Would you be able to share your solution so that we can run it and see whether it happens in our version as well? It is very strange… :thinking:

All ,
first of all big thanks that all of you replied , to some extent @loginerror observation actually helps. i actually took the email code from finally of init and put in appropriate exception block. the email afterwards did not work . but still the question remains same , please refer the below diagram , itried to explain the bhaviour. first comes mail init then mail process transaction . and if you still need code , please give me couple of days , i will send.

It is still not just quite clear, but having read this:

It kind of hints at the ReFramework built in retry routine.

If you have set retry >0 in the Config.xlsx file, then an exception in Processing stage will restart the ReFramework and run through the Init routine again. This in turn will execute the Finally of the Init.

well , you have the logic. but what is the retry actually ? when this number is significant ? when ever there is an exception in process state it is suppose to be inside process state only untill it finish the complete squence which includes the try catch and finally of process state. in between if the program goes to init state that how could this number explains that ?

Are you able to provide us a recording of UiPath Studio Slow Stepped so we can see what is going on. Indicate the timeline(s) as to where it behaves strangely.

Guys ,
thank you for showing interest in this post. as @loginerror said i removed the code from finally of init. infact having a mail code at init finally also makes not much sense. but still i want you all to show really exactly what had happened. but i was for some reason (as always i feel) felt its hard to reproduce the error in new project. created a blank frame work with less confidence but here it is !! this attached code file will show u that. (495.8 KB)
below are the points which am still surprised about some of you can explain me :

  1. why control is going to init finally with out execute process finally ?
    2.Why the two message boxes , in the transition state (from process -> init ) is not executing ?
    one message box is in the trigger section
    one message box is in action section
    otherwise , this is a brand new RE framework template project , i haven’t changed any values in the config file
1 Like

Running your project without setting an Orchestrator queue will result in the project triggering only “Init Finally”. If the queue is empty the same will happen. This will end the robot taking the following path:

That is why neither your Process Finally nor the two boxes in the Transitions back to Init are triggered.

Having run the application using my own queue in Orchestrator with QueueItems available to be processed. The robot takes the following path:

When it does, all message boxes appear and trigger as expected.

  1. Init Finally
  2. Process Finally
  3. Process -> Init Trigger
  4. Process -> Init Error

and repeat per Transaction.

Why but ? all the state transition conditions in my case is the data table i deal with (eg : condition for process T to end T is if row_count is equal to the row_number -1 ).
Now , this RE frame work i uploaded is , a template created from uipath RE framework and immediately i added the codes which are necessary to replicate the error. here the transition conditiosn may refer the queue .
though i also imported the same template for my proj , i chagned all my state transition conditions w.r.t the data table.

its not mandatory that RE frame work should use queues right ?

@OpalSnow did u see my question , can u clarify my doubt please

It is not mandatory that the ReFramework uses queues. That is correct. You could - like you most likely already have in your project - change the TransactionItem variable to any type you’d like. The most common ones are QueueItem (Orchestrator queue item) and DataRow (Excel, SQL, etc).

As for your transitions, if you could provide a sample excel file with your transitions that would allow me to look into it. I for one do not see any scenario where your issue could happen - logically. Perhaps if you could add your transitions to the example project we could get to the bottom of this.

you mean the actual input file ?

Any test input file is fine. The input will not make a difference as long as we’re not manipulating data in any way.

SampleInputFile.xlsx (31.9 KB)

Attached is the sample input. it has 4 sheets. (naturally my input data is arraylist of datatable)
in this input file it as 2 records to process
how i am saying this ? : refer the first sheet it has two records . rest sheets has records pertaining to one particular column in the first sheet ie “taxpayer id”. sourcing rule sheet has records based on “customer name” column in first sheet.

first sheet is the base , the transitional conditions are based on the count of the first sheet.

eg : transition from process to get transaction is
if row number is less than (number of rows in the first sheet -1)
**transition from process T to end State **
row number is equal to (number of rows in the first sheet -1)

so the problem came , while there is any exception in the process transition state while processing any of the records.

Not (TransactionNumber.Equals(TransactionData.ElementAt(0).Rows.Count)) – this is the condition from get transaction data to process transaction

transaction data is the array list (having 4 data tables)
transaction number is the row number --> this will get set/increased in our set transaction status as we all know .

condition from process to get transaction data is “SystemError Is Nothing And BusinessRuleException is Nothing” — this is same i did not change this…