Skip to main content

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?

  1. Each Entity needs a descriptive ID so the End User knows what they are looking at.

  2. 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 ConfigurationSelected Configuration = espid_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.

config_id_sequences_block_3_3.png

Then add the ID Sequence to the database.

Go to: L7 ConfigurationSelected Configuration = espsequences

  • 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.

config_sequences_block_3_3.png

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|MasterEntity Typesselect the Entity TypeEntity ID Sequences tab

Deselect the default ESP SEQUENCE and assign the newly created Entity ID Sequence.

master_entity_id_sequences_tab_3_3.png

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.