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

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

aaron_c
Not applicable
1,116 Views
4 Replies
Message 1 of 5

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

aaron_c
Not applicable

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?

0 Likes
Accepted solutions (1)
1,117 Views
4 Replies
Replies (4)
Message 2 of 5

braydn_t
Not applicable
Accepted solution

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.

20775-batch.png

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"

20776-subflow.png

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.

20778-wait-for-event.png

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

0 Likes
Message 3 of 5

aaron_c
Not applicable

@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
Message 4 of 5

braydn_t
Not applicable

@Aaron C

Yes there is:

20782-label-access.png

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
Message 5 of 5

aaron_c
Not applicable

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

0 Likes