getAttnProgram

getAttnProgram

This option was added in version 7.14.0.

Description

This option names a custom Profound.js module that returns the program to run when the pui.runAttnProgram() API is used to invoke an attention program.

If this option is not specified, the attention program is read from the IBM i user profile. Specifying it allows custom logic to determine the attention program, and also allows pui.runAttnProgram() to be used outside of an IBM i context.

The specified program is run via pjs.call() and receives a reference parameter to a character string, in which it returns the desired attention program name. An empty or blank string indicates that no attention program should be executed.

Example

Point the option at a module named getattn:

getAttnProgram: "getattn"

The module defines the reference parameter and assigns the program name into it:

modules/getattn.js
function getattn(attn_program) { // Bind the incoming reference parameter to a character field. pjs.define("attn_pgm", { type: "char", length: 1000, refParm: attn_program }); // Return the program name - an empty string means "no attention program". attn_pgm = getProgramName(); } exports.default = getattn;

For information on how to modify this setting, see Configuration File.