code: protected <T, A> ActiveOperation<T, A> registerActiveOperation(final Integer id, A attachment, ActiveOperation.CompletedCallback<T> callback) {
          lock.lock();
          try {
              // Check that we still allow registration
              // TODO WFCORE-199 distinguish client uses from server uses and limit this check to server uses
              // Using id==null may be one way to do this, but we need to consider ops that involve multiple requests
              // TODO WFCORE-845 consider using an IllegalStateException for this
              //assert ! shutdown;
              final Integer operationId;
              if(id == null) {
                  // If we did not get an operationId, create a new one
                  operationId = operationIdManager.createBatchId();
              } else {
                  // Check that the operationId is not already taken
                  if(! operationIdManager.lockBatchId(id)) {
                      throw ProtocolLogger.ROOT_LOGGER.operationIdAlreadyExists(id);
                  }
                  operationId = id;
              }
              final ActiveOperationImpl<T, A> request = new ActiveOperationImpl<T, A>(operationId, attachment, getCheckedCallback(callback), this);
              final ActiveOperation<?, ?> existing =  activeRequests.putIfAbsent(operationId, request);
              if(existing != null) {
                  throw ProtocolLogger.ROOT_LOGGER.operationIdAlreadyExists(operationId);
              }
              ProtocolLogger.ROOT_LOGGER.tracef("Registered active operation %d", operationId);
              activeCount++; // condition.signalAll();
              return request;
          } finally {
              lock.unlock();
          }
      }
docs: Register an active operation with a specific operation id.
  
  @param id the operation id
  @param attachment the shared attachment
  @param callback the completed callback
  @return the created active operation
  
  @throws java.lang.IllegalStateException if an operation with the same id is already registered