Configuring Entity ID Sequences
Goals
Understand why each Entity Type needs a unique ID Sequence.
Know how to create new Entity ID Sequences.
Entity ID Sequences
The default Entity ID Sequence for all new Entity Types is the ESP SEQUENCE. This will generate a unique Entity ID in the following format: ESP000001, ESP000002, ESP000003, etc. However, you should replace this selection with your own custom Entity ID Sequence. Why?
Each Entity needs a descriptive ID so the End User knows what they are looking at.
The same ID Sequence should not be assigned to more than one (1) Entity Type.
How to create new Entity ID Sequences
New Entity ID Sequences are created in L7 Configuration.
Note
The steps below describe how to create Entity ID Sequences, but this process also applies to Item and Experiment ID Sequences.
Go to: L7 Configuration → Selected Configuration = esp → id_sequences → entity
Entity ID Sequences may also be found under lims → sample_id_sequences
Every ID Sequence has the following keys:
format – defines the ID Sequence itself (free-form text and supported arguments).
name – the name of the sequence in the Entity Types builder.
sequence – the name of the sequence in the database.
Then add the ID Sequence to the database.
Go to: L7 Configuration → Selected Configuration = esp → sequences
Use the sequence value created in the “id_sequences” block.
The number after the colon tells L7|ESP what
sequence_number
to assign to the next Entity created using this ID Sequence.
Note
A number needs to be assigned even if the {sequence_number}
argument is not being used. In this case it is best practice to assign a value of 1.
If the {sequence_number}
argument is being used, and IDs need to be reserved for existing Entities, this value should be n+1, with n equal to the number of existing Entities that will be migrated into the system.
Both the "id_sequences" and "sequences" blocks must be updated for the ID Sequence to work properly.
Now you can assign the newly created ID Sequence to an Entity Type.
Go to: L7|Master → Entity Types → select the Entity Type → Entity ID Sequences tab
Deselect the default ESP SEQUENCE and assign the newly created Entity ID Sequence.
Note
More than one (1) ID Sequence can be assigned to an Entity Type.
How to edit existing ID Sequences
Navigate to L7 Configuration and edit the ID Sequence in the "id_sequences" block.
If the sequence key is changed, consider what sequence_number
should be assigned to the next Entity, Item, or Experiment created using this ID Sequence. New keys will start counting at the value specified.
How to remove existing ID Sequences
First ensure that the ID Sequence is not assigned to an Entity Type, Item Type, or Workflow in L7|Master.
Then navigate to L7 Configuration and delete the ID Sequence from the "id_sequences" block, and the corresponding sequence key and value from the "sequences" block.