question

Adam M5 avatar image
0 Likes"
Adam M5 asked Joerg Vogel commented

Assign two labels to one token

Assign labels to tokens from table.fsm


Good day and thank you for taking the time to look at my question.

I am trying to assign labels to tokens in process flow using the Assign Labels activity from a Global Table. No success so far as one attempt gave me some type of error code box at the bottom of the model and the second attempt assign the same serial number to all tokens.

How do I assign each rim serial number to each token? I also want to add a second label for diameter.

Thanks for your time!

FlexSim 22.2.0
process flowlabeltoken
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Joerg Vogel commented

Option 1:

Do what Jason suggested in your previous question and add as many rows to the source as there are in the global table, then copy the labels over.

1711112217677.png

Option 2:

When assigning labels directly in the Schedule Source activity, you have access to two keywords. rowNumber refers to the row of the source schedule the created token belongs to. tokenIndex denotes the how manyth token for the current row is being created. So you can use those to assign the first created token the values from the first row in the global table, the second token the second row values and so.

1711112523543.png



1711112217677.png (7.6 KiB)
1711112523543.png (27.6 KiB)
· 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.

Adam M5 avatar image Adam M5 commented ·
Felix...thank you for the insight and technique to add tokens at source creation.


Is it possible to use the "Assign Labels" activity once the tokens have been created and assign more than one label to the token?

It is not shown in this model right now but later on in the design these tokens will have to have additional labels added to them as they progress through the process.


0 Likes 0 ·
Adam M5 avatar image Adam M5 commented ·

Here is a quick example of the error that I get when I try to replicate the label creation in the Source activity but applied to the Assign Label activity:

1711121100170.png


1711121116154.png


Thanks!


0 Likes 0 ·
1711121100170.png (39.1 KiB)
1711121116154.png (74.7 KiB)
Felix Möhlmann avatar image Felix Möhlmann Adam M5 commented ·

As I wrote, tokenIndex and rowNumber and only available when assigning labels in the Schedule Source.

What you could do instead is to store the table row the token will use in future when creating it. Then using that in the Assign Labels activity.

1711121748806.png

0 Likes 0 ·
1711121748806.png (32.5 KiB)
Joerg Vogel avatar image Joerg Vogel Adam M5 commented ·
hi, @Adam M5, tokenIndex is a local variable from source code editor of Source activity. You have to assign the value of tokenIndex to a label in Source activity itself. Then you can later get access to this value again.
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.