- Configurations: these are usually non-code related changes and are the easiest to migrate.
- Customizations: these are usually code additions that can be easily “swapped in” to the existing codebase to either safely override or augment existing functionality.
- Overrides: these are usually code changes that require a more in-depth understanding of the codebase and may require changes to existing code. In general, it is not technically possible to perform these changes as a configuration or customization. These are the hardest to migrate, and if you need to do them we recommend you raise a Jira for us to see if there is a better alternative or if there is a gap in our product that needs to be addressed.
How to configure the starter project
We recommend that you configure the application as much as possible before customizing existing code. The following configurations are commonly used:How to set application properties
Application properties are used to configure functionality of Atoti Limits and most of its dependencies. These can be found in the properties section and updated by modifying thesrc/main/resources/application.yml file, or by using environment variables.
How to configure the database
By default, the application uses an in-memory H2 database and expects any initial data to be loaded from CSV files.Using the H2 database in production is not recommended. Instead, please use a production-grade database. There is none
in particular that we recommend, but popular choices include:
application.yml file. You will need to create and deploy your own database server, but once the
connection is configured, Atoti Limits will automatically create the required tables and schemas for you. See
Persistence for more information on how to set up the database connection.
How to improve performance
Depending on a multitude of factors, such as the number of limits you have, the cardinality of the scopes for your limits, and/or the volume/schema of the data in the connected Atoti server, the performance of your Atoti Limits implementation may vary. See Performance for information on options to improve performance.How to add customizations
When you add new code as a customization to the starter project, we highly recommend that you use your own package
name and avoid using the
com.activeviam package. This will separate your code from our code and make it much easier to
migrate. All customizations should be done in the limits-starter module, or in a separate module that depends on
limits-starter.How to customize with Spring beans
The application follows Spring best practices. To customize, you can override existing beans and components by defining them in your application. This is the safest form of overriding or augmenting existing code behavior. We aim to use@ConditionalOnMissingBean as much as possible to allow for easy customization. If we have not exposed a bean you wish
to override as @ConditionalOnMissingBean, please raise a Jira
with us and mark your bean as @Primary.
How to customize Activiti workflows
The application includes default Activiti workflows located insrc/main/resources/processes/. See Limit Workflow
for information on the default workflows. If you want to use custom workflows, you need to:
- Create your BPMN file. You can either edit the existing BPMN files or use a BPMN editor, such as BPMN.io.
- Import any Spring beans or services required by your workflow. This is detailed further in adding custom workflow tasks.
- Add the new processes in
src/main/resources/processes/. - Restart the application to ensure the changes are picked up.
How to customize security
The application comes with a default security configuration using Spring security. You need to customize this by implementing your own security configuration. This is done by implementing and exposing the following interfaces:com.activeviam.web.spring.api.config.ICorsConfig: This interface is used to configure CORS settings.org.springframework.security.web.SecurityFilterChain: This interface is used to configure security filters for REST requests.org.springframework.security.core.userdetails.UserDetailsService: This interface is used to load user-specific data.
How to configure roles and permissions
Configure the roles assigned to users to control what actions users can perform and assign permissions to custom roles to control what data they can access in Atoti Limits. See Roles and Permissions for more information on the default roles provided by Atoti Limits and how to configure custom roles and permissions.What else can you customize?
The ability to customize the application is not limited to these examples. Please see the Extending the Module section for more in-depth information on the different ways you can customize the application.How to override the code
If you cannot configure or customize the application to meet your requirements, you may need to override the application. This is the most complex form of modification as it requires an in-depth knowledge of the core codebase and may result in unintended consequences. It is also the most difficult code to migrate, because it may be difficult to remember if the code was an override in the first place or is a legitimate starter class. We recommend adding a javadoc to differentiate overrides from released source code.How to migrate to a new version of Atoti Limits
When migrating to a new version of Atoti Limits, we recommend the following steps:- Ensure your code customizations are under a separate package name from the
com.activeviampackage. - Create a new branch in your VCS for the upgrade.
- If you have overridden any of our code, move it to a
tmp.com.activiampackage. This should only apply to overrides, not to starter code. - Install the starter project for your new version, replacing the old starter
com.activeviampackages with the new packages. - Verify if any of the
tmp.com.activeviamcode can be removed. If so, remove it, otherwise, please raise a Jira and merge it with the new code. - Run
mvn clean install - If you have any compilation errors, consult the changelog and migration guide for the new version.
- Repeat steps 6-7 until the code compiles and is correctly installed.