Question

conditionally start parent agent (Allocator Advanced agent) only after all the allocated sub agents(standard agents) complete of their tasks using queue for agent method or activity in pega

i want to conditionally start parent agent (Allocator Advanced agent) only after all the allocated sub agents(standard agents) complete of their tasks using queue for agent method or activity in pega.

Can we write the Activity called/executed by the Parent/Allocator agent(Advanced agent) periodically on subsequent wakup first check if there are pending queued messages(count of ) for the child agents to process (System-Queue..Extension class) , if present skip the allocation of messages to the sub agents and end the activity, until next run of Parent/Allocator agent(Advanced agent)

There are tables below out which which tables are of our interest and what would be relation or condition to get total pending messages from the queue

data.pr_sys_queue_autotest

data.pr_sys_queue_col_pop

data.pr_sys_queue_count

data.pr_sys_queue_execreq_conn

data.pr_sys_queue_execreq_svc

data.pr_sys_queue_ftsindexer

data.pr_sys_queue_sla

data.pr_sys_queue_startflows

data.pr_sys_queues

if the only option to get pending items on a specific queue is writing a query (else pls suggest any other option) out of these tables ( my assumption is data.pr_sys_queue_count, data.pr_sys_queue_execreq_conn , data.pr_sys_queue_execreq_svc, data.pr_sys_queues,data.pr_sys_queues should be my interest)

***Edited by Moderator Marissa to update categories***

Comments

Keep up to date on this post and subscribe to comments

May 28, 2018 - 5:33am

Also pls suggest any other option like making use of OOTB API/ function / activity / method and point me to any Document or link which explains the tables and columns related to pega queueing to build SQL

 

May 30, 2018 - 11:31am
Response to govardhanar1741

Hello,

I'm not sure exactly what you mean by "Allocator" agent. I assume you are suggesting that you have an agent that processes work and in the act of doing that, it calls queue-for-agent to some sub agent. The first agent is your "allocator" and the sub agent(s), your "allocated". And then you want the allocator to sleep until all the other agents complete? I'm not aware of any facility OOTB to just do that, but you definitely could stick the allocator work object into a workbasket with an SLA that runs periodically and then checks the child items/work to see what state they are in. Once you've gotten them where you want them, you can move forward in the flow. I can't really tell you want tables to look at, but I really would focus on the work objects and less on the internal data, like queue items. You control the work objects and can decision off them, Pega internals can change from version to version with no notice to you, so you increase the chance that your clever solution breaks when you take an update.

Thanks,
Mike

August 7, 2019 - 11:07am

it depeneds on your queueing mechanism. you can have a decision table with all your child agent names.

have a data page to check if the specific queue is free or allocated. If free let your Decision table return the agent name. you can also exit from the master agent activity if none of the child queues are free.

August 7, 2019 - 4:41pm

While your use case is not entirely clear to me (it sounds like you are using a master agent to allocate 'task' to some other 'child' agent), but following information might help you.

Class System-Queue-DefaultEntry (Table: pr_sys_queues) has an exposed attribute pyagentname that hold the name of agent that owns a tasks, currently in queue.

In other words, if you need to find the total number of queued task of an agent, write a Obj-browse or Report def (depending on your choice and scope) to execute a similar query -

select count(*)

from class:System-Queue-DefaultEntry

where pyagentname = 'your_child_agent_name'

 

If you want to exclude broken queued item from count, add an additional criteria to your query:

.pyItemStatus not like 'Broken-%'

August 8, 2019 - 11:19am

Hi,

Standard agents will process the records based on FIFO( first come first out) so it won't be any problem for you if you put more items into the queue if they are independent of each other.