question

Aaron C avatar image
0 Likes"
Aaron C asked Braydn T edited

How can a token wait until all child tokens are destroyed?

I'm modeling a somewhat complex training center, and I'm stuck on how to get around one issue. An incoming class can range from 1-25 students. Those students are assigned an instructor, and then they begin performing practical training and tests. Even though they are in a "class" under the same instructor, they do not progress at the same rate.

So what I have right now is each token represents a candidate. These tokens create child copies of themselves that will go through the various steps of training. The parents are then batched together based on the class size and acquire 1 instructor. I then need that one batched token to wait until all of the child tokens complete their training steps and are destroyed, then release the instructor.

My actual question is, how can I make that one batched parent token wait until all the child tokens are destroyed?

wait for eventbatchingchild tokensparent token
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

·
Braydn T avatar image
0 Likes"
Braydn T answered Braydn T edited

Hey @Aaron C

There are 3 ways I can think of to do this easily. All 3 are in Process Flow.

The first is a batch task. This waits until a certain number of tokens arrives, and then released the number you want. depending on how you have your model set up, this could be very easy to implement.

The second is a subflow. You may have to reconfigure your model to accept this, but you would acquire the instructor, and then run the subflow. The subflow options allow you to create any number of tokens, and Process Flow will not move on to the next task until all of them reach "Finish"

The last is a Wait For Event. If you have something in your 3D model that means all the students are complete, you can use a wait for event to release them.

Hopefully this helps. If you need more help, please tag me and upload your model so we can help you better.


batch.png (15.0 KiB)
subflow.png (5.5 KiB)
wait-for-event.png (18.2 KiB)
· 3
5 |100000

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

Aaron C avatar image Aaron C commented ·

@Braydn T Thanks for your reply! I had been thinking about a combination of Batching and Sub Flows as a solution, but one point is tripping me up on it... each "student" token has one label in particular that is important in decision making. If I batch the students into a "class" token, acquire an instructor, and then run a subflow which creates the number of tokens that are in the class, is there a way to hold onto those original label values on the "student" tokens through the batching process and then pass it to the created tokens in the subflow?

0 Likes 0 ·
Braydn T avatar image Braydn T Aaron C commented ·

@Aaron C

Yes there is:

Un-Check the "Label Access on Parent Only" box and all the created tokens in the subflow will be able to access the parent token's labels.

You can also check the Copy Labels to Children on Create box.

0 Likes 0 ·
label-access.png (9.1 KiB)
Aaron C avatar image Aaron C Braydn T commented ·

Ah! Perfect! That in combination with aggregating labels to an array while batching is exactly what I needed! Thank you!

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.