Click or drag to resize

IdentityGenerateIdentityId Method

Build an identity Id using values from up to three different string values. The method generates a unique identity id. The identity id is generated by combining a fixed number of letters of the person's names - which are provided in strProperty1, strProperty2, and strProperty3. The generated id is always in uppercase unless ToLowerCase is set to true. The method excepts the action object to be an Identity data object. The method updates the IDENTITYID property on the action object with the generated identity id. No output is returned from the method. The uniqueness is ensured by comparing the generated identity id with the existing identities in the system. In addition the dataSourceForDuplicateCheck parameter can be used for additional uniqueness check in an external system.

Namespace:  Omada.OE.Solution.OIM.Assembly
Assembly:  Omada.OE.Solution.OIM.Assembly (in Omada.OE.Solution.OIM.Assembly.dll) Version: 15.0.0.0
Syntax
C#
public void GenerateIdentityId(
	CodeMethodInvokeContext context,
	string strProperty1,
	int numberOfCharsProp1,
	string strProperty2,
	int numberOfCharsProp2,
	string strProperty3,
	int numberOfCharsProp3,
	string prefix,
	string postfix,
	string positiveCharacters,
	string negativeCharacters,
	int length,
	bool toLowerCase,
	string separator,
	string dataSourceForDuplicateCheck,
	bool checkBlackListEntries,
	string substitutionRules,
	int maxNumberOfAttempts,
	string postfixSequenceUId,
	int postfixSequenceLength,
	bool postFixNumber,
	int postfixNumberOffset,
	bool skipEvents
)

Parameters

context
Type: Omada.OE.ModelCodeMethodInvokeContext
strProperty1
Type: SystemString
First string
numberOfCharsProp1
Type: SystemInt32
Number of characters to include from the first string
strProperty2
Type: SystemString
Second string
numberOfCharsProp2
Type: SystemInt32
Number of characters from the second string
strProperty3
Type: SystemString
Third string
numberOfCharsProp3
Type: SystemInt32
Number of characters from the third string
prefix
Type: SystemString
A string which will be used as prefix in the generated id
postfix
Type: SystemString
A string which will be used as postfix in the generated id
positiveCharacters
Type: SystemString
Commaseparated string of characters. If not empty - Only these characters will be used when generating the identity id
negativeCharacters
Type: SystemString
Commaseparated string of characters. None of these characters will be used when generating the identity id
length
Type: SystemInt32
Length of the generated identity id. The prefix and postfix are not considered for the length
toLowerCase
Type: SystemBoolean
Convert to lowercase
separator
Type: SystemString
Character which will be appended after each string value. E.g to generate an id like "firstname.lastname"
dataSourceForDuplicateCheck
Type: SystemString
UId of Data Source object which contains query used for check of uniqueness The datasource must contain a parameter "userId" which should be used to compare the generated userid agains the external data source in the query e.g: SELECT 1 FROM users where username = @userId If the data source query returns a result, the generated identity id is NOT unique
checkBlackListEntries
Type: SystemBoolean
If true, a check will be made to ensure that the generated id complies with the BlackList entries in ES
substitutionRules
Type: SystemString
Contains a set of substitution rules built as a dictionary string, using the following notation: "[Illegal Character]:[Substitute with this character];[Illegal character 2]:[Substitute with this character 2]". Any occurences of the strings will be substituted with the substitution-string. Example: if the letter "Æ" should be substituted with "AE" and the letter Ø should be substituted with OE, this rule should be used: "Æ:AE;Ø:OE" Casing is disregarded - ex. "æ" means both "æ" and "Æ".
maxNumberOfAttempts
Type: SystemInt32
Number of attempts before throwing an exception
postfixSequenceUId
Type: SystemString
Specify the UId of a Sequence object that will be used for generating postfixes.
postfixSequenceLength
Type: SystemInt32
Minimum length of the postfixed sequence number. Example: if the postfixSequenceLength is 4 and a sequence number of 147 is generated the value "0147" is postfixed. Is only used if postfixSequence is true.
postFixNumber
Type: SystemBoolean
If true, a number using the offset in the PostfixNumberOffset parameter will be postfixed to the generated user id. E.g. if the generated user id is "MVA" and the offset is 200 the final user id will be "MVA200" and "MVA201" for subsequent user ids (if the generated user id is "MVA") When the generated user id differes from any previous generated user id, the offset number will be reset
postfixNumberOffset
Type: SystemInt32
Offset to postfix the generated user id with
skipEvents
Type: SystemBoolean
If set to true will skip save events during updating Identity data object
See Also