question

Felipe P2 avatar image
0 Likes"
Felipe P2 asked Jason Lightfoot commented

How to listen to multiple events in Wait for event?

sin-enganchar-v2.fsmHi guys, I am working with this model and I have the following problem: i need the task executer TT to wait for two events to be accomplished (P1 and P2 empty) for starting to count "Unload P1" time. Once both queues are empty, TT should start counting "Unload P1" delay time and proceed as PF indicates.

I tried to configure that with the "Wait for event", introducing both events, but it´s working with the rule "OR", so if one of the queues is empty, the task executer TT starts counting "Unload P1" time. I need it to work with the rule "AND", as i indicated above.

Does anyone know how to solve this?

Kind regards,

Felipe

FlexSim 19.1.0
queuetask executeragv network
5 |100000

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

Joseph Gillespie avatar image
0 Likes"
Joseph Gillespie answered Felipe P2 commented

@Felipe P2

As far as I'm aware, there is no way to do this with one Process Flow activity. However, you can check if one is empty and then the other like this:

The decide activity is for the small chance that P1 is no longer empty by the time P2 becomes empty.

Here's an updated version of your model with this added to the Process Flow: sinengancharanswer.fsm


capture.png (5.1 KiB)
· 3
5 |100000

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

Felipe P2 avatar image Felipe P2 commented ·

Hi Joseph, thank you very much for your reply. The problem is the following: when TT recognizes PP1 is empty, previous TT hasn´t downloaded into PP2 yet, so it also recognizes that PP2 is empty. That means that it proceeds with counting the delay time. That is wrong. I think we could solve this by putting Control Point 5 as a resource, acquire it and release it just when previous TT has finished unloading into P2. But i can´t do this because i reached the model limit.

Do you think we can solve it any other way? Maybe we can simplify any other part of the model so we can introduce CP5 as a resource, without exceeding the model limit.

Kind regards,

Felipe

0 Likes 0 ·
Joseph Gillespie avatar image Joseph Gillespie Felipe P2 commented ·

@Felipe P2

I think using Control Point 5 as a resource is a good idea, you should do it. You could save two process flow activities by deleting this:

and adding an "Assign Labels" activity to keep track of where TT should unload the items. Then in your "unloading" subflow, you could unload to token.Destination or something like that. I suppose you could remove some "Sink" activities too.

If you need lots more for your model, it might be time to ask if your workplace can get a licensed version.

0 Likes 0 ·
capture.png (3.0 KiB)
Felipe P2 avatar image Felipe P2 Joseph Gillespie commented ·

Thank you very much!!

I will try that.

Kind regards,

Felipe

0 Likes 0 ·
Braydn T avatar image
0 Likes"
Braydn T answered Jason Lightfoot commented

@Felipe P2

You can click the button highlighted in red here:

After you do that it will look like this, and you can add another wait for event in the same task in process flow. The Token will not continue until both tasks are complete.


felipe-p2.png (14.0 KiB)
after-added.png (15.6 KiB)
· 3
5 |100000

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

Felipe P2 avatar image Felipe P2 commented ·

Hi Braydn, as far as i know, if i do that, the program waits for one event or another. I mean, if either of two event are accomplished, it proceeds. Am I wrong?

1 Like 1 ·
Nip J avatar image Nip J commented ·

Hey @Felipe P2, from what I have seen in my model, you are right: The token continoues when only one of the wait for event objects are triggered; so the token does not wait until every single task is accomplished.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Nip J commented ·

If you want to wait for both events to have fired then you need to split the token to feed two wait for event activities followed by a synchronise/ batch activity

1 Like 1 ·