Sequence Generator for userid

Which IIQ version are you inquiring about?

Version 8.4

Share all details related to your problem, including any error messages you may have received.

Hi All,
I have a requirement to generate a sequence number (6 digit number) and set it as username on identity cube when creating a new identity cube for contractors.

I was looking for suggestions which requires minimum customisation.

Thanks in advance
Jitesh

@jjain

Welcome back to community

You can simply create a database sequence for this within your database and use the nextval of the sequence every time you create or set the username

This will be simple approach with no much customisations

4 Likes

Thanks @iamksatish for the reply.

I was wondering if there were any other options besides database sequence as creating a DB sequence would need DBA help.

Other option you can follow is just have a check for max(username) on existing contractor identities filter condition and increment by 1 , but this would be a issue if at all there is a concurrent processing happens , you can go with approach if concurrency is not a case

1 Like

Hi @jjain : Apart from the solution provided by @iamksatish, another option could be to utilize an existing unique key from your source HR application, such as a payroll number, instead of generating a new sequence number each time. However, I wouldn’t recommend this approach, as it may lead to poor data quality in your system over the long term.

You could also use a Custom Object to hold the last used value. that would be easier.

Best!

1 Like

I did think about Custom object but Custom object are usually used for storing static information.

1 Like

Why don’t you create a db sequence ?

When the DB column is using sequence, how do you return/get the nextval to display in the ‘create account policy’ for a jdbc connector?
Are you already connected to the DB at this point, or do you have to connect, select and then return the next seq value?

We have done this many times all leveraging the database. Either a sequence or generate a stored procedure to pick a random value from a seeded table. You can leverage the locking capabilities which is super helpful too.

1 Like

Custom objects are for all kinds of information, not just static info. At one client I shoved all of the identity’s roles and entitlements into a Custom object at the beginning of the termination process, just in case it needed to be reversed.
The main thing is to be thread safe, to be sure to lock the object, modify it, then unlock it.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.