trigger postRequest

System trigger for handling any global post processing, such as closing a database or writing a log file.

Declaration: trigger postRequest
Applies to: Application Shell
Activation: Activated in after activation of the requested operation and the postActivate trigger. It is only activated if the preRequest trigger returns a positive value in $status.
Default behavior: Executes done.
Behavior upon completion: Setting $status has no effect on subsequent trigger processing.

Description

The postRequest trigger allows global post-processing to be centralized in a single trigger. Generic ProcScript should be placed in this trigger, rather than being duplicated in all the components.

Typical tasks that could be performed in this trigger include using a close ProcScript statement to close the connection with any open databases, appending log records to a log file, or writing the contents of the message frame to the $webinfo output buffer to aid debugging.

The activation sequence of the preRequest, postRequest, preActivateand postActivate triggers in a web environment is shown in the following table:

Web-Specific Trigger Activation Sequence
preRequest return status preActivate return status exec or other operation postActivate postRequest WRD status
$status = -21 Not executed Not executed Not executed Not executed -21
$status < 0 Not executed Not executed Not executed Not executed 0
$status >= 0 $status = -21 Not executed Not executed Executed -21
$status >= 0 $status < 0 Not executed Not executed Executed 0
$status >= 0 $status >= 0 Executed Executed Executed 0

Triggers and operations are activated from left to right, depending on the $status returned by previous triggers.

Related Topics