question

Jenny T avatar image
0 Likes"
Jenny T asked Regan Blackett answered

Un-batching and retaining token attributes

Hi, I am having a lot of trouble getting un-batching to work in process flow. Once I have batched a group of tokens I can't figure out how to un-batch them again and have the tokens retain all their attributes from before batching.

FlexSim 20.0.2
process flowbatching groupingunbatchingtokens in batch
5 |100000

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

Regan Blackett avatar image
1 Like"
Regan Blackett answered

It does not. You would need to use the Label Aggregation options at the bottom of the Batch properties and use the "Make Array" aggregation style.

Something like this:

Would yield this:

Just use your own label names in place of what's in the pictures. The "OldData" labels are just distribution values but this will work with whatever data you have. Also notice that the first element of each array is the data that came from the first token in the batch, which is also the token that remains after the Batch finishes.

You can then access the values with array accessing expressions like:

token.PreservedData[array_index]

As far as "Un-batching" goes, while there is no way to do this with the batch activity you could do it yourself with a Create Tokens Activity like this:

Based on the size of one of the Arrays, you could make that many tokens, and reassign their own data from the aggregation array, base don their creation rank.

Create the new tokens into a separate activity like a Start activity and Sink the original with all the Array data on it, like this:


aggproperties.png (26.3 KiB)
aggresults.png (50.6 KiB)
createnew.png (42.7 KiB)
actlayout.png (21.7 KiB)
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·

@Regan Blackett, the batch activity is also able to create tokens, if you set a greater number of tokens leaving the activity than entering. I am not sure if this is intentionally a valid option.

1 Like 1 ·
Regan Blackett avatar image Regan Blackett ♦ Joerg Vogel commented ·

@Jörg Vogel, Sure, you can use the Batch to create multiple tokens from one, that's an intended feature and if the point were to make more tokens then that would be a fine way to go. There isn't, however a good way to do the data preservation that Create Object allows. Which is what @Jenny T was specifically asking about.

2 Likes 2 ·
tannerp avatar image
1 Like"
tannerp answered tannerp converted comment to answer

If you're aggregating the tokens from many into one, then you can't un-batch that token without creating many new tokens.

If you're using a batch activity and the "release number" is the same as the "batch quantity", then the tokens will already "un-batch" and retain their original attributes upon release.

· 1
5 |100000

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

Jenny T avatar image Jenny T commented ·

Ah ok, I am turning a bunch of tokens into 1 token. Does the batch token store the original tokens data inside and can I access that data using flexscript?

Thanks

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.