How to write every 25 transactions files in a folder in RE frame work

How to write each 25 transactions files in a different folders like Batch 1, Batch 2 in RE frame work

Can any body please response

Thanks in advance…

There are different ways to achieve this

Usually what I do is to add the Batch name as a transaction property while adding the records to queue only so that I dont need to keep count of the transaction items

While adding - keep a count on the number of items getting added. Based on your requirement - You can increment the Batch Count

Let me know if this method work for you or not. If yes - I can share more details

Thanks for respond sharaz!!

I am also adding count to the queue, while adding the data into queue.

In my case each transaction will generate a pdf document and that need to store in a share path, while storing the documents I have to store only 25 docs in one folder for suppose if will have 100 records to process each record will generate on document and need to store 100 docs in 4 folders, kindly suggest how to get this

Thanks

@venkatreddy,

How about saving all pdf in one folder while processing and in the end state add logic to move files in the batch of 25 or the desired number of.

This would be more cleaner and maintainable approach.

I will be having this but i am looking for good solution while processing itself will it be possible to store docs by separating the folders by 25 files in each folder

My suggestion was to do following logic

Create an integer variable intLastBatchNumber with value as 1
Create an integer variable intCounter with value as 0

Start Loop for adding records to Queue

While adding records - Include the intLastBatchNumber as well as a property to your transaction item which could be utilized later while processing

intCounter=intCounter+1

If intCounter > 25, If yes - intLastBatchNumber=intLastBatchNumber+1. Also reset the intCounter =0

End Loop

With above logic - You will have batch number for every transaction. Now while processing these transactions - you can use this batch number to identify where to save the file. You can create a folder appending the batch number as well. Example - Batch1, Batch2, Batch3 etc

@venkatreddy,

You can achieve it but it will require multiple changes in your REFramework. Also you will have to add logic to handle multiple scenarios like to skip the failed transactions, maintain file counter etc.

@venkatreddy

as you are adding number or transaction number to queue..add one more thing as well the batch number as 1 ,2,3 etc

and after completion of each transaction check if all the iteems from the required batch are completed or not using the batch number value..if completed create a report of items ., if not ignore and move so that the last transaction will create a report for each respective batch

this way multi bot also would work no need to keep track of exceptions or count and all

for checking use get queue items will new status and with required batch number like 1,2,3 etc..if the count is >0 then more items are there if not no items for that batch

cheers

Thank you for everyone for given suggestions and will try and let you know…