How to batch tokens but combine all labels from both inputs

How to batch tokens but combine all labels from both inputs

patrickABAWF
Collaborator Collaborator
176 Views
6 Replies
Message 1 of 7

How to batch tokens but combine all labels from both inputs

patrickABAWF
Collaborator
Collaborator

[ FlexSim 20.2.3 ]

I have multiple Sources in a ProcessFlow that create tokens with different labels on them.

Eventually in the process, those tokens are Batched (Groupby one of the labels).

That works well BUT the resulting token only contains the labels from the left input of the Batch.

Is there a way to automatically create (on the outgoing token) the labels that were on the token from the right input of the Batch as well as the left?

I'm not taking about aggregation as I don't want to do a calculation. I just want to have all the labels from the incoming tokens on the outgoing token.

Is that possible?

0 Likes
Accepted solutions (1)
177 Views
6 Replies
Replies (6)
Message 2 of 7

patrickABAWF
Collaborator
Collaborator

I found a different approach by placing my info in a Global Table instead of a Source and then create labels and copy all table info to those labels.

It's not elegant but it works.

So my question is: Was there a way to do it automatically with Batch or Join as described above that I might have missed?

Thanks,

0 Likes
Message 3 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

I can't see a standard way for doing this.

As Matt has mentioned in another post, accessing by rank is not strictly supported - but in the absense of being able to get an array of token labels, and with the caveat that it might break in the future and in will not work (as-is) with parent labels here's an example using the release Quantity field to merge the labels.

BatchMergesLabels.fsm

0 Likes
Message 4 of 7

patrickABAWF
Collaborator
Collaborator

Thanks Jason. I see it's saved in 2021. I will try it when I install 2021 which I haven't had time to do yet as I'm in a big rush to finish this project for this week. I will use the alternate method I found above which will not cause problems in the future for my customer who will be using this model. Thanks a lot.

0 Likes
Message 5 of 7

jason_lightfootVL7B4
Autodesk
Autodesk

Ah - sorry. Here you go.

20.2_BatchMergeLabels.fsm

Message 6 of 7

patrickABAWF
Collaborator
Collaborator

That works great. Thanks Jason. However, since you indicated that this might not be "future proof", I don't think I will use this in a model that my customer will be using in the future.

0 Likes
Message 7 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
Perhaps there should be an option on the batch to keep distinct labels and use the aggregation method for duplicates.
0 Likes