question

Guillaume M2 avatar image
0 Likes"
Guillaume M2 asked Regan Blackett edited

Delete all tokens of a process flow

Hello,

Is it possible to delete all tokens of a process flow on specific event ? My FlexSim model is connected to a secket server. When I receive particular message, that means that we shoud "reset" all activities (without resetting the model and the simulation). I'm able to detect that message, but I don't know how to delete the tokens of the targeted process flow.

Thank you.

FlexSim 20.0.10
processflowcommunication socket plc and flexsim
5 |100000

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

1 Answer

Regan Blackett avatar image
0 Likes"
Regan Blackett answered Regan Blackett edited

One way you could do this is at the start of your regular process flow, allow all your tokens to enter a Zone and let the tokens exit the zone at the end of their natural process.

Then I would use an event triggered source to listen to an event that will trigger the removal of the tokens. After the event triggered source creates its token, I would use an assign label activity to assign a label to the token that gets all a reference to all the tokens in the zone (under the "value" of the label choose, Token>Tokens in Shared Asset and reference your Zone).

Then you can use a Release Tokens activity to send the tokens referenced in that label to a sink that has the "deallocate shared assets" check box checked. This will force the tokens out of the Zone and Their respective activities and let them be deleted by the sink activity.

Attached is an example of model of what that could look like.

deletetokensonevent.fsm


5 |100000

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