question

Tamilselvan avatar image
0 Likes"
Tamilselvan asked Natalie White commented

Stop and Resume Token

I want to Stop and Resume token based on my need is it possible using the Custom code, I don't to use Wait for event.

Thanks in advance


FlexSim 23.1.1
stop and resume token
· 6
5 |100000

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

Natalie White avatar image Natalie White commented ·
The Custom Code activity has a "Release Token" option. If you select this option, you can directly edit the code to put the releasetoken function inside of an if statement. Note that this activity, by default, releases the parent token.

Hope this helps!

0 Likes 0 ·
Tamilselvan avatar image Tamilselvan Natalie White commented ·

My exact requirement is, i want to hold or Stop the token at custom code for sometime, to get my custom condition satisfied, I saw a option called Stop and Resume Token in Custom code, can it fulfill my requirement. Can i get some example model in that.

0 Likes 0 ·
Natalie White avatar image Natalie White commented ·

Hi @Tamilselvan,

What is the requirement (custom condition) for resuming the token? Also, it's easier to help you if we can look at your model. Please post your model or a sample model that demonstrates your question.

Proprietary models can be posted as a private question visible only to FlexSim U.S. support staff. You can also contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·
Tamilselvan avatar image Tamilselvan Natalie White commented ·

As i previously mentioned earlier, my token as to wait until my custom condition satisfied, then it as to resume.


0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Tamilselvan commented ·
Synchronisation through lists, waiting for events, split and join activities are much more transparent. Why do you not want to use a build in activitiy?
0 Likes 0 ·
Show more comments

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

You can, In your custom code put something like:

await Delay.minutes(1);  // or an event or list action

but we'd probably recommend using the built in functions where the behavior is more obvious/transparent. If you have a case where none of the standard options are possible we'd be interested to know the reason.

Here's the information on using await and coroutines.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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