Check the postpones status before adding into queue

Dispatcher adds list of ID into queue and performer picks them and works on it .whenever there is a application issue that Transaction Item is been postponed by 1 hour .Now issue is dispatcher again adds that ID which is been postponed into queue by performer. I cannot add unique reference due to other logics involved in performer .

Is there is any way to check while running the dispatcher where that same ID is present in queue and is been postponed ? if yes then not to add it into queue else to add into queue

@tharaninatarajan1901

Add the id as reference…then you can use get queue items with filter on new in progress and postponed items and reference will be the id you want to check…and once you get response check the count quitems.count>0 then do not add else add the item

Hope this helps

cheers

  1. Queue Data Structure:
    Ensure that the queue items you add have unique identifiers that correspond to the IDs you are working with. For instance, you could have a parameter like “ItemID” in each queue item that uniquely identifies the item.

  2. Dispatcher Logic:
    When the dispatcher adds an item to the queue, it can first check if an item with the same ID and a postponed status already exists in the queue.

    • Use the “Get Transaction Items” activity to retrieve all items in the queue.
    • Loop through each item and check its “ItemID” and status.
    • If an item with the same ID and a postponed status is found, you can skip adding it to the queue.
  3. Performer Logic:
    In the performer’s process, when a transaction is postponed, you can mark it with a specific status or flag. For example, you could add a parameter like “PostponedStatus” and set it to “True” for postponed items.

  4. Dispatcher Process Adjustment:
    If you’re postponing a transaction in the performer, you could also update the status of the item in the queue to reflect its postponed status.

By implementing these steps, you can prevent the same ID from being added to the queue again if it’s already in the queue with a postponed status. This way, you ensure that the dispatcher checks for the presence of a postponed item before adding it to the queue. However, it’s important to design your logic carefully to account for different scenarios and ensure the integrity of your process.