I’m currently building an automation using the REframework. I need to process transactions one by one. So after finishing one transaction I need to load the queue with a new item (from application X). Before loading the queue with a new item I want to perform a check. If there is still a transaction in queue then don’t load a new item. Only load a new item if there are no transactions.
I can’t figure it out how to adjust the get transaction step with the try catch activity.
Default situation:
If there are no transactions after the get transaction activity an exception will be thrown after the catch.
Needed situation: Get transaction activity
Try: Get transaction. There is a transaction. So no catch. Process transaction.
Try: Get transaction. No transaction, so catch exception. Load queue sequence (with it’s own try catch I think). Another Get transaction. There is a transaction. So no catch. Process transaction.
How do I make this work? Or are there other alternatives?
You can validate the presence of data after getting the transaction in the process state as well.
Let’s say you get the data in the get transaction state & want to verify whether there are any certain conditions you want to check, you can do this by taking decision making activities in process state. If the desired data is available, proceed with the process state. If not, shift the control to the exception handling block.
@leobot.dafinci Hi. RE framework have the GetTransactionItem within Retry scope. If no item in queue, out_TransactionItem is Nothing. Add an If condition as shown in image, then place the logic to get the data and add new transaction item. Hope this helps
Place an If activity after the Retry Get transactionitem (delete rethrow from catch section)
The If activity will check whether there are transaction or not.
If there’s no transaction item I have to put my load queue item sequence into the then section with its own try catch
But I still have to put another Retry Get transtransaction (with rethrow in catch section) after that
Yea this is what i was mentioning …but not sure what you are using the for loop . After get queue items…if you are using it to count actually you can do queueitems.count …here queueitems being the output of get queue items
And actually when wueue is empty you wanted to add queue item i guess…but I dont see that may be you can check if that is missing or is it fine
I did used an for each to count the queue items. Yes indeed a queueitems.count is much better ;).
An add queue item when queue is empty is not missing. It’s inside the Load queue with workload (I know it’s a log message. This should be an sequence ;)) I had to build a flowchart quickly.