question

SudheerReddy avatar image
0 Likes"
SudheerReddy asked SudheerReddy commented

Can I listen to 2 queues cumulative content OnContentChange in Wait for Event?

As shown in below image, Can I create a Wait for Event activity where I can listen to Queue1 and Queue2 cumulative content value should be 10.

If the above is not possible, is there any other way where token should wait until the cumulative value in Queue1 and Queue2 is 10 and release once the condition is met.

I am attaching the model for reference.

cumcontent.fsm

FlexSim 20.0.3
wait for event
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Braydn T avatar image Braydn T commented ·

@Sudheer R

I am sure someone has a better solution, but you could use 2 event triggered sources for the entry of the boxes, and then a batch. You could also use a list.

0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered SudheerReddy commented

Not directly. But you can easily set up something that listens to changes on the 2 queues and then have your Wait for Event activity listen to that. Here are two examples I thought of:

Use a Zone

In this model I listen to the OnEntry of both queues with an Event-triggered source. When something enters one of the queues I have a token enter the Zone. Then I listen to that item's OnExiting event and leave the zone when that happens. This way the Zone's content is equal to the cumulative content of both queues. Then I just listen to the Zone's OnContentChange.

zonelisten.fsm

Use a Tracked Variable label

In this model I listen to the OnContentChange of both queues with an Event-triggered source. When either content changes I update the value of the ComboContent tracked variable label on Queue1. Then I just listen to the OnChange event of the ComboContent tracked variable.

trackedvariablelabel.fsm


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

SudheerReddy avatar image SudheerReddy commented ·

@Matthew Gillespie Thanks it helps me.

0 Likes 0 ·