5.2 Extensibility in Backend Coding

This topic describes about the extensibility in backend coding.

For online forms, generated code does not provide any business logic. Insert statements won’t be present as part of generated code in online packages. Developer has to write the business logic in release specific packages (or make call l to server functions from release specific packages).

Hooks will be provided in the following stages Resolving reference numbers:
  • Checking mandatory fields
  • Defaulting and validating
  • Uploading to db
  • Process
  • Subsystem pickup
  • Enrich
  • Product Default
  • Query

Note:

The system generated code for uploading; defaulting etc. (fn_sys_default_and_validate, fn_sys_upload_db etc.) won’t be called by the main package in online flow. If it is required, developer has to call it explicitly from release specific packages.

In online flow, upload to base tables happens first and processing is done on the inserted data after uploading. After processing, the response type will be build.

Note that in online flow, upload to base tables happens first and processing is done on the inserted data after uploading. After processing, the response type will be build.

Figure 5-1 Flow of control in an Online main package



Release specific code has to be written in the Hook Packages generated. The different functions available in the Hook Package of an Online Form are:
  1. Skip Handler : Pr_Skip_Handler

    This can be used to skip the logic written in another release.

    Example: logic written in KERNEL release can be skipped in CLUSTER release

  2. Fn Main

    This is called form the fn_main in main package.

  3. Fn_pre_resolve_ref_numbers
  4. Fn_post_resolve_ref_numbers

    This function validates the reference number. It is called from fn_ resolve_ref_numbers of the main package.

  5. Fn_pre_unlock
  6. Fn_post_unlock

    This function holds the contract level validations and modification logic for existing contract. It is called from fn_unlock of main package.

  7. Fn_pre_check_mandatory
  8. Fn_post_check_mandatory

    Any mandatory checks can be validated here. It is called from fn_chchk_mandatory of main package.

  9. Fn_pre_query
  10. Fn_post_query

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

  11. Fn_pre_product_default
  12. Fn_post_product_default

    This function has the logic to default the values for the contract based on the product maintenance. It is called from fn_product_default of main package.

  13. Fn_pre_subsys_pickup
  14. Fn_post_subsys_pickup

    This function does the subsystem pickup for the subsystem’s (call form’s) as per product maintenance for the contract. It is called from fn_subsys_pickup of main package.

  15. Fn_pre_enrich
  16. Fn_post_enrich

    After product default, user can default others values. That logic can be put here. it is called from fn_enrich of main package.

  17. Fn_pre_default_and_validate
  18. 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.

  19. Fn_pre_upload_db
  20. Fn_post_upload_db

    Any logic while uploading data to tables can be written here. It is called from fn_upload_db of main package.

  21. Fn_pre_process
  22. Fn_post_process

    These hook functions are specific to transaction online form screens. This function should have the call to all the server functions which process the input data for the contract as per the functionality. These are called from fn_process of the main package.