@@ -364,7 +364,16 @@ botService.executeBots = function executeBots(botsId, reqBody, userName, executi
364364 var botId = null ;
365365 var botRemoteServerDetails = { } ;
366366 var bots = [ ] ;
367+ var taskId = 'xxxxxx' ;
368+ var cryptoConfig = appConfig . cryptoSettings ;
369+ var cryptography = new Cryptography ( cryptoConfig . algorithm , cryptoConfig . password ) ;
367370 logger . info ( "Entering WF" ) ;
371+ if ( reqBody . data ) {
372+ if ( reqBody . data . sysid ) {
373+ logger . info ( "SYS ID" , reqBody . data . sysid )
374+ taskId = reqBody . data . sysid
375+ }
376+ }
368377 async . waterfall ( [
369378 function ( next ) {
370379 botDao . getBotsByBotId ( botsId , next ) ;
@@ -417,6 +426,7 @@ botService.executeBots = function executeBots(botsId, reqBody, userName, executi
417426 encryptedParam ( reqBody , next ) ;
418427 } else {
419428 var error = new Error ( ) ;
429+ logger . error ( "task_id" + taskId + " BOTs Remote Engine is not configured or not in running mode" )
420430 error . message = 'BOTs Remote Engine is not configured or not in running mode' ;
421431 error . status = 403 ;
422432 //next(error, null);
@@ -428,6 +438,7 @@ botService.executeBots = function executeBots(botsId, reqBody, userName, executi
428438
429439 } else {
430440 var error = new Error ( ) ;
441+ logger . error ( "task_id" + taskId + " There is no record available in DB against BOT :" + botsId )
431442 error . message = 'There is no record available in DB against BOT : ' + botsId ;
432443 error . status = 403 ;
433444 next ( error , null ) ;
@@ -487,7 +498,7 @@ botService.executeBots = function executeBots(botsId, reqBody, userName, executi
487498 date : startHour ,
488499 } , { $inc : { "runningCount" : 1 } } , { upsert : true } , function ( err , data ) {
489500 if ( err ) logger . error ( JSON . stringify ( err ) )
490- else logger . info ( "Running count of bot " , botDetails [ 0 ] . name , "incremented successfully" )
501+ else logger . info ( "task_id" + taskId + " Running count of bot ", botDetails [ 0 ] . name , "incremented successfully" )
491502 } )
492503 auditTrailService . insertAuditTrail ( botDetails [ 0 ] , auditTrailObj , actionObj , next ) ;
493504 } ,
@@ -536,6 +547,7 @@ botService.executeBots = function executeBots(botsId, reqBody, userName, executi
536547 botDao . updateBotsDetail ( botId , botUpdateObj , callback ) ;
537548 } else {
538549 var err = new Error ( 'Invalid BOT Type' ) ;
550+ logger . error ( "task_id" + taskId + " Invalid BOT Type" )
539551 err . status = 400 ;
540552 err . msg = 'Invalid BOT Type' ;
541553 callback ( err , null ) ;
0 commit comments