question

Yasmin Tavore avatar image
0 Likes"
Yasmin Tavore asked Yasmin Tavore answered

How to get token's labels on a subflow using Statistics Collector?

I'm working on a model that frequentely uses subflow and lists to simulate subprocess of one single product. This product has a label to reference its SKU that I'm using as value the token id. I intend to use this value as rows of my table in statistics collector, so I will be able to evaluate the process times of every SKU.

Happens that my statistic collector is not able to get the SKU value, and returns "Invalid ID" as value. I attached a simple model to represents what's the problem to be solved.

It's important to say that I wish to use the SKUs as rows in and out the subflow and list, so I could visualize all process as one.

StatisticsCollector_Example.fsm

FlexSim 21.1.4
labelsstatistics collectorflexsim 21.1.4child tokens
5 |100000

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

Eric M avatar image
1 Like"
Eric M answered

Hi @Yasmin Tavore, I changed the value of the assign labels activity to token.id which gets the actual token id number instead of a reference to the token node. This makes it so the value actually makes sense to the stats collector. There were a couple changes in the Stats Collector that I made as well. For the Row Value(s) section, add a ".value" at the end of the data.token.labels["SKU"] or simply replace it all by data.token.SKU (I did this both ways so you can see how either would work).

In the columns tab, I changed the Initial Time columns to be Event driven as opposed to Row Add driven and checked the boxes at the bottom so they are triggered by the correct event. Without this change, both columns recorded the same time, which is when the row was created. Changing it to be updated by the events gives you the time the event actually fires. Here's a pretty cool article that helps explain things a little more in depth if you're interested.

statisticscollector-example_1.fsm


5 |100000

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

Yasmin Tavore avatar image
0 Likes"
Yasmin Tavore answered

Hi, @Eric M! Perfect! That's works too.

After some attempts I found out other way to do it. We can set RowValue as data.token.labels["SKU"].value.as(Token).id and it works too. A the column tab I did the same.Thanks!

5 |100000

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