How to end the REFramework process once the queue is empty?

Hi everyone,

I’m using REFramework with Orchestrator Queues.

The issue I’m facing:

  • After processing all queue items, even when there are no more transactions.
    the workflow doesn’t stop. It keeps looping through the states, again it loading queues and keep on looping
    What I’ve checked:
  • I’m using the “Get Transaction Item” activity inside GetTransactionData.xaml.
  • The output is assigned directly to out_TransactionItem.
  • In Main.xaml, the transition condition is: TransactionItem IsNot Nothing.

Question:
What is the correct way to end the REFramework process once the queue is empty?
Thanks in advance!

Hi @Rpa_Lrnr

From your get transaction data state, there should be a transition to end process based on the condition when transactionItem variable is nothing.

See the highlighted transition in blue color

and its condition is as below:

1 Like

The REFramework process, when using Orchestrator Queues, should end automatically when the queue is empty. This happens because the “Get Transaction Item” activity, within the GetTransactionData.xaml file, returns “Nothing” when no more queue items are available. The transition condition TransactionItem IsNot Nothing in Main.xaml then evaluates to False, causing the workflow to move to the “End Process” state.

If your process is looping infinitely, the most common reason is that the out_TransactionItem variable is not correctly becoming Nothing. You should:

  1. Verify Get Transaction Item is the sole source of out_TransactionItem: Ensure no other activities or default values prevent out_TransactionItem from being Nothing when the queue is empty.
  2. Check “Get Transaction Item” properties: Confirm the “Orchestrator Folder Path” and “Queue Name” are exact matches to your Orchestrator setup.
  3. Debug: Use breakpoints after Invoke GetTransactionData in Main.xaml to inspect the value of TransactionItem. It must be Nothing when the queue is empty.
1 Like

@Rpa_Lrnr

Welcome to the community

You need not ideally change anything when items are not there ref automatically goes to end process

Unless you tampered or changed something

Cheers

@Rpa_Lrnr

In addition to what I suggested above, would also be worth checking that your add queue item’s functionality is not part of the loop.

Also, under initialization state, it should be inside the block - if config is nothing.

Otherwise what can happen in reframework is whenever system exception occurs, control goes back to initial state for initialization applications, and if your add queue items is outside of it config nothing, it will keep adding items to the queue and hence remain in loop.

I guess that might be what is happening in your case.

Keep your dispatcher part in first run sequence