Adding 2 labels to a flow item

Adding 2 labels to a flow item

juan_s4
Not applicable
22 Views
2 Replies
Message 1 of 3

Adding 2 labels to a flow item

juan_s4
Not applicable

[ FlexSim 20.0.10 ]

In my complicated circular conveyor system, in my sources I have set labels by percentage at creation of my flow items. These percentages are very important and I would prefer not manipulate them within this source. Each label corresponds to a destination to where the flow item will eventually need to arrive on the conveyor system. After flow item creation I want to send a certain percentage of these flow items to an audit line. After audit the flow item needs to still have it's original label so that when the flow item is re-introduced onto the conveyor that it will then still end up at its correct destination as originally intended. Because the conveyor system is complicated and circular, I do not want this same item to go to audit twice. I am not sure if one can add 2 labels to a flow item in Flexsim then after audit to remove the 2nd label that is the "go to audit label".

0 Likes
Accepted solutions (1)
23 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Observer
Observer
Accepted solution

You can add as many labels as you want, as long as they have different names and also later remove them. If no pickoption is available to remove the label then use the expression below in a code snippet.

item.labels["labelName"].destroy()

Though generally it might be better to only change the value instead of removing the label. Because checking a value is slightly easier than checking if a label exists.

Here is an example model. 10% of items get a value of 1 in the "Audit" label. They are routed to Processor3. In its Process Finish trigger, the label is set to 0, so they are not routed to Processor3 again.

item-routing.fsm

0 Likes
Message 3 of 3

juan_s4
Not applicable
Thank you Felix. This worked well now after I implemented your suggestions & code snippet.
0 Likes