cancel
Showing results for 
Search instead for 
Did you mean: 

Parent/Child Queues - Locking specific Parent/Child queues

DavidChu
Level 3
I was wondering if anyone here can offer a solution to a current issue I'm running into.

Here's a high level summary of what's going one.  For sake of simplicity, let's say there are 10 different plants and 15 reports that they each need to run on a monthly basis.  Each plant will need to kickstart the running of their reports at the same time at around 7AM on the first of every month.  Therefore we'll need 10 VMs (1 for every plant) to be scheduled at 7AM to run a report, download, and save to a specified folder.

Currently, with the way the queues are constructed, if I were to schedule the automation to run, all 10 VMs will work on the same plant then when all the work items are complete it'll move onto the next item.  Instead, I want each VM to work on it's own plant.

Within my Parent Queue item keys I have the Plant Name, ID, Time Zone, Month Year.  Within my Child Queue item keys I have the Plant Name, ID, Time Zone, Report to run.  So using my example above, the Parent Queue will have 10 work queue items and the Child Queue will have 150 work queue items (list of all the 15 reports to run for all 10 Plants, 10*15 = 150 reports).

What's the best way when I'm running the Main process that does the report running, downloading, saving of the reports to lock all of the items in the Child Queue associated with the same plant so that only 1 VM can work on it?  That way I can spread all the VMs to simultaneously work on their own plant at the same time rather than how it's currently constructed where all 10 VMs will work on that first plant until all of those reports are completed and then it'll move onto the next plant?  Would I have to get the Parent queue and lock all of it's Child queue items?  If so, how would I do this?  FYI, I'm currently using BP version 6.4.
1 REPLY 1

Hi, David,

there are several approaches how to handle this (bear in mind that I have limited knowledge of the environment which I understood from your description):
1. the simplest approach would be to create 10 queues for 10 plants which would avoid the behavior which you are worried about. Of course, disadvantage is that you end up with many queues.
2. Better approach is having one queue and drive the get next item through Key filter - you put in an Item Key the identification of the plant which consequently will be used in your child queue to pick up items for that particular plant. Or you use Tag Filter for the same.

I would build it the following way - from the parent queue read Item Key (or Tag) and filter from the child queue only items which are related to the parent. This way you can easily achieve simultaneous processing for all 10 plants.

Regards,

Zdenek