What is the command to wait for a tasksequence to be completed?

What is the command to wait for a tasksequence to be completed?

enrique.elizaga
Advocate Advocate
32 Views
3 Replies
Message 1 of 4

What is the command to wait for a tasksequence to be completed?

enrique.elizaga
Advocate
Advocate

[ FlexSim 20.1.1 ]

Hi, I am working with a tasksequence in my process flow. To keep it compact I have included all my task sequence activities in one custom code activty as shown below. (Create, travel, load, finish and dispatch). I am encountering a problem though... the token doesn't wait for the tasksequence to be completed and moves on to the next activities. I have solved this by adding a separate dispatch activity that allows me to chose "Wait Until Complete". How can I add that option to my code to avoid that additional DISPATCH ACTIVITY? I attach the model also. Thanks!

30566-1594134363327.png

Dispatch.fsm

Accepted solutions (1)
33 Views
3 Replies
Replies (3)
Message 2 of 4

tanner_p
Not applicable

@Enrique Elizaga,

You can try adding a TaskSequence.dispatch() activity as explained in the User Manual. But, I don't think this will wait for the task sequence to be completed like in the Process Flow. What you're doing is probably the best/easiest solution for this. Is there a reason why you can't use the Dispatch activity in Process Flow?

Image.png

Also, keep in mind that FlexSim used to require using custom task sequences for everything. We strayed from that and developed Process Flow activities so you don't have to go through all the trouble of what you're doing. So, unless there's a really good reason against using Process Flow activities, I suggest using them.

0 Likes
Message 3 of 4

mischa_spelt
Advisor
Advisor
Accepted solution

Code executes "instantaneously". More precisely, while code is running the model time cannot advance. What you can do, if you insist on creating task sequences manually, is insert a callback task (e.g. TASKTYPE_NODEFUNCTION) that will execute a specific node when that task is reached.

But since you seem to be using ProcessFlow already, I agree with @tanner.p that you should probably just create the whole task sequence using the activities especially designed for that, and they tend to have a "Wait for completion" checkbox that does exactly what you want.

Message 4 of 4

Ben_WilsonADSK
Community Manager
Community Manager

Hi @enrique.elizaga, was mischa.spelt's or tanner.p's answer helpful? If so, please click the red "Accept" button on one of their answers. Or if you still have questions, add a comment and we'll continue the conversation.

0 Likes