question

Lars Christian J2 avatar image
0 Likes"
Lars Christian J2 asked Jason Lightfoot answered

How to use Preemption and keeping the taskSequence value upon Restore Context?

When I restore tokens using "Restore Context", the token.taskSequence is set to <no path>. How can I keep the taskSquence? I am not looking for a dedicated work-around as I am saving all the tokens in a processFlow, thus some tokens are in "normal" activties and some tokens are running a taskSequence. A demo model included. The actual model contains a lot of activities.

Pre_12_7.fsm

1651650691587.png


1651650787476.png

FlexSim 22.1.1
process flow tasksequenceprocess flow preemption
1651650691587.png (81.6 KiB)
1651650787476.png (101.1 KiB)
pre-12-7.fsm (41.5 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.

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

It's hard to answer this without giving you a"workaround", since the task sequence is destroyed when you move the token out of the activity.

To be honest - I think the 'correct' technique here is to stop the task executer since the activity is waiting for that to finish anyway.

When I've done this in the past I screen the tokens for the activity types so only preempt those that I know need preempting (those with their own events scheduled).

Also note that in your code you're pushing the same token to the list twice since the Resource activity also gives the token during getTokens().

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

Lars Christian J2 avatar image Lars Christian J2 commented ·
Thanks Jason. It makes good sense

I would like to accept your answer, but it is currently not possibly for some unknown reason.

0 Likes 0 ·

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.