Issue with label at combiner not update new label in On Exit trigger

Issue with label at combiner not update new label in On Exit trigger

howy3508
Not applicable
33 Views
13 Replies
Message 1 of 14

Issue with label at combiner not update new label in On Exit trigger

howy3508
Not applicable

[ FlexSim 24.0.2 ]

I want the combiner to combine Type 1 and Type 2 box and then assign new label of Type = Type 5 and ItemName = Product 5.

1715115081986.png

I used On Exit trigger on the combiner but it doesn't update the box's label.


Issue - Combiner cannot replace previous label.fsm

0 Likes
Accepted solutions (1)
34 Views
13 Replies
Replies (13)
Message 2 of 14

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

You need to put "Product5" in quotation marks since it is a string.

0 Likes
Message 3 of 14

howy3508
Not applicable

@Jason Lightfoot

It worked when the box is in Queue9. However, the ItemName label changes from Product5 to Product1when the box moves from Queue9 to QueueIn2.

Here are the Set Label on the Queue9's On Entry trigger:

1715143312449.png


Queue9 label on box:

1715143388003.png

QueueIn2 label on box:

1715143507571.png


I even added the code to Combiner to delete all labels on exit trigger but still has issue.

  1. item.attrs.labels.subnodes.clear();
    1. Delete label on exit trigger? - FlexSim Community

Issue - Combiner cannot replace previous label V0.fsm

0 Likes
Message 4 of 14

moehlmann_fe
Observer
Observer
When the items re-enter QueueIn2, the Process Flow that reacts to this assigns them new values. Add a Decide activity in the Process Flow so that items are only assigned values if they don't already have them.
0 Likes
Message 5 of 14

howy3508
Not applicable

@Felix Möhlmann


I have added a conditional decide in the process flow but it doesn't seems to work.

1715174691248.png

Issue - Combiner cannot replace previous label V1.fsm

0 Likes
Message 6 of 14

moehlmann_fe
Observer
Observer

You need to check if the item has the label ("token.Item.ItemName"). The check should also happen before any other label is assigned to the token. If the item already has labels, copy them to the token, so it still has access to them.

capture1.png

The "row" label is currently missing from the combiner output. And I saw that in "Assign Labels: Get Table Data" and "More Steps" you use the actual name of the item instead of the label. If you want to keep this, the name of the item also has to be updated.

0 Likes
Message 7 of 14

howy3508
Not applicable

I have updated the "ItemName" check in the conditional decide.

1715176913436.png

It looks like there is an issue to assign the box's "ItemName" back to the token. It cannot use "ItemName" to look up the "row" and "destination" from the global table.

1715178415724.png


1715177981543.png


Wouldn't the "token.Item.name" will reference to the box's "ItemName" when it's assign to the token? How should I fix this?

Basically, I want to combine the Product1 and Product2 box and it become Product5. When Product5 goes from Queue9 to QueueIn2, I want to use the new ItemName (Product5) to look up the "row" and "destination" from the Process Flow side.

Issue - Combiner cannot replace previous label V2.fsm

0 Likes
Message 8 of 14

moehlmann_fe
Observer
Observer

Just an with the check, when assigning "ItemName" to the token you have to use the label on the item.

1715179767936.png

And "token.Item.name" is the name of the object "Item". "token.ItemName" is the label "ItemName" on the token. These two are different and not interchangable.

0 Likes
Message 9 of 14

howy3508
Not applicable

For "Assign Labels: Get Table Data" and "More Steps", should I use the actual name of the item (Item.name) or the label (Item.ItemName)?

1715181184457.png

1715181266109.png

For the product5, if I want to use the actual name, can I match the actual name to the latest "ItemName"?

Issue - Combiner cannot replace previous label V3.fsm

0 Likes
Message 10 of 14

moehlmann_fe
Observer
Observer
Personally I'd use the label, but I don't see a reason why the name wouldn't work.

You can of course always change the name according to the label.

Either in a code snippet in a trigger (item.name = item.ItemName) or in a Custom Code activity (token.Item.name = token.Item.ItemName).

0 Likes
Message 11 of 14

howy3508
Not applicable

Let's stick with only using the label as ItemName.

Under the Decide (Has ItemName?) port #2's Assign Labels: Get Table Data (Assign Label).: Get Table Data, I updated "token.Item.name" to "token.Item.ItemName".

1715203903755.png


Under the Decide (Has ItemName?) port #1's Assign Labels: Get Table Data (Assign Label), I updated "token.Item.name" to "token.Item.ItemName".

1715203999939.png

Under More Steps (Decide), I updated the "== token.Item.name" to "== token.Item.ItemName" in More Steps (Decide) in the process flow.

1715203662019.png

I am getting this error.

1715204157854.png


But then, it seems to work if I keep the "token.Item.name" and not update it to "token.Item.ItemName" under the Decide(Has ItemName?) port #2's Assign Labels: Get Table Data.


1715204259463.png


I am a little confused when the token gets assign the "name" and why I cannot use all ItemName as label everywhere in the token.

Issue - Combiner cannot replace previous label V3.fsm

0 Likes
Message 12 of 14

moehlmann_fe
Observer
Observer

The token enters that activity because it does not have the "ItemName" label yet. Here you can't use the label to get the row to then get the label value. I missed that when saying that either would work.

That said, you can avoid even needing to assign the "ItemName" label in Process Flow if you do it directly in the source.

1715205277009.png

0 Likes
Message 13 of 14

howy3508
Not applicable

This seems to be more stright forward this way by assign label as ItemName in the 3D Source.


I updated the flow to reflect this change but the box keeps going back and fore between the queue and the processor and doesn't move on to the next row + Destination.

1715209758723.png

I want to add back the latest row# from the process flow back to the 3D side.

Issue - Combiner cannot replace previous label V4.fsm

0 Likes
Message 14 of 14

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Howard, was one of Howard's or Jason Lightfoot's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes