- Parameters
-
rootWorkspaceId | The identifier for the root Workspace we are working with |
string | The string from which we are going to generate a QUuid |
- Returns
- A QUuid generated from the specified string.
Returns a QUuid from the contents of the specified string. There are several scenarios that are catered for here:
1) There is no "active" id registry (i.e. there is no OperationIdRegistry in existence). In this scenario, the function will return a QUuid directly from the string, which is expected to be of the format:
"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"
Where 'x' is a hex digit. If the string is not in this format, a null Quuid will be returned.
2) There is an "active" id registry, and the string can be converted directly to an integer. In this case, the function will assume that the string represents a "legacy" id (i.e. from the time when all operations had integers as ids). The function will then:
- Look in the active registry to see if this legacy id has been requested before. If it has, it will get the associated QUuid and return it. This makes sure the same QUuid is used in every place the legacy id was previously used.
- If it can't find the legacy id in the active registry, it will generate a new QUuid using generateId(), insert it into the registry as the value for the legacy id, then return the new QUuid.
3) There is an "active" id registry and the string can not be converted into an int. In this scenario, the function will return a QUuid directly from the string, which is expected to be of the format:
"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"
Where 'x' is a hex digit. If the string is not in this format, a null Quuid will be returned.