A Nikita session extends the native Node.js Events API. It provides a facility to listen to internal notification and know the current state of the program.
Listening to events with the Node.js API is quite simple with the
on(event, handler). The "handler" argument is the function provided by the user to catch events.
It is not recommended to call the
emit function directly but instead your are encouraged to call the
nikita.log function which will associate the "type" property with the event of the same name.
The existing events provide you with multiple entry points to catch information across the entire session life cycle:
It indicates execution directives which may occur at different steps of the action life cycle. it uses the "message" property as a code to define what is happening. The following values exists:
conditions_failed. The handler function is called with a
It is the default event when the function
logis called. The handler function is called with a
It is throw before an action is called if it contains the
It represents some stdin content, used for example by the
system.executeaction to provide the script being executed.
It represents content modification, used for example by the
It is emitted once an handler has completed, whether it failed or was successful, and before calling the callback.
It is a stream input reader receiving stdout content, used for example by the
system.executeaction to send stdout output from the executed command.
It is a stream input reader receiving stderr content, used for example by the
system.executeaction to send stderr output from the executed command.
It is throw if no error occured when no more action are scheduled for execution.
It is thrown when an error occurred.
The majority of the user handler is called with a single
log argument. It is an object with the following keys: