How should i prevent a file being processed second time in a week

Hi Team,

I have a file with current week date in a folder like CWF03232020 and dispatcher bot applies some formula on this file and completes.

This happens both on Monday and Tuesday. If the bot processed the file on monday, i don’t want the bot to apply formula on that current week file on Tuesday.

I plan to upload the current date in queue along with each transaction data and get the top 1 from the queue to find out if the dispatcher bot uploaded the data for this current week. If so i won’t process the file on tuesday. Can anyone help me to find out this logic from queue?

Thanks,
Ula

@Ula

get the top 1 from the queue

has a lot of space of interpretation

In general you can use with some predefined filterings

So you have a chance to detect ifithe iteme exists or not and in which status. Depending on your ReferenceID handling you may can use this information as well for quick filtering.

Hi @ppr

I am uploading current date to queue along with 2 other data. Now i need to check if the date available in queue(Top 1) is current week. I am using queueitems activity by setting the top 1 property and but don’t know how to get the value of the currentdate uploaded to queue.

using the below code to check if the top 1 queue item date falls under current week… i need to pass the inputDate from the first queue item.

Dim dayOfWeek As Integer
dayOfWeek= CInt(DateTime.Today.DayOfWeek)
Dim startOfWeek As String
startOfWeek = DateTime.Today.AddDays(-1*dayOfWeek).ToString(“MM/dd/yyyy”)
Dim days As Integer = CInt(DateDiff(DateInterval.Day,CDate(startOfWeek),CDate(inputDate)))
If(days>6) Then
output = “Next Week”
Else If(days>=0 And days<7) Then
output = “Current Week”
Else
output = “Previous Week”
End If

Move or rename the folder once the processing is done. This will make sure that same data will not be searched to upload into the Queue again.

Hi @Madhavi
Thank you. Guessed that solution first but client said files must be in the same folder path where they are using it as usual. This is the reason trying to identify the queue date(Top 1) is current week or previous week.

Thanks,
Ula

Then create a daily processing report. You enter all the folders that are been processed on current date in it. Next day you compare the folder names across this report. If doesn’t exists, process it. otherwise, don’t process it.

@Ula
Just lets collect things in detail with minimum space of misinterpretation:

You do add to WorkQueue items with the Add Queue Item activity:

what is set for them on:

  • SpecificContent
  • how is the Reference composed (please name a sample Value)
  • what does mean: along 2 other data

then the Bot is running on monday

Please elaborate on this more in detail: what is done, how the processed transaction item is closed (e.g. using output field …)

Then the Bot is running on Tuesday

Please elaborate:
Case 1: Bot was running on monday
Case 2: Bot was not running on monday

It is better we do have these details and develop a solution that covering all aspects not only adressing a date check