question

sumans avatar image
0 Likes"
sumans asked sumans answered

send the same number of flow items from source to two different queue

I have a source which generates demand (quantity) for 2 different items. Want to pass that same generated demand quantity to two different queue.

for example: Source generates a demand of 10 items of Product A and 5 items of Product B. Want to send 10 of A and 5 of B to both Queue1 & Queue2 at the same time.

FlexSim 24.1.0
queuesource
5 |100000

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

Adam C avatar image
1 Like"
Adam C answered

If you Queue2 gets an item every time Queue1 gets an item, you can add the following code to an OnEntry trigger on Queue 1. You will need to center connect Queue1 to Queue 2 for the code to work as is. You can also make changes to the item (labels, etc.) between copying the object and moving it if needed via storing the copied item to a variable named copy.


treenode copy = item.copy();
moveobject(copy,current.centerObjects[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.

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Jason Lightfoot edited

I'd suggest to use Process Flow. Either create the items there directly or use an Event-Triggered Source that reacts to items entering Queue1 and creates copies for Queue2.

The attached model uses an Object Process Flow linked to the queues. The logic in the Process Flow is run for each queue separately.

create-items-process-flow.fsm


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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Felix beat me to an answer, so adding as a comment.

Here's a similar example process that duplicates items created in a 3D source. Source 2 is a queue with a label 'otherSource' that points to the source generating items. It has an object process flow that listens to otherSource creation events and duplicates any item it creates.

DuplicateSourceItems.fsm

1 Like 1 ·
sumans avatar image
0 Likes"
sumans answered

Thanks to all 3 of you - Adam, Felix, Jason for your effort in answering and taking time out.
All of the solutions worked. :)

@Jason Lightfoot @Felix Möhlmann @Adam C

5 |100000

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