question

Alessio Merlo avatar image
0 Likes"
Alessio Merlo asked Alessio Merlo commented

TaskExecuter::onFinishTask isn't executed when the task is preempted

Hi,

today I discovered that the trigger "OnFinishTask" isn't executed when the task is preempted. I believe that it isn't a software issue, but it is by design. Could someone explain the reason? I would suggest to execute "OnFinishTask" also when the task is preempted.

In my model I am logging all OnBeginTask and OnFinishTask and some record missing when the task is preempted.

I attached a very simple example to show the problem.

onfinishtask.fsm

1645690714232.png

FlexSim 22.0.1
task executertask sequenceon finish task
1645690714232.png (19.5 KiB)
onfinishtask.fsm (42.1 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 Alessio Merlo commented

Alessio you can detect the preemption and resumption using a process flow (example attached). I think OnStartTask and OnFinishTask are doing what they're meant to - if you'd like to suggest adding OnPrempted and OnResumed then feel free to put a feature request here or sent to the dev email.

onfinishtask_jl2.fsm


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

Alessio Merlo avatar image Alessio Merlo commented ·
Thanks jason for your support!
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.