question

Manus K avatar image
0 Likes"
Manus K asked Sebastián Cañas commented

Referencing objects in group in subflow

I have a token with a label 'Group' referencing a specific group e.g. "Group1". Now I want to execute a subflow in which I create a token for each object within the group. Each of those tokens should carry a label 'Object' with a reference to a object in the group.

1. If I use token.Group.subnodes.length as Quantity in the Create Tokens activity I get a token for each object but one additional parent token for which I don't have any use. Is there a way not to carry the parent token through the subflow?

2. Object label

2.1 In another project I used Group("Group1")[x] but token.Group[x] does not seem to work. What's the right way to reference?

2.2 How do I defined the index 'x' in the correct way? In the other project I used [tokenIndex] but this seems to be a global index and not a 1,2,3,.. for each new set of tokens in the subflow.

FlexSim 23.2.3
process flowlabelssubflowgroups
· 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.

1 Answer

Sebastián Cañas avatar image
1 Like"
Sebastián Cañas answered Sebastián Cañas commented

Hi @Manus K ,
Assuming you have the reference for the group in a label Group, you could set the Run Sub Flow as the image below:

Perhaps you missed the expression creationRank that returns a numeric value. Here there is a short explanation:

When the [creationRank] part of the expression is evaluated for the first created child token, the creationRank will have a value of 1. When it is evaluated for the second created child token, creationRank will have a value of 2, and so forth.

· 4
5 |100000

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