Hi there,
I am using Reframework. I have a workflow where i unzip a file in a desired folder. Files can be more than so i m using for each file in folder. How to increment it for each file on folder, as it does not and goes to next transaction.
Hi there,
I am using Reframework. I have a workflow where i unzip a file in a desired folder. Files can be more than so i m using for each file in folder. How to increment it for each file on folder, as it does not and goes to next transaction.
If you are not using queues for this, the below thread should help you
Regards
PS Parvathy
you can try like-
In Init state
Read all files using
fileList = Directory.GetFiles(“FolderPath”)
Assign it to in_TransactionItems.
In GetTransactionData
Return one file:
out_TransactionItem = in_TransactionItems(TransactionNumber - 1)
In Process.xaml
Unzip only that single file using TransactionItem.
REFramework automatically increments TransactionNumber after each file.
Mine in init i navigate to a website, in get data export a view which have a number of transaction. From there i get transaction and in process i download the attachments of each transaction. Then unzip the files whete can have more than 1. So how to script for this?
Hi
If I understand it correct, you go to a website where you have to iterate through mulitple transactions and then for each transaction you need to download a zip-file. And then you have to unzip that file and iterate all the files from the Zip File?
So in init I would go through all the transactions and download the zip-file, the unzip it to a specific folder for each zip, then you could use a queue to add each folder to the queue, could also be the path to the zipfile and then unzip it during processing, if you want the error handling from that state for this part of the process. Then after unzipping, either use a ‘for each file in folder’ or just a ‘for each’, to iterate throug all files.
You could also go for a Dispatcher/performer setup if you have many transaction to handle.
Hope it makes sense
you need to use something like this ![]()
For each Dir in Directory.GetDirectories()
{
FilesLst = Dir.GetFiles();
for each file in FilesLst
{
//do your actions in here…
}
}
this will loop folders as well as for files in them…
Hi @MrBidstrup,ok so in get data there is an excel looping for transaction. In process, i have first process to download all attachment as zip and then unzip it to the desired folder. If my process 1 is success, than i go to process 2 where in the workflow i am using for each file in folder to loop all the unzip files where the zip folder shld have been deleted. In this case where should i do the for each?