question

Axel Kohonen avatar image
0 Likes"
Axel Kohonen asked Matt Long commented

Run process flow on model reset

Hi,

I would like to initialize my model by running a Process flow on model reset. Is this possible somehow?

It works nicely when I run the process flow at time zero, but then the user cannot see what happens at reset until he runs the model.

I tried calling createtoken in the onModelReset trigger and it creates a token into the process flow. But immediately as the onModelReset code ends the token disappears. See the attached executeprocessflowonmodelreset-170.fsm model.

Any hints on how/if this can be achieved?

Thank you!

Kind regards,

Axel

FlexSim 17.0.3
process flowonmodelreset
5 |100000

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

Matt Long avatar image
4 Likes"
Matt Long answered Matt Long commented

Do not run Process Flow on reset.

We specifically removed the OnReset event from Event-Triggered Source as it can cause serious issues having tokens in your model at reset.

If you choose to do so, you do so at your own risk.

· 2
5 |100000

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

Mischa Spelt avatar image
2 Likes"
Mischa Spelt answered

If your process flow is "instantaneous", _i.e._ doesn't have activities like Delay, you could try calling executesubflow from the Model Reset trigger. However this is probably not the intended use of executesubflows and a there are probably a thousand ways that this may break.

· 2
5 |100000

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