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
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***
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
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.
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.