Deleting Orchestrator Queues based on condition

Hi guys I am having a issue in my current project. Scenario is i have one robot that creates a request for the response from a customer . When request is created a queue call it Q1 is added to the orchestrator. Another robot watches out for the time out meaning its job is to chk if no response is received in 1 hour shoot an email informing us that no response recieved even after one hour and create another queue scheduled for 4 hours call it Q 2 , this queue also after 4 hours shoots the mail saying no response recieved. Now suppose in the meantime we receive the response in say less that 1 hours, third robot is watching for response from the customer , when repsonse is recieved it creates another Queue call it Q_Response, i want the 1st queue Q1(that was scheduled to run after 1hours) to be deleted so that no emails comes, as we have got the response from customers. I am not sure how we can acheieve this . Is it possible that our process which is shooting the emails on timely basis can look for ‘Q_Response’ first through the entire list of queues and then if it finds Q_Response, it deletes Q1 and Q2.
Pls help.

In simple words -
One process submits request to customer and dispatches a queue Q1(scheduled to run after 1 hour)
2nd process chks if any repsonse is recieved from customer if yes then it creates another queue
3rd process just checks timeout it processes Q1
Now i want to delete Q1 if response is recieved from customer. Could you pls propose a solution or any other way i should deal with queues?


Well normally, a queue item will be completed with either Success or Failed. So you would not want to delete the item, unless it was a mistake for adding it in. This is so you can compare the success rates of each queue item. For this, however, you would need a unique Reference if you plan to add the queue item in a repetitive manner, which you can use a timestamp next to your queue name for that. — That’s just something to think about.

If you want to delete the queue item, you will need to use both the Get Queue Items activity and the Delete Queue Items activity. You use the Get Queue Items to output all the items that match your criteria to a collection of items, then use that variable in the Delete Queue Items. In your case, you will only have one item in the collection. There is a property in the Get Queue Items to filter by “Reference”, so use that property, and you should be able to get the queue item(s) that match that Reference and feed it in the Delete Queue Items.

You can verify that the Get Queue Items is working by checking its count or all the items that were found in the collection. you can simply output your check in a write line or message box using this:
String.Join(", ", variableName.Select(Function(q) q.Reference).ToArray)

Regards :smiley: