How to stop/BE transaction based on current date and criteria

Hi
I have a RPA process which has 2 transactions .I want to run 1st transaction on all days .
and 2nd transaction only on date 1,2,3,4,5.
how to add condition in beginning in process state of re framework that , todays date is 25 and if transaction number is 1 then run and not run 2nd transaction .and if today is 1 to 5 then run 1 and 2nd too.

All other transaction item are same except , TraNum

we could locate this customization e.g. in the GetTransaction.xaml

Datecheck along with ProcessingNumber can trigger if QueueItem should be requested or not

Hi @8b6861dc5e0c9f7008548ca66

You can try the below condition in the Get Transaction State:

If
  DateTime.Now.Day >= 1 AndAlso DateTime.Now.Day <= 5
Then
    \\ process both transactions
Else
  \\ process first transaction
End If

Regards

1 Like

Hi @8b6861dc5e0c9f7008548ca66 ,

To add the conditions in the beginning of the process state in UiPath’s RE Framework, you can use an “If” activity with a combination of conditions. Firstly, check if today’s date is between 1 and 5, and if the transaction number is 1. If this condition is true, execute the 1st transaction. Secondly, check if today’s date is between 1 and 5. If this condition is true, execute the 2nd transaction. If both conditions are false, do not execute the 2nd transaction.

Thanks,

Thanks for ur reply @ppr , I need to add this in process state at the start , I am stuck in writing the condition in if statement

if- in_transactionItem.SpecificContent(“TraNum”).Equals("2)
then
check the current date if it falls between 1 to 5 and then only run or Business exception

maybe you can tell more about the details. is REF used, your high-level structure

When Ref is used, we would try to be as close as possible to the concept of REF

ok I got it , I can also add if before get transaction item.But how
I want to get transaction 1 on all days of the month
and get 2nd tra only if date is between 1 to 5
help me with condition to write and what changes to add in else and then block of if

Hi @8b6861dc5e0c9f7008548ca66

DateTime.Now.Day >= 1 AndAlso DateTime.Now.Day <= 5

please check the below flow:

Regards

1 Like

Thanks @vrdabberu , its working ,

Next doubt is , here if system exception in 1st or 2nd transaction then their transaction num will change then how it will work ?

@ppr see this is working , this is what was my doubt. But next concern is here if system exception in 1st or 2nd transaction then their transaction num will change then how it will work ?
image

so it will not open the QueueItem (Status new-> inProgress) for items which should not be processed

unfortunately unanswered so far

Maybe this series will give you some starter help

if(ProcessingNumber = 1, True, Now.Day < 6)

Just crosscheck it carefully as it took some iterations and still can have a risk of bug

Hi @8b6861dc5e0c9f7008548ca66

->If the dates are between 1-5 then whatever the transaction number might be it will run because in your condition all the transaction numbers should be executed between 1-5 dates.

->If the date is beyond 5 then only the transaction number 1 will be executed and the transaction number 2 will not be executed so there will be no chance for system exception for transaction number 2.

Regards

@vrdabberu True but while running that transaction , if any selector fails then as per the framework bot will kill everything and will add it for retry , in this case when we will get this retry transaction as a 3rd transaction right? what will be it’s transaction number and in that case how the condition will exdcute.

Thanks for your time , pls help further

this is a valid point, but increases a more the constraints

But we keep in mind (Cloud, Automation Suite)

  • get Transaction Data did not retried immediately the same item (Behaviour from the past)
  • But in newer Versions we had seen a behaviour of getting faster the same item / directly again

So just correcting the transaction number to an own counter can also fail.

Tracking the QueueItem reference may be used for a forced Get transaction Date (with Reference Filter)

Edited: Removed a possible incorrect statement
Added:
We would recommend to let us know exact versions and used REF Template Generation, then we can better cross-check the details

Hi @8b6861dc5e0c9f7008548ca66

Yes the transaction number will be 3 but when the dates are between 1-5 then you need to execute all the transactions right so the 3rd transaction also will be executed. But when the date is beyond then the transaction number 2 will not be executed so whatever the retries transactions have been created all those will be of transaction 1 only so they will be re-executed.

Regards

@vrdabberu thanks ,
image
this file row 1 is transaction 1 and row 2 is transaction 2

Can I add the condition like

In_tansactionItem.SpecificContent(“Data”).equals(“1”) then check date and then invoke xamls
and so on

this way no matter what the transaction num is I am always checking for Data 1 or 2 , and then checking dates

but I have to add in process within process xaml not before invoking process.
Can u help me to write condition by taking In_tansactionItem.SpecificContent(“Data”)??

image

Hi @8b6861dc5e0c9f7008548ca66

Yes you can do the same. By doing in this manner then its not necessary to consider the transaction number.

in_TransactionItem.SpecificContent("Data").Equals("1")

Place the process within that.

Regards

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.