Here are 3 ways to do this with a single Create Object activity.
Create_For_Each_Queue_In_Group.fsm
1. Gray Queues - In the Source the Quantity is set to Group("Container").length so that it creates one token per queue in the group. Then I add a Queue label to the created tokens with a value of Group("Container")[tokenIndex]. Now we have a token for each queue with a Queue label that points at that queue. In the Create Object we can now just create one box in token.Queue.
2. Red Queues - The source creates a single token and then the Run Sub Flow creates a new token for each queue in the group and sends it to the sub flow. We do this by setting the Quantity in the Run Sub Flow to Group("Container2").length and adding a Queue label to the created tokens with a value of Group("Container2")[creationRank]. In the Create Object we can again just create one box in token.Queue.
3. Blue Queues - I created a new Object process flow and named it Blue Queue. Then I attached this flow to all the blue queues. The process flow is super simple. The Source creates a single token and the Create Object activity creates a single box in current which is the object attached to the flow. This works because the flow makes a separate instance of the flow for each attached object which you can refer to as current.
The great thing about any of these methods is that you can copy and paste (or even delete) any of these queues and the flows will automatically handle the extra queue.
Matthew Gillespie
FlexSim Software Developer