services/dialog/v1.js
function performDelete(node,dialog,msg, config) {
    var params = {};
    var message = '';
    node.status({fill:'blue', shape:'dot', text:'requesting delete of a dialog instance'}); 

    if (!config.dialog || '' != config.dialog) {
    
      params.dialog_id = config.dialog;

      dialog.deleteDialog(params, function(err, dialog_data){
          node.status({});
          if (!err) {
              message='Dialog deleted successfully';
              msg.dialog = dialog_data;     
              msg.payload = message;
              node.send(msg);
          } else if (err && err.code==404) {
              message='Dialog already deleted or not existing (404)';
              node.status({fill:'green', shape:'dot', text:message});      
              msg.payload = message;
              console.log(err);
              node.error(message, msg);
          } else {
              node.status({fill:'red', shape:'ring', text:'call to dialog service failed'}); 
              node.error(err, msg);
              console.log(err);
          }
      });  
    } else {
      message = 'Dialog Id not specified';
      node.status({fill:'red', shape:'ring', text:message});    
      node.error(errmessage, msg); 
    }   
  }
function performDelete(node,dialog,msg, config) {
    var params = {};
    var message = '';
    node.status({fill:'blue', shape:'dot', text:'requesting delete of a dialog instance'}); 

    if (!config.dialog || '' != config.dialog) {
    
      params.dialog_id = config.dialog;

      dialog.deleteDialog(params, function(err, dialog_data){
          node.status({});
          if (!err) {
              message='Dialog deleted successfully';
              msg.dialog = dialog_data;     
              msg.payload = message;
              node.send(msg);
          } else if (err && err.code==404) {
              message='Dialog already deleted or not existing (404)';
              node.status({fill:'green', shape:'dot', text:message});      
              msg.payload = message;
              console.log(err);
              node.error(message, msg);
          } else {
              node.status({fill:'red', shape:'ring', text:'call to dialog service failed'}); 
              node.error(err, msg);
              console.log(err);
          }
      });  
    } else {
      message = 'Dialog Id not specified';
      node.status({fill:'red', shape:'ring', text:message});    
      node.error(errmessage, msg); 
    }   
  }
function performDelete ( node , dialog , msg , config ) { var params = { } ; var message = '' ; node . status ( { fill : 'blue' , shape : 'dot' , text : 'requesting delete of a dialog instance' } ) ; if ( ! config . dialog || '' != config . dialog ) { params . dialog_id = config . dialog ; dialog . deleteDialog ( params , function ( err , dialog_data ) { node . status ( { } ) ; if ( ! err ) { message = 'Dialog deleted successfully' ; msg . dialog = dialog_data ; msg . payload = message ; node . send ( msg ) ; } else if ( err && err . code == 404 ) { message = 'Dialog already deleted or not existing (404)' ; node . status ( { fill : 'green' , shape : 'dot' , text : message } ) ; msg . payload = message ; console . log ( err ) ; node . error ( message , msg ) ; } else { node . status ( { fill : 'red' , shape : 'ring' , text : 'call to dialog service failed' } ) ; node . error ( err , msg ) ; console . log ( err ) ; } } ) ; } else { message = 'Dialog Id not specified' ; node . status ( { fill : 'red' , shape : 'ring' , text : message } ) ; node . error ( errmessage , msg ) ; } }
This function delete an existing dialog instance.
This function delete an existing dialog instance .