code: function commitTransactional(params, callback) {
      if (transactionsManager.length)
        return transactionOperation.call(transactionsManager, 'transaction',
          params, callback);
  
      callback = callback || noop;
  
      var operations = params.operations;
  
      var promises = [];
  
      function checkId(operation, param) {
        if (param instanceof MediaObject && param.id === undefined) {
          var index = findIndex(operations, function (element) {
            return operation != element && element.params.object === param;
          });
  
          // MediaObject dependency is created in this transaction,
          // set a new reference ID
          if (index >= 0)
            return 'newref:' + index;
  
          // MediaObject dependency is created outside this transaction,
          // wait until it's ready
          promises.push(param);
        }
  
        return param
      }
  
      // Fix references to uninitialized MediaObjects
      operations.forEach(function (operation) {
        var params = operation.params;
  
        switch (operation.method) {
        case 'create':
          var constructorParams = params.constructorParams;
          for (var key in constructorParams)
            constructorParams[key] = checkId(operation, constructorParams[
              key]);
          break;
  
        default:
          params.object = checkId(operation, params.object);
  
          var operationParams = params.operationParams;
          for (var key in operationParams)
            operationParams[key] = checkId(operation, operationParams[key]);
        };
      });
  
      function callback2(error, result) {
        if (error) return callback(error);
  
        operations.forEach(operationResponse, result)
  
        callback(null, result);
      };
  
      Promise.all(promises).then(function () {
          operations.forEach(serializeOperation)
  
          encode('transaction', params, callback2);
        },
        callback);
    }
docs: Commit mechanisms 
  @function module:kurentoClient.KurentoClient~commitTransactional
  
  @param {external:Object} params
  @param {external:Function} callback