question

JP117 avatar image
0 Likes"
JP117 asked Jeanette F commented

Preempt Task Sequence

I have a simple process flow that I want to use in a larger model, and it seems like the preempt, abort all option is not working unless I use priorities. I thought that this would kill all tasks and allow me to create a new travel sequence. Why do you still need to use priorities with this option. This code is going to be part of a loop and there could be several of these redirects so assigning priorities will be difficult

In the model a person walks to a target location once he is within 20 meters of the target he is redirected somewhere else


Preempt Example.fsm

FlexSim 24.2.2
tasksequencespreempting
preempt-example.fsm (36.6 KiB)
· 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

Task sequences are split into two groups: non-preempting and preempting. A preempting task sequence can interrupt/abort a non-preempting task sequence regardless of priority. However to preempt another preempting TS the priority needs to be higher.

To always have priority you can read the priority value of the currently active task sequence and use a priority value that is 1 higher when creating the new sequence.

  1. token.Operator.as(TaskExecuter).activeTaskSequence.priority

Or you do the opposite and reduce the priority and/or preempt setting of the current task sequence before dispatching a new one.

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