question

Stan Davis avatar image
1 Like"
Stan Davis asked Matt Long commented

How to use an Event-Triggered Source with a BasicFR

Instead creating a token and then using the Wait For Event activity to listen for a BasicFR's OnEntry event, I am trying to implement an Event-Triggered Source to generate the token. However, I don't see how to call the receiveitem() function that is required for the BasicFR. The Wait For Event activity can call receiveitem() using the OnListenerInitialized trigger. I don't see the same capability with the Event-Triggered Source. I've tried to call receiveitem immediately afterwards as a Custom Code activity, but that did not work. Thanks.

FlexSim 16.2.0
basicfr event-triggered source
5 |100000

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

Matt Long avatar image
1 Like"
Matt Long answered Matt Long commented

Unlike the Wait for Event, the Event-Triggered Source adds its listeners on reset, so there is no OnListenerInitialized trigger. Take a look at the Fixed Resource Queue template (when creating a new Process Flow object). This template is based off of a BasicFR object but recreates the logic of a standard Queue.

The Process Flow for this Queue uses an Event-Triggered Source to listen to the On Entry of the Queue. In order to receive an item, there is a set of three activities that calls receiveitem() when the model starts.


receiveitem.png (19.2 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.

Stan Davis avatar image Stan Davis commented ·

@Matt Long I have been trying to understand what is happening first, OnEntry or receiveitem(). So the 'Receive Item at Model Start' activity group is called at model start and tells the BasicFR to receive its next item (which will be its first item and which is not there yet). Having the receiveitem() already called, the BasicFR receives the first flow item when it does eventually arrive and raises the OnEntry event. Then the receiveitem() is subsequently called again to set the stage for the next flow item. If the receiveitem() is not subsequently called, the BasicFR could not receive any items beyond the first item. Do I have this right?? Thanks.

0 Likes 0 ·
Matt Long avatar image Matt Long Stan Davis commented ·

That's right. receiveitem() happens first, then OnEntry. To receive items after the initial/first item, you'll notice in the 'Queue Items' section, the 3rd activity is a Receive Next Item.

1 Like 1 ·
Kari Payton avatar image
0 Likes"
Kari Payton answered Stan Davis commented

Hi @Stan Davis

I find that this only works when you use a 'Move Object' command to move an object to the FR. basicfr.fsm See model attached for details.


basicfr.fsm (21.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.

Kari Payton avatar image Kari Payton commented ·

@Stan Davis does this solve your problem?

1 Like 1 ·
Stan Davis avatar image Stan Davis commented ·

Thanks Kari. I appreciate the time you took to create the model. Very helpful.

0 Likes 0 ·
Stan Davis avatar image Stan Davis commented ·

I now see how the 'Move Object' is taking care of the receiveitem() for the BasicFR, but it does require additional 'upstream' activities to make it happen which I was trying to avoid. I will continue to evaluate. Thanks again!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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