When Itemtype exits, it repleneshes with the same item type?

When Itemtype exits, it repleneshes with the same item type?

bryan_suharik
Not applicable
15 Views
8 Replies
Message 1 of 9

When Itemtype exits, it repleneshes with the same item type?

bryan_suharik
Not applicable

[ FlexSim 16.2.2 ]

Hello, i'm searching for a simple solution via scipt to replenish a queue when an itemtype exits. It needs to replenish with the same itemtype that left the Queue.

Queue 1 has a "do not release" send to port as i don't want it to release until an item type leaves queue 2. But there are 5 different item types, so i don't want the pull to just pull the next in line item type from queue 1.

I've tried with the exit triggers to activate the pull requirement. But i can't figure out how the pull requirement can determine what itemtype just left Queue2 and call that one. Perhaps the sendmessage to Queue 1 from Queue 2 would be a good strategy, but i don't know how that would look via code.

QUEUE 1 ---> QUEUE 2 (leaving queue)

My entire model is built from GUI script on opening, so code solution is most desired.

Thanks in advance!!

0 Likes
Accepted solutions (1)
16 Views
8 Replies
Replies (8)
Message 2 of 9

sam_stubbsYXX86
Community Manager
Community Manager
Accepted solution

One option, rather than use a script, is to use Process Flow. Have all of your items be pushed to a list, instead of flowing straight into the queue. Then have an event triggered source in your Process Flow, each time the trigger happens you can pull from the list and use a query to match the item type to the one that left.

Here's a quick example I created:

replenishitemtype.fsm

Message 3 of 9

bryan_suharik
Not applicable
@Sam Stubbs

Hi Sam, thanks for all the help with this model. I've worked on it last couple days since your last recommendation and haven't made much progress. I attached the model.

What i need is for each Queue (wellsite 1,2,3,4,etc) to have that same process flow thats on wellsite 1. But i can't manually assign it to each one because the amount of wellsites is user defined by the GUI at the model setup. So i need a way to build a process flow like you've done in the attached, but then assign it to all of the wellsites upon creation if that makes sense.

THanks!

Bryan

0 Likes
Message 4 of 9

sam_stubbsYXX86
Community Manager
Community Manager

Could you not have the process Flow be a Fixed Resource process Flow instead of a General one? Then just attach the desired objects (in this case the Well Site queues). In the Event Triggered source you can then just write "current" for the triggering object. Then it should run this process flow for each Well.

Alternatively, you could add the Well Site to a group, and then just reference the Group in the triggered object too.

0 Likes
Message 5 of 9

bryan_suharik
Not applicable

@Sam Stubbs

That sounds like a good option. I'll see if i can get that to work.

Thanks!

0 Likes
Message 6 of 9

bryan_suharik
Not applicable

@Sam Stubbs

Hi Sam, Can't seem to get it. Does the fixedresource process flow behave differently than a general process flow. I get quite a few errors when i run it. I have a feeling i'm close and it just needs a simple modification if you can help. Thanks! I attached a basic example just to get it work, then i can try to convert it to the more complicated model.

test.fsm

0 Likes
Message 7 of 9

sam_stubbsYXX86
Community Manager
Community Manager

Yes they are different in some ways. First of all you need to attach objects to a FR Process Flow. This process flow will then create an instance of itself for each attached object.

I've reattached your previous model with this change so you can see the difference. IN the event triggered source I just reference which Well Site with 'current' since I've attached each Well Site Queue to the Process Flow.

bryansuharik.fsm

0 Likes
Message 8 of 9

bryan_suharik
Not applicable

@Sam Stubbs

but is there a way to attach the queues on trigger or set up of model automatically. The user builds the amount of wellsites on set-up, and it can't be a manual task to go in and attach the queues to that fixed process flow.

0 Likes
Message 9 of 9

sam_stubbsYXX86
Community Manager
Community Manager

If you need to add them dynamically, then you should go with the other solution, to add the Well Sites to a group. And keep the general Process Flow but reference the group members instead of each individual object.

4820-groupobjects.png

Then you can add and remove group members dynamically.

bryansuharik.fsm