Close popover
Srinivas Yelamanchili (yelas1)
Senior System Architect
Pegasystems Inc.
yelas1 Member since 2014 76 posts
Posted: October 31, 2016
Last activity: November 14, 2016

Scheduled Agents with Auto queue management

I have a scheduled Agent 'ProcessReportQueues', 5 entries of this that call activities ProcessQ1, ProcessQ2, ..Q5 from the class System-Queue-DefaultEntry.

All have Interval '30sec', are of mode 'Standard', Category is 'Uncategorized' and 'Auto-queue management' checked.

1. Are items within a queue processed first-come-first-serve? 

2. Does each task have to complete before the next one is picked within the same queue?

3. The PegaRules-Batch-<number> that we see in the log, does this Batch# correspond to particular queue everytime?
For example, does Batch3 always refers to a particular queue, say 'ProcessQ2'
Or can Batch3 can sometimes be for a task in ProcessQ1 and sometimes for ProcessQ2?

4. I have a Declare Trigger on 'CommittedSave' that calls an activity which pushes the item to the queue for the agent 'ProcessReportQueues' agent.

When a work object say 'WO-ABC' is CommittedSave twice within few seconds, it's pushed into 2 queues, say ProcessQ3 and ProcessQ4.
However, ProcessQ3 and Q4 may finish the task in order different than the original call was made and is giving incorrect results.

For example, if WO-ABC has a property set to 'pOld' and CommittedSave, and then property set to 'pNew' and CommittedSave, both occuring within few seconds

Now, queue ProcessQ3 would have picked pOld and wrote to a target database and ProcessQ4 would have picked pNew and wrote to the same target database.
But since ProcessQ3 and Q4 are independent we have cases where Q3 finished the task later than Q4 and hence pNew was written to the target database first and quickly overwritten with pOld.
This is making our target data incorrect.

How to resolve this issue?

How can we force item with same WO name to be pushed to the same queue if it already exists in a queue?
For example when queued to Agent 'ProcessReportQueues', can it check if the WO already exists (because of previous queuing) in any of the ProcessQ2...Q5 and if does, then push it to the same queue?


Data Integration Java and Activities
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.