cancel
Showing results for 
Search instead for 
Did you mean: 
david.l.morris
Level 15
Status: New
I wanted to quickly submit this as a possible bug or future improvement. Please let me know if the below information is not clear enough for reproducing the issue.
 
Today, we encountered an issue with negative priorities on queue items in a Production automation. We will be adjusting the automation probably to not use negative priorities anymore. I just wanted to be clear that this is not or at least soon will not be affecting us anymore, but it would be good to add this to the Blue Prism Dev backlog if it's not already there.
 
Blue Prism versions tested: 6.10.1 & 7.3.1 -- Same behavior observed in both
 
Description of the issue: Most people only use priorities of 0+, but there are times that you may want to increase the priority of a specific work queue item to be higher than the average queue item. The only way to do that above a priority of 0 is to go into the negative numbers (or redesign the automation so that the initial priority is something like 100 or 200 etc.). What we discovered is that you cannot use the Work Queues Internal Business Object's action "Set Priority" to set a priority of -1. The error you get is "No priority specified". This is the same error you get if you use this action without providing a number. However, you can supply any other (at least 32 bit) negative number such as -2 or -200, and it will set the Priority just fine. Along with this, you can use the action "Add To Queue" and provide any negative number INCLUDING -1. This is the only way I have found to be able to use negative one as the priority is if you set it when initially adding the item to the queue.
 
Thoughts: I don't know what Blue Prism's opinion is on this. My suspicion is that negative numbers were not intended to be allowed. But if that were the case, I would think there'd be an input validation on Add To Queue and Set Priority to require that the number is at least 0, but neither of them have such a validation. So, my request is that these two be made to have the same functionality. Either make them both not support negative numbers, or make them both support all negative numbers including -1. The problem with the first option is that you could be breaking automations for customers that rely on negative numbers in some way. The second option is probably the better solution, and the only change required is to the Set Priority action so that it handles the priority in the same way that Add To Queue does, allowing for -1 to be a valid input.

Steps to recreate:

To recreate this issue, create a queue item using Add To Queue. There will be no issues at this point no matter what priority you use. 1, 0, -1, -2. All of these work.

Next, in some way, get the Item ID of the item you just created. It will be in the output collection of Item IDs when adding to the queue. It could also be retrieved from the output of Get Next Item, etc.

Next, using the Item ID of the pending item, use the action Set Priority and give it a Priority of -1. This will fail with the error "No priority specified". Next you could try -2. This should succeed.

For BP personnel: Same content submitted in Ticket #299379

1 Comment
stepher
Level 6

Salutations, @david.l.morris,

First, to confirm, we have had a similar use for the Priority values.  In our case, it was Purchase Order/Invoice discrepancies, and we wanted to prioritize by the dollar amount--highest to lowest (discrepancy multiplied by '-1').  I don't recall ever having an issue before, but I recently rebuilt the related processes and went to a date-based method.

Second, only as an "I do find it an odd coincident" statement, as most people are aware, "-1/0" is an alternative flag/pair representing "true" and "false", respectively.  Probably not at all connected, but I have become aware of other VB-related quirks.  And, yes, I would expect the "0" value to glitch as well.

Third, I would like to offer an alternative approach.  I would propose one of the following as a configuration in the Work Queue settings: 

  1. "Prioritize [Work Queue] Ascending: (True/False)" (Default as 'True')
  2. "Prioritize [Work Queue]: (Ascending/Descending)" (Default as 'Ascending')

I prefer the second as it is a bit more explicit, but that's just me.  I also realize that this is a bit more than a 'break/fix' level-of-effort. Maybe something to wish for in v8 (or v9).

Just chiming in.  Take it easy,

Red