question

SudheerReddy avatar image
1 Like"
SudheerReddy asked Walker huang commented

In Event listening activity, Doubt on Will Override Return Value option

As shown in below Image

In Override Processing Times Flow Chart, In activity Wait for Event: Process Time we checked Will Override Return Value. But we are not returning any return value in Wait for Event: Process Time to the processor in 3D model. In Finish and Override Process Time Return Value is token.processTime.

Here my question is the token which is returning the Return Value as token.processTime is in activity Finish and Override Process Time, in this activity we haven't specified where to return this return value. But still this is returning to processor.

Could some one please explain how this is happening. How this is working ?

FlexSim 20.0.0
wait for event
return-li.jpg (891.1 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.

1 Answer

Phil BoBo avatar image
4 Likes"
Phil BoBo answered Walker huang commented

This is working exactly how you said. When you check that box, the value returned from the finish activity is passed back to the event that spawned that token, as explained in the user manual about that checkbox:

"Will Override Return Value - The Wait For Event and Event Triggered Source activities have a Will Override Return Value property. This property allows the token to give a new return value to the event that was triggered. For example, overriding the Process Time event of a processor would allow you to perform steps using process flow to define the process time of that processor. The processor will ignore whatever value was originally returned in the Process Time box. When overriding a return value, the token will move through the defined set of activities until it hits a Finish activity where it will evaluate the return value for the event. (A return value might be data from a calculation, a new label value, etc.)"

https://docs.flexsim.com/en/20.0/Reference/ProcessFlowObjects/SubFlow/Finish/

That's a feature of those activities. It is working because those activities have code that does this.

· 4
5 |100000

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

SudheerReddy avatar image SudheerReddy commented ·

@phil.bobo thanks for your support. I have gone through the documents you attached. It clears most of my doubt. Following is the add on clarification please support me on this.

In following image the highlighted content says

Return Value box will be evaluated for the token and the result will be returned to the calling function. Here the calling function is Run Sub flow: Fast Time 1 in process flow. So it will be returning to Run Sub Flow? or to Processor in 3D model?

If the Finish marks the end of a sub flow, the Return Value will not be evaluated. If my understanding is correct all the Finish statements marks the end of sub flow? Then Return value will not be evaluated ?

0 Likes 0 ·
returnext.jpg (80.3 KiB)
Brandon Peterson avatar image Brandon Peterson ♦ SudheerReddy commented ·

In your model the "Return Value" is overriding the "Process Time" function for the Processor object. This is determined by the use of the "Will Override Return Value" option on the "Wait For Event" activity that is listening to the "Process Time" function of the 3D Processor.

If the "Will Override Return Value" option was not checked in your model then the final highlight in your question would be correct and the "Return Value" would not be evaluated for the sub flow.

I hope this clears things up for you, Brandon

2 Likes 2 ·
Walker huang avatar image Walker huang Brandon Peterson ♦ commented ·

great answer what I would like to know

1 Like 1 ·
Show more comments