reserve Method

Reserve Codes. If no Codes are specified, then all of the Codes that are in currently pending requests are reserved. This function may only be able to reserve some of the requested Codes. In that case, this function will return a rejection of type RequestError. The error object will identify the codes that are unavailable.

Example:

    try {
      await iModel.concurrencyControl.codes.reserve(authorizedRequestContext);
    } catch (err) {
      if (err instanceof ConcurrencyControl.RequestError) {
        // Do something about err.unavailableCodes ...
      }
    }

reserve(requestContext: AuthorizedClientRequestContext, codes?: Code[]): Promise<void>

throws ConcurrencyControl.RequestError

Parameter Type Description
requestContext AuthorizedClientRequestContext The client request context
codes Code[] The Codes to reserve

Defined in

Last Updated: 08 January, 2020