Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Activity - findAssignmentInWorkbasket, behaves inconsistently



GetNextWork functionality behaves incorrectly.

An Operator ID has more than one workbasket defined with urgency thresholds.
  • WB1 with threshold 33
  • WB2 with threshold 67

Expected behavior in following order

  1. Pick all the work with Urgency >= 33 from WB1
  2. Pick all the work with Urgency >=67 from WB2
  3. Pick all the work with Urgency < 33 from WB1
  4. Pick all the work with Urgency < 67 from WB2

Steps 1 and 2 are working as expected; however, the order of steps 3 and 4 are not working consistently.

Error Messages

Not Applicable

Steps to Reproduce

  1. Have a few workbaskets set up on an operator's profile with no merge option.
  2. Have assignments in each workbasket with different urgencies as per threshold.
  3. Call GetNextWork.

Root Cause

A defect in Pegasystems’ code or rules. The findAssignmentInWorkbasket activity uses a HashMap in step 6 so the order is not guaranteed.


Modify step 6 of the findAssignmentInWorkbasket activity to use a LinkedHashmap instead of a HashMap.

// Keep track of the highest threshold we've tracked for each basket
java.util.HashMap hashThreshMax = new java.util.HashMap();

java.util.HashMap hashThreshMax = new java.util.LinkedHashmap() ;

Published October 5, 2015 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us