19-12-23 04:45 PM
Good Day Team, Trust you are well and looking forward to the festive break.
I need a bit of advice on the Defer feature in a work Queue, something that I have not used before.
I have something like a Task scheduler that has a list of processes that need to run. My aim is that if I get a system type failure, I would like to defer the task for about 30 minutes and then try again. However, after the 2nd attempt, I would like to mark the item as an exception.
I am just not sure where exactly to place the defer action within the process. I assume somewhere near the BP "Mark Item as Exception" Template that I am using. Any advice?
Kind regards
Gavin
Answered! Go to Answer.
20-12-23 10:05 AM
Hi Gavin
You'll only get a new Item ID output from Mark Exception if the queue has been configured to enable multiple retries (the default is zero retries) and if the Retry and Keep Locked inputs are set accordingly. If you do have the lock on a retry item, then you'll be able to use Defer to freeze the new item for a while.
Personally I'm not keen on queue retries because it makes MI harder. Another approach is to simply handle the exception as normal, and if it's the type you want to retry, use Defer instead of Mark Exception. You'll also need to record the fact that the item has been attempted before, with a Tag, Status or as part of Item Data - that way next time around you'll know not to Defer again.
19-12-23 06:28 PM
Hi Gavin Rudling,
If you mark an item as exception it will generate new item id> You can use new item id to defer that item based on how you want to build the logic.
20-12-23 05:57 AM
Thanks Harish, I will give it a try. Much appreciated.
Regards
Gavin
20-12-23 10:05 AM
Hi Gavin
You'll only get a new Item ID output from Mark Exception if the queue has been configured to enable multiple retries (the default is zero retries) and if the Retry and Keep Locked inputs are set accordingly. If you do have the lock on a retry item, then you'll be able to use Defer to freeze the new item for a while.
Personally I'm not keen on queue retries because it makes MI harder. Another approach is to simply handle the exception as normal, and if it's the type you want to retry, use Defer instead of Mark Exception. You'll also need to record the fact that the item has been attempted before, with a Tag, Status or as part of Item Data - that way next time around you'll know not to Defer again.
20-12-23 12:56 PM
Thanks John and the rest of the Team for your advice and suggestions, they are greatly appreciated.
For those that celebrate Christmas and the Festive seasons, have a wonderful time and drive to stay alive.
For everyone I wish you all the best for 2024
Kind regards
Gavin