question

Craig DIckson avatar image
1 Like"
Craig DIckson asked Matthew Gillespie answered

wait for either of two events in process flow

How can I use a Wait For Event to wait for either of two events? I want my process to wake up when either of the two lists it can work on changes. I can make it wake up on one event or the other, using "On Entry" on the "Push to List". But I need it to wake up if either list changes.

Right now I just have it delay and check periodically, but that feels like a hack.

Thanks,

Craig

FlexSim 16.1.0
process flowwait for event
5 |100000

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

Matthew Gillespie avatar image
3 Likes"
Matthew Gillespie answered

One Wait For Event activity can listen to multiple events (on different objects even).

In this screenshot I'm listening to the On Push of two different Lists:


waitforevent.png (18.6 KiB)
5 |100000

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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Adrian Haws commented

Maybe you can duplicate your both lists and fit them into only one other list.

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

Craig DIckson avatar image Craig DIckson commented ·

I thought of using a single list, but I think it would make the model very hard to follow, and it would greatly complicate my queries (I suppose you could use partitions, but I already am using partitions for other purposes). Also, I have had had much better success triggering off of "push to list" activities than off of the lists themselves.)

Is there a way I could trigger off of a global variable, and then update that variable as a token enters either list? It wasn't clear to me how to do that in the "wait for event" PF activity.

(FWIW, what I really want is something like the old SIMAN wait / signal. (Yes, I have been doing this that long!) What makes that nice is the sleeping entity is completely passive, requiring no processor time at all. Rather than listening for a change at every event, it sleeps, and the other code affirmatively wakes it with a specific command. (Kind of like poking someone to wake them up, rather than them sitting awake on the couch until they hear you walk in.)

Craig

0 Likes 0 ·