question

Justin Brozzo avatar image
0 Likes"
Justin Brozzo asked Adrian Haws edited

Is it possible to "delete" and object or simply remove and object from a queue if an object is sent to a different queue.

I am trying to figure out the best way to remove and object from a queue or several queues when an object from a main line is sent to a reject queue... Is this possible?

Thanks!!!!

FlexSim 16.1.1
queuedestroy objectremovalqueue connection
· 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.

Jeff Nordgren avatar image Jeff Nordgren commented ·

Do you have a sample model you can send to show what you are trying to do? I'm having a hard time understanding exactly what it is you are after. How can a flowitem exist in a queue when it is sent to another queue (two places at once)?

I'm sure it can be done what you are wanting to do but a model would be helpful for specifics.

0 Likes 0 ·

1 Answer

Matt Long avatar image
0 Likes"
Matt Long answered Joerg Vogel commented

It sounds like you have flowitems that have associations with other flowitems in your model. When a flowitem is rejected, you want the other flowitems to leave their queues and also be rejected. As long as you have references all of the associated flowitems, then it's just a bit of code.

For example, you could put code into the OnEntry of your 'reject' queue that would remove the associated flowitems from their respective queues using:

moveobject(getlabel(item, "myPartner"), node("RejectQueue", model()));
or
destoyobject(getlabel(item, "myPartner"));

You could also do it in Process Flow by having an Event-Triggered Source listening to the OnEntry of the Queue and then doing a Move Object or Destroy Object activity for each of the associated flowitems.

If instead you know which item is moving, but not where he will be considered 'rejected', you can also use Process Flow to listen to the On Entering or On Exiting of your Flowitem. In this case you would create a token when the item you want to listen to is created. Then use a Wait For Event to listen to that flowitems entering or exiting events. You can even have the Wait for Event match to a specific object the flowitem is entering/exiting.


rejectpf.png (5.2 KiB)
rejectpf2.png (10.0 KiB)
· 3
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

@Matt Long Moving, deleting of objects especially flowitems is NOT recommended because the events still exists in the event handler. You have to delete the associated events to. You can try it on your own. Transport an item out of a rack before the dwell time is reached by an taskexecuter.

0 Likes 0 ·
Matt Long avatar image Matt Long Joerg Vogel commented ·

I wouldn't say it's not recommended. Process Flow has a Destroy Object and Move Object activity. Yes, for a Rack you may need to call destroyeventsofobject() if you're using a dwell time but this question was specifically asking about a queue. Other than when Batching, there are no issues with moving or destroying a flowitem in a Queue.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Matt Long commented ·

A queue might be a special case, but processor processing, conveyor, conveyor module, combiner, separator are creating future events, too.

0 Likes 0 ·