Customise ID Generation
Overview
The IDGen service is designed to eliminate redundant code for ID generation by providing a centralized mechanism for managing ID formats. This reduces the maintenance burden on developers and allows for a configuration-driven approach, enabling usage without writing any additional code.
When is Customisation Required?
The IDGen service supports a set of out-of-the-box replaceable tokens for ID format generation. For most use cases, these defaults are sufficient. Customization is required only in the following scenarios:
When ID formats must follow complex logic not covered by existing tokens.
When integration with external systems is necessary.
When new ID types are introduced that are not natively supported by the IDGen service.
Refer to the official documentation for the list of supported replaceable tokens.
Steps
If your requirements extend beyond the supported configuration, you can implement customization in the following way:
Create a Wrapper API or Wrapper Logic
Implement a wrapper in your service to invoke the IDGen service.
Retrieve the default ID generated using the standard configuration.
Apply Custom Logic
Add your custom rules or transformations.
Replace or modify placeholders based on your specific requirements.
Return Final ID
Once the custom logic is applied, the wrapper should return the final ID to the calling system.
This approach ensures that the core IDGen service remains generic, while custom business rules are encapsulated within your wrapper.
Last updated
Was this helpful?