Module

RMP_ListenerComponent

Methods

# inner getListenerUrl() → {string}

Returns the configuration URL of the listener component.
string

# inner getName() → {string}

Returns the ID of the listener component as a string.
string

# inner getType() → {string}

Returns the type of the component (RMP_ListenerComponent).
string

# inner onApplicationClosed(input, options, events)

Applies to processes only: Triggers the execution of a process just before closing the web interface.
Parameters:

# inner onApplicationClosed(input, options, successCallback, failureCallback)

Applies to composite APIs only: Triggers the execution of a composite API just before closing the web interface.
Parameters:
Name Type Description
input object Input parameters (WI variables)
options module:RMP_ListenerComponent~ListenerOptions
successCallback module:RMP_ListenerComponent~successCallback
failureCallback module:RMP_ListenerComponent~failureCallback

# inner onListenedVarsChanged(input, options, events)

Applies to processes only: Triggers the process listener when one of the specified variables is changed.
Parameters:

# inner onListenedVarsChanged(input, options, successCallback, failureCallback)

Applies to composite APIs only: Triggers the composite API listener when one of the specified variables is changed.
Parameters:
Name Type Description
input object Input parameters (WI variables)
options module:RMP_ListenerComponent~ListenerOptions
successCallback module:RMP_ListenerComponent~successCallback
failureCallback module:RMP_ListenerComponent~failureCallback

# inner onScreenInitialized(input, options, events)

Applies to processes only: Triggers the execution of a process. Same as "trigger", but it is launched after the screen has been intialized.
Parameters:

# inner onScreenInitialized(input, options, successCallback, failureCallback)

Applies to composite APIs only: Triggers the execution of a composite API. Same as "trigger", but it is launched after the screen has been intialized.
Parameters:
Name Type Description
input object Input parameters (WI variables)
options module:RMP_ListenerComponent~ListenerOptions
successCallback module:RMP_ListenerComponent~successCallback
failureCallback module:RMP_ListenerComponent~failureCallback

# inner trigger(input, options, callBk, callBk)

Triggers the execution of a composite API or a process.
Parameters:
Name Type Description
input object Input parameters (WI variables)
options module:RMP_ListenerComponent~ListenerOptions Object specifying the options to be used during the call
callBk module:RMP_ListenerComponent~successCallback Callback function called in case of success
callBk module:RMP_ListenerComponent~failureCallback Callback function called in case of failure
Example
function ok(P_computed){
  alert(JSON.stringify(P_computed));
}

function ko(P_error){
  alert(JSON.stringify(P_error));
}

var input = {"input_1":"value_1","input_2":"value_2"};
// input could be: var input = RMPApplication.getAllVariablesValues();

var options = {"mode":"TEST","version":"7347","asynchronous":true};
// or simply var options = {}; to execute the composite API
in the mode and the version used by the current web interface

id_api.trigger(input,options,ok,ko);

Type Definitions

# failureCallback(P_error)

Callback called when the listener fails.
Parameters:
Name Type Description
P_error object Potential error generated during listener execution
RMP_ListenerComponent~ListenerOptions

# ListenerOptions

Listener options.
Properties:
Name Type Attributes Default Description
mode string <optional>
"TEST" Execution mode in which to launch the process or composite API
version string <optional>
Project version which contains the revision of the process or composite API to launch
listenedVars Array.<string> <optional>
Array of variables to listen to (only used with onListenedVarsChanged)
executeEvenEmpty boolean <optional>
false Indicates whether to call the listener even when a listened to variable is empty (only used with onListenedVarsChanged)

# ProcessEventsCallback(id, status, initial, internal, computed)

Callback called on one of the following events: waiting, completed, cancelled.
Parameters:
Name Type Description
id number ID of the launched process
status number Status of the process
initial object Initial parameters sent to the process (web interface variables)
internal object Internal parameters injected by the server, including errors (e.g. P_status, P_user)
computed object Computed variables returned by the process (input/output variables)

# successCallback(P_computed)

Callback called when the listener is completed.
Parameters:
Name Type Description
P_computed object Output of the listener