trigger preRequest

System trigger for handling any global pre-processing, such as verifying the environment or user permissions.

Declaration:

trigger preRequest

Applies to:

Application Shell

Activation:

Activated before the preActivate trigger and activation of the requested operation

Default behavior:

Executes done

Behavior upon completion:

If the trigger returns a positive value in $status, the preActivate trigger is activated, followed by the requested operation. Otherwise:

  • If the trigger returns -21 in $status, the requested operation is not activated. In a web environment, the WRD will respond with a Authorization failure.
  • If the trigger returns less then zero in $status, the requested operation is not activated. In a web environment, the WRD will not respond with a specific error.

Description

The preRequest trigger allows global pre-processing to be centralized in a single trigger. Generic ProcScript should be placed in this trigger, rather than duplicated in each component. Typical uses of this trigger include environment verification, such as checking user rights or permissions, log file or audit file record keeping.

This trigger is fired as part of every web request made by the Web Request Dispatcher (WRD). The SOAp Request Dispacher (SRd) and other types of call-in do not fire this trigger.

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