12.9 Processes and CSS Scripts

Any kind of process can be configured to use a CSS script instead of its original hard-coded functions. One simply sets the process type to SCRIPT and opens a script file in the script_file member of the process.

When the process is run, it checks to see if it should run the script instead. Note that if you are replacing a schedule process with a script, you have to replace the entire C_Code function. This code can be used verbatim in CSS, and an example is given in `css/include/script_proc.css'.

Note that the script is given transparent access to all of the members and member functions defined on the script object it is attached to. This allows one to mix existing hard-coded functions with script versions by simply calling the existing ones in some places, and calling new script-defined ones in other places.

Where possible, it is generally preferable to use a ScriptStat or ScriptProcess instead of replacing an entire existing process with a script. This will tend to be simpler and a more modular solution.