Retry Extract Data in ReFramework

Hi,
I am using ReFramework , i extract data from website then save data in Excel file , my question is when i close the website before all data extract how i can delete the file and retry extract again with new data 3 times .

because when i close the browser all process complete with few of data and i need to complete Extract

Thanks

It depends on where data extraction takes place. If this is happening at the end of the Process state, check the file for an anomaly indicative of all of the data not having been extracted. If the data wasn’t extracted, trigger an Application error by just using the Throw activity with New Exception("This is the message which will be displayed for the error."). Lastly, make sure the retry count in your Config file is set to 3.

1 Like

Hi @Anthony_Humphries

It is work fine but I try to close the browser so there is no specific time are you understand what I mean ?

Do you close the browser in the Process or End state?

You mean the activity ?

Or me when I close the browser?

The activity. If you close the browser, I imagine that would trigger other errors which would force a retry anyway.

Yes it is in the end process , yes I get error when i close that ; I do not understand how I can do that

Ah, I see. In that case, could you move the close browser activity to the Process state, or is there more than one transaction to process?

Yes there are other process… I extract data and then add to queue in O

In that case, can you make an If activity at the end of the Process state that checks if it’s at the last transaction item by counting the remaining queue items? If that’s the case, have the process then check if the data was correctly scraped. If it wasn’t, throw an error.

Ok ; but how i can do that? I mean the condition

If you use Get Queue Items, you can get the ones set to New. Then do a count of the items. If the count is 0, you know you’re at the last transaction.

No I extract data and then save that in excel file after that I add the data to queue only this

Curious to know how you know it didn’t extract everything? Trying to find something on which to base a failure.

No it is extract evening but I mean how can I write the if conduation?

That’s what I’m trying to figure out. How do you know when it doesn’t extract all of the data?

Ah ok :sweat_smile: ; I extract 100 so I see that in excel file also when it is finish all extract there are message box

So are you looking for a way to trigger a retry manually if the file doesn’t contain all of the records?

Yes ; for example it is extra only 50 or 40 then there are some problem occur like the browser close or the connection is interrupted so I want to delete the old data and retry aging open browser and extract again

In that case, use the Message Box activity, but pass an array of options to it {"Yes", "No"}, where the message says something like “Is the data accurate?”. The options go under the Buttons input section. Get the selected option in the output of the Message Box activity ChosenButton.

Next, create a new transition from End Process to Init. If the chosen option is “No”, and RetryCount < the max retry count in the Config file increment the RetryCount variable by 1, and send the process to the Init state.