question

mary avatar image
0 Likes"
mary asked Jason Lightfoot commented

Pull item based on object assigned label

Hi I have a model where I am creating a label "a" in my processor1. whenever part a enter it has label ID1 the same should be assigned to the label present in Processor as "ID1" that I'm creating in process flow. next there are two buffer it should pull the parts with referring to label present in Processor i.e, "a" . If "a" has "ID1" pull to Queue1 and if "a" has "ID2" pull to Queue2.


sample1.fsm

FlexSim 20.0.10
labelobject
sample1.fsm (31.3 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.

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

The process flow in your model is doing nothing as far as I can tell - and even if you put ID1 and ID2 on the items (which your process flow needs) the effect is to acheive nothing.

Put the ID1 and ID2 labels on your items and have the queues pull those IDs under the pull requirement.

What you have is overcomplicated for what you seem to be trying to do.

· 6
5 |100000

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

Jacob W2 avatar image
0 Likes"
Jacob W2 answered Jason Lightfoot commented

Hi @mary,

If you want to have the value of the label "a" on your processor change based on the item ID label, you can add an on entry trigger that updates the label value on your processor to be the value of items ID label.

on-entry.jpg

With how you have set up your model, instead of having your queues pull the items, you can instead have the processor send the items to the correct queue. I wrote a small bit of code that checks the value of "a" and then sent the item to either port 1 or 2.

  1. if (current.a == "ID1"){
  2. return 1;
  3. }
  4. else if (current.a == "ID2"){
  5. return 2;
  6. }

If you wanted to have the items pushed to a list and then have the queues pull each item based on their ID label, it would be easier to just use the item ID and not worry about using a label on the processor. That could be done by adding a label field on the List called ID, and then adding a query that pulls items WHERE ID = "IDValue".


on-entry.jpg (9.9 KiB)
· 2
5 |100000

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