question

Ricard RH2 avatar image
0 Likes"
Ricard RH2 asked Mischa Spelt answered

Keep a label assigned to a split token after joining it

token-split-lable.fsm

I've found out that a lable assigned to a splitted token disappears after the token is joined again with its twin. I need to use that lable afterwards - is there any way to keep it in the joined token? Thanks a lot!

FlexSim 18.1.2
labelstokenssplitjoin
5 |100000

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

Roi Sánchez avatar image
0 Likes"
Roi Sánchez answered Ricard RH2 commented

@Ricard RH2, ok, stoken-split-label-v3.fsmo in this case what you have to do is to connect the branch in which the 'split' label is assigned to the first port of the join activity because it destroys all the input tokens enter from the port 2, 3, etc. so that´s why the 'split' label dissapears.

If you would need to combine the data contained in labels from token entering in different ports, you should consider usind the Batch activity.

I send you the model again with this change made.


· 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.

Ricard RH2 avatar image Ricard RH2 commented ·

It's working now, thanks a lot!

0 Likes 0 ·
Mischa Spelt avatar image
0 Likes"
Mischa Spelt answered

An alternative option is making all the other tokens write labels on the token that will stay alive after the Join. A somewhat elegant way to do that, is to make the Split activity create the additional tokens as child tokens of the original token and let them write to their parent's labels -- either by checking "Label Access on Parent Only" or by making sure all the labels you want to keep already exist before entering the Split activity and choosing Read / Write Parent Label Access.

Alternatively, you can not allow implicit label access to the parent, but still create the additional tokens as child tokens and then explicitly write labels to token.parent instead of token when you want to keep them after the Join.


ricardrh2-split.png (243.4 KiB)
5 |100000

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

Roi Sánchez avatar image
0 Likes"
Roi Sánchez answered Ricard RH2 commented

Hello @Ricard RH2,

What it is happenning is that the 'split' label is only assigned to one of the two token after the split. What you could do is to assign it before the Split activity so as not to miss this label when the split is done or assigned it to both of them.token-split-label-v2.fsm You will see this in the attached model.


· 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.

Ricard RH2 avatar image Ricard RH2 commented ·

token-split-lable-v2.fsm

Hi @Roi Sánchez,

Thanks for your time. Please find attached the model again, this time more similar to the current model I'm working on. Tasks in paralel have to be done in the right branch of the model independently of the decide activity before the lable assignment, that could take some time.

This is why I need to assign that lable after the split activity.

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.