Type
Event handler
Available from
Purpose
Returns an event to the calling application. Can be used to propagate an event caught in a module to the calling application, or may be used to throw a different event back to the calling application.
Behavior
Following is an example for when to use the Return Event item, in collaboration with the Exit item.
- Catch (event="myEvent"), Return Event. In this scenario, when the "myEvent" event is caught, the module will exit, returning control back to the calling application, and it will return the "myEvent" that was caught.
- In other words, it propagates or re-throws the event to let the calling application handle the event.
- Catch (event="error.runtime"), Return Event, Throw (event="myReallyBadEvent", message="Something happened..."). In this scenario, the application catches an "error.runtime" event and the module will exit returning control back to the calling application.
- Instead of propagating the "error.runtime" event, however, it returns "myReallyBadEvent" instead, with the message "Something happened...". The calling application can catch the "myReallyBadEvent" event, but does not know that the cause of the event was an "error.runtime" event.
- Catch ("error.badfetch"), Exit. In this case, the application catches an "error.badfetch" event and then exits the application. Exiting the application will essentially disconnect the caller and terminate the session.
- It does not matter if it is a module or a stand-alone application, the application will end. This is typically used when there is some fatal error with the application or system.
Properties
- Threshold - A variable that must have a positive integer value.
- This field is available only when the Throw item is placed in an event handler or a node. This field is not available when the Throw item is placed in a Link item.
- This property is used to disable the Throw item until this value is met. For example, if the Threshold property is set to 3, the system ignores the Throw item the first two times the specified event is encountered. Only the third time that the event is encountered does the system actually throw the event.