13 Extensibility in Backend Coding

This topic provides an overview of extensibility in back-end coding for the Hook Packages.

Release-specific code has to be written in the Hook Packages generated.

Functions in Hook Packages

Different functions available in the Hook Package of a Maintenance Form are:
  1. Skip Handler: Pr_Skip_Handler

    This can be used to skip the logic written in another release. For Example: logic written in KERNEL release can be skipped in CLUSTER release.

  2. Fn_post_bulid_type_structure

    If any change has to be made in the field values obtained from the form before the start of processing, code can be written here.

  3. Fn_pre_check_mandatory
  4. Fn_post_check_mandatory

    Any extra mandatory checks on the field values from the screen can be written here.

  5. Fn_pre_query
  6. Fn_post_query

    Any specific logic while querying can be written in these functions. It is called from fn_query of the main package.

  7. Fn_pre_upload_db
  8. Fn_post_upload_db

    Any logic while uploading data to tables can be written here.

  9. Fn_pre_default_and_validate
  10. Fn_post_default_and_validate

    Any release-specific logic for defaulting and validation can be written here. It is called from the fn_default_and_validate in the main package.

Flow of control through Hook packages

The flow of control through the Hook Packages for a particular stage is as explained in the figure below:

Figure 13-1 Flow of control through Hook Packages

Example: For Fn_check_mandatory, flow will be as:

STPKS_ STDCIFD_MAIN. Fn_Check_Mandatory, and then STPKS_ STDCIFD_CUSTOM.Fn_Pre_Check_Mandatory, and then STPKS_ STDCIFD_CLUSTER.Fn_Pre_Check_Mandatory, and then STPKS_ STDCIFD_KERNEL.Fn_Pre_Check_Mandatory, and then STPKS_ STDCIFD_MAIN .Fn_Sys_Check_Mandatory, and then STPKS_ STDCIFD_KERNEL.Fn_Check_Mandatory, and then STPKS_ STDCIFD_CLUSTER.Fn_Check_Mandatory, and then STPKS_ STDCIFD_CUSTOM.Fn_Check_Mandatory

By passing Base Release Functionality

There are auto-generated functions like FN_SKIP_<RELEAE_TYPE> which would determine whether or not a particular hook needs to be called.

The developer also has an option to bypass the base release hook if need be. For example, if the validations are written in STPKS_STDCINF _KERNEL, FN_PRE_CHECK_MANDATORY are not required or not suitable for the Cluster release, the system provides an option to bypass the code written by the Kernel team. Similarly, a Custom release can also bypass the code written by Kernel and Custom Releases. This can be achieved by calling procedures PR_SET_SKIP_<RELEASE_TYPE> and PR_SET_ACTIVATE_<RELEASETYPE>.

These procedures will be made available in the main package and the development teams of Customization teams can use these procedures to skip and re-activate the hooks of parent release. The Developer should avoid adding validations or Checks in the Pre Stage of any function, like Fn_Pre_Check_Mandatory, etc, and should aim to add all the validations in the Fn_Post_Default_and_Validate.

For Example: The flow for the Mandatory Stage for STDCIFD: