vicinityManager/server/services/items/registration.js
/*
Creates audit logs for each registered item
*/
Creates audit logs for each registered item
Creates audit logs for each registered item
function createAuditLogs(cid, ids, adid){
  return new Promise(function(resolve, reject) {
    try{
      sync.forEachAll(ids,
        function(value, allresult, next, otherParams) { 
            creatingAudit(value, otherParams, function(value, result) {
                allresult.push({value: value, result: result});
                next();
            });
        },
        function(allresult){
          if(allresult.length === ids.length){ 
            resolve('Audits created...');
          }
        },
        false,
        {cid: cid, user: "Agent:" + adid, type: 41}
      );
    } catch(err){
      reject("Error creating audits: " + err);
    }
  });
}
function createAuditLogs ( cid , ids , adid ) { return new Promise ( function ( resolve , reject ) { try { sync . forEachAll ( ids , function ( value , allresult , next , otherParams ) { creatingAudit ( value , otherParams , function ( value , result ) { allresult . push ( { value : value , result : result } ) ; next ( ) ; } ) ; } , function ( allresult ) { if ( allresult . length === ids . length ) { resolve ( 'Audits created...' ) ; } } , false , { cid : cid , user : "Agent:" + adid , type : 41 } ) ; } catch ( err ) { reject ( "Error creating audits: " + err ) ; } } ) ; }
Creates audit logs for each registered item
Creates audit logs for each registered item
// var oidArray = getIds(allresult, 'id'); // Process all new items // logger.debug('END execution with value =', value, 'and result =', result); // Final part: Return results, update node and notify // Only process final step if all the stack of tasks completed