How to block a queue ?

How to block a queue ?

lise_boutin
Explorer Explorer
180 Views
4 Replies
Message 1 of 5

How to block a queue ?

lise_boutin
Explorer
Explorer

Dear community,

I need your help with blocking a queue. I have two queues, and one of them must send its items to the next equipment while the other one waits. Once the first queue has finished sending all its items, the second queue should then be allowed to send its items to the next equipment. How can I set this up? I tried using an exit trigger on one of the queues, but it didn’t work.

 

Thank you for your help !

0 Likes
Accepted solutions (1)
181 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor

You close the output of a queue already on reset. Once the other queue gets empty on exit trigger you close the output in Control templates of this queue. Condition is:

current.subnodes.length == 1

An exiting item is still counted as belonging to an object. You open the other queue's output at the same trigger by adding another control template. Be sure, that you set a correct reference to the other queue.

0 Likes
Message 3 of 5

lise_boutin
Explorer
Explorer

My problem is actually more complicated than it looked at first...

After my two queues, I have a combiner. Each queue sends a different product, and the combiner packs these products into a stick. The stick can receive either product 1 or product 2, and I control this in the combiner with an OnEntry trigger that uses a table. The table tells the combiner whether it should take one item from Queue 1 or one item from Queue 2, based on the stick number. Because of this, the combiner switches between the two product types every time. I’ve attached the issue.

My goal is to process all my Deo 1 first, and then all my Deo 2.

Do you know what I can do to avoid this ? 

Thank you for your help !

0 Likes
Message 4 of 5

moehlmann_fe
Collaborator
Collaborator
Accepted solution

You can simplify the logic by having the items converge in a single queue before entering the combiner. By closing its input after each entry and opening it when the combiner receives a container item the queue can act as an extension of the combiner of sorts. The rest of the logic can then be build as suggested by Jörg.

I activated the batching logic on the two initial queues. This is done so the first received item doesn't continue on immediately before a second one has entered. That would otherwise break the "switch active queue" logic defined via the triggers.

Message 5 of 5

214219004_nitt
Contributor
Contributor

You can open and close the ports of Queue.