Scripting in the Charge Rule API

A charge rule scripting Application Programming Interface (API) is available to users. Users write a JavaScript function that takes three parameters: a Parameters Object, a Hole Object and a Built-in Blast Product Object. The JavaScript function is called once for every hole the charge rule is applied to and is responsible for assigning a blast product for every part of the hole.

For example:

function rule(params, hole {

hole.fill(hole.upper(hole.length*0.5), params.stemming);

var explosiveInterval = hole.unallocated();

if (!hole.params.water_condition){

hole.fill(explosiveInterval, params.explosive);

}

else {

hole.fill(explosiveInterval, params.stemming);

}

}

The JavaScript function contains a series of sub-functions which are associated with object interfaces and included in the API for the user to use within the script. For a list of all the built-in functions and object interfaces, see the followings: