Monitoring model triggers OnRunStop

Monitoring model triggers OnRunStop

zhun_z
Not applicable
92 Views
4 Replies
Message 1 of 5

Monitoring model triggers OnRunStop

zhun_z
Not applicable

[ FlexSim 21.2.4 ]

Monitor model OnRunStop.fsm1.gifExcuse me, i want to monitor the model OnRunStop, i build two same activity with the same PF, Why the no.1 cann't monitor the model OnRunStop, but no.2 can monitor sucessfully?Monitor model OnRunStop.fsm

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

Ben_WilsonADSK
Community Manager
Community Manager
Accepted solution

This looks like some limitation in the current version of the software. As you found, one Process Flow Wait For Event activity can successfully detect the OnRunStop event. In addition to that, the OnRunStop Model Trigger found in the Toolbox will also run when you stop the model.

As a work around you can do something like the following with a single Wait For Event activity:

1639174218696.png

I tested this setup and found that it works properly - both Custom Code activities execute their behavior.

Message 3 of 5

joerg_vogel_HsH
Mentor
Mentor
OnRunStop event is a final last single call before all activity ends. If there would be a multiple event detection a procedure of your model must run beyond the point of stop in an encapsulated environment. Only if these procedures stop by design, you can start your model again. Such an exclusion makes it difficult to run multiple scenarios in an experimenter. if you like to implement a pre-stop or a general trigger over your whole model you can change a watched and tracked variable in your model. Whenever you set a value of this variable somewhere in your model, you can detect it in a central logic.
0 Likes
Message 4 of 5

zhun_z
Not applicable
Thank you ,I will try to follow your proposal.
0 Likes
Message 5 of 5

zhun_z
Not applicable
Thanks, tracked variable is a new idea, i will try it.
0 Likes