Including Your Routines in the Reorganization Process

If you want to run your own routines prior to and following a database reorganization, or in the event of a reorganization failure, use database reorganization hooks so that Builder can process your own specific routines.

Database reorganization hooks are subroutine calls provided by Builder that enable you to enter your own logic. These empty subroutines are provided after the data declaration in the Generate and Configure WFL. (Programming interface guidelines are included as comments in the User Interface area near the beginning of these WFLs.)

Each of these hooks has room for approximately 1500 lines of user code. You can also use the $INCLUDE facility to reference external code.

Note: You need to reinstate your own code if a Generate WFL or Configure WFL IC, or a new Agile Business Suite Software release is installed.

The following subroutines are provided:

DBHOOKBEGIN

DBHOOKBEGIN is performed after all compilations are completed, and when it is determined that a reorganization is required.

DBHOOKREORGFAIL1

DBHOOKREORGFAIL1 is called when the final online reorganization has failed during setup, or when an offline reorganization has failed.

You can set the supplied parameter string to OK to bypass a wait for operator input following the subroutine call. The WFL logic then attempts to restart the reorganization. Enter your own logic in this subroutine if the reorganization is not to be restarted.

DBHOOKREORGFAIL2

DBHOOKREORGFAIL2 is called if an online reorganization fails after its setup phase, and the reorganization is restartable.

When a failure is detected at this point, you are prompted for a restart reply. You can set the supplied parameter string to YES to bypass a wait for operator input following the subroutine call. If the string parameter (or an Accept reply to a NO parameter string) is YES, the WFL logic then attempts to restart the reorganization. If not, the WFL restores the original Agile Business Suite files in preparation for you to reload the database from backup.

DBHOOKREORGFAIL3

DBHOOKREORGFAIL3 is called if an online reorganization fails after its setup phase, and the reorganization is not restartable. When a failure is detected at this point, you are prompted for a restart reply. You can set the supplied parameter string to YES to bypass a wait for operator input following the subroutine call.

If the string parameter (or an Accept reply to a NO parameter string) is YES, the WFL logic then terminates. If not, the WFL restores the original Agile Business Suite files in preparation for you to reload the database from backup, and it then terminates.

DBHOOKRDBFAIL

DBHOOKRDBFAIL is called after a reorganization in the secondary database has failed. To bypass a wait for operator input following the subroutine call, you can set the supplied parameter string to a non-empty string value. The WFL logic then continues to generate. Enter your own logic in this subroutine so that the WFL is aborted if the build is not to continue.

DBHOOKEND

DBHOOKEND is called after all reorganizations have successfully completed, before the remainder of the build process.