The Finish activity marks the end of a sub flow. The Finish activity essentially acts the same as a Sink in that it destroys tokens that enter it.
The Finish activity has a few additional functions depending on what kind of activity or event that triggered the sub flow to run:
executesubflow()
command to run a sub flow (some
picklist options use this command), the Finish activity can return a value when the sub
flow is finished being run such that double processTime =
executesubflow(processFlow);
will give you the value evaluated from the
Return Value box.Consider reading Sub Process Flows for more in-depth information.
Though Finish activities are generally thought of as the end of a sub flow, they are also
used to mark the end of a Will Override Return Value option
from the Wait For Event or
Event
Triggered Source activity or the end of an executesubflow()
command. In
both of these cases, one token will be used to execute a series of activities ending with a
Finish activity. Upon arriving at the Finish activity, the Return
Value box will be evaluated for the token and the result will be returned to the
calling function. There are picklists available through standard FlexSim objects that
execute sub flows in order to get return values for properties such as a processor's
Processing Time.
If the Finish marks the end of a sub flow, the Return Value will not be evaluated.
The Finish activity marks the end of a set of activities. No activity may be connected to a Finish.
The following image shows properties for the Finish activity:
Each of these properties will be explained in the following sections.
Used to change the name of the activity. See Name for more information about this property.
The Font button
opens a window to edit the activity's
background color and font properties. See
Font for more information
about this property.
The Statistics button
opens the activity's statistics
window. See Statistics
for more information about this property.
The Return Value property can be a static or dynamically-generated value. A return value can be anything you need it to be. For example, you could return a calculation based on data in a label on the token or you could return a reference to an object. See Overriding a Return Value for more information.
If checked, when a token is destroyed, any Shared Assets that are allocated by the token will be deallocated. This means, any resources that have been acquired by the token will be released and any entries or backorders on lists associated with the token will be deleted. If the token is in a zone, the zone will only update its content and not update any of its other statistics. If unchecked, the token will remain in the Finish activity until its shared assets have been deallocated.