services/tone_analyzer/v3.js
function(msg, config, node) {
    checkConfiguration(msg, node)
      .then(function(settings) {
        var options = toneutils.parseOptions(msg, config);
        options = toneutils.parseLanguage(msg, config, options);
        node.status({fill:'blue', shape:'dot', text:'requesting'});
        return invokeService(config, options, settings);
      })
      .then(function(data){
        node.status({})
        msg.response = data;
        node.send(msg);
        node.status({});
      })
      .catch(function(err){
        payloadutils.reportError(node,msg,err);
        node.send(msg);
      });
  }
function(msg, config, node) {
    checkConfiguration(msg, node)
      .then(function(settings) {
        var options = toneutils.parseOptions(msg, config);
        options = toneutils.parseLanguage(msg, config, options);
        node.status({fill:'blue', shape:'dot', text:'requesting'});
        return invokeService(config, options, settings);
      })
      .then(function(data){
        node.status({})
        msg.response = data;
        node.send(msg);
        node.status({});
      })
      .catch(function(err){
        payloadutils.reportError(node,msg,err);
        node.send(msg);
      });
  }
function ( msg , config , node ) { checkConfiguration ( msg , node ) . then ( function ( settings ) { var options = toneutils . parseOptions ( msg , config ) ; options = toneutils . parseLanguage ( msg , config , options ) ; node . status ( { fill : 'blue' , shape : 'dot' , text : 'requesting' } ) ; return invokeService ( config , options , settings ) ; } ) . then ( function ( data ) { node . status ( { } ) msg . response = data ; node . send ( msg ) ; node . status ( { } ) ; } ) . catch ( function ( err ) { payloadutils . reportError ( node , msg , err ) ; node . send ( msg ) ; } ) ; }
function when the node recieves input inside a flow. Configuration is first checked before the service is invoked.
function when the node recieves input inside a flow . Configuration is first checked before the service is invoked .