function getOutsideListener(eventName, targetId) {
  return (...args) => {
    system.stdout.writeLine(`<event>${JSON.stringify({ target: targetId, type: eventName, args })}`);
  };
}
Returns a function that will notify to node that an event have been triggered

@param eventName
@param targetId
@returns {Function}