Provisioning / Concepts |
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.
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.