vicinityManager/server/services/sharingRules.js
/*
Add items to contract group in commServer
*/
Add items to contract group in commServer
Add items to contract group in commServer
function adding(oid, otherParams, callback){
  commServer.callCommServer({}, 'users/' + oid + '/groups/' + otherParams.ctid , 'POST')
   else {
  .then(function(ans){
    logger.audit({user: otherParams.mail, action: 'addItemToContract', item: oid, contract: otherParams.ctid });
    callback(oid, "Success");})
  .catch(function(err){
      logger.error({user: otherParams.mail, action: 'addItemToContract', item: oid, contract: otherParams.ctid, message: err });
      callback(oid, 'Error: ' + err);
  });
}
function adding ( oid , otherParams , callback ) { commServer . callCommServer ( { } , 'users/' + oid + '/groups/' + otherParams . ctid , 'POST' ) . then ( function ( ans ) { logger . audit ( { user : otherParams . mail , action : 'addItemToContract' , item : oid , contract : otherParams . ctid } ) ; callback ( oid , "Success" ) ; } ) . catch ( function ( err ) { logger . error ( { user : otherParams . mail , action : 'addItemToContract' , item : oid , contract : otherParams . ctid , message : err } ) ; callback ( oid , 'Error: ' + err ) ; } ) ; }
Add items to contract group in commServer
Add items to contract group in commServer
// logger.debug('START execution with value =', oid); // .then(function(response){ //   var id = null; //   for(var i = 0; i < otherParams.iotOwner.items.length;){ //     if(otherParams.iotOwner.items[i].extid === oid){id = otherParams.iotOwner.items[i].id;} //   } //   if(id === null){ //     new Promise(function(resolve, reject) { resolve(true); } ); //   } else { //     return audits.putAuditInt( //       id, //       { orgOrigin: otherParams.orgDest, //         orgDest:otherParams.orgOrigin, //         auxConnection: {kind: 'contract', item: otherParams.id, extid: otherParams.ctid}, //         eventType: 51 } //     ); //   } // })