Provisioning Implementation

When records in designated database tables are created or updated, BillMax looks for the existence of a related executable called a "hook" in the /usr/local/billmax/local directory named table_hook where table is the name of the database table. Presently the following tables are supported:

If the file is present, BillMax will load the environment with values taken from applicable records from one or more database tables and execute the script or program. No program arguments are passed to this process.

The environment variables passed are dependent on the record being processed. At a minimum the record being processed is passed. Its new variable values are passed in the form NEW_field, where field is the name of the applicable database column. For example, if a service is changed or created the variables passed would be NEW_number, NEW_state, NEW_price, etc.
Tip: To determine what variables are available, create an executable that prints out the environment. See Examine the Account Hook Environment as an example.

If the environment variable NEW is set to 0, the environment will also contain old values for the record being modified. These variables take the form of OLD_field. In this way, the launched process can determine what column data has changed and act accordingly. Note that the table_hook executable is not executed for every change during BillMax processing. Many changes may have no OSS related consequences (for example, a subscription renewal made during automated processing).

BillMax provides a service_hook-example file that provides a framework for examining variables to determine if provisioning is required and if so launches a Resource specific process to complete the provisioning.

In addition to passing the variables for the primary record being processed, BillMax also passes in the environment, where applicable, related record data. For the service record, the variables for the parent user and account records are also passed. These records take the form of ACCOUNT_field and USER_field respectively. These values may be useful to the provisioned system for identification or other purposes.

When the provisioning executable process is completed, BillMax examines the result code. If non zero, BillMax reverses any changes made to the record and displays command output of the process to the CSR if the activity is interactive or writes the messages to a log file if not.