Run-time Configuration Settings
Some parts of Mifos can be configured while a Mifos instance is deployed and running. A user interface should exist for run-time settings. For example, "Roles and Permissions" can be found by clicking on the "Admin" tab. The configuration is stored in the database.
Some parts of Mifos must be configured at install time. Changing them requires redeployment. The default values for these settings reside in the file
application/src/main/resources/org/mifos/config/resources/applicationConfiguration.default.properties |
This is known as the "application-wide configuration file". Developers should edit this file as necessary. Mifos specialists should create a file called
applicationConfiguration.custom.properties |
and place this file in the application server classpath. Individual configuration settings may be overridden as necessary.
Apache Commons Configuration is used to access the properties files. ConfigurationManager
is the entry point for this library.
Some settings are "trap doors", and can only be changed once. This is usually because enabling or disabling them leads to database changes that are not easy to undo. If this is the case for a particular setting, it should be made clear in a comment in applicationConfiguration.default.properties
.
Tables previously used for configuration like config_key_value_integer
and customer_state
are now used to store state of these values, so they are not able to be unset in cases where database corruption would result.
For code examples, see ProcessFlow.SavingsPendingApprovalStateEnabled
in the ProcessFlowRules
class or ClientRules.GroupCanApplyLoans
in the ClientRules
class.
Other settings in the application-wide configuration file can be changed at any time, and will take effect as soon as Mifos is redeployed. For example: ClientRules.NameSequence
.
Unit tests should be created to test logic beyond what is covered in Apache Commons Configuration. TestClientRules
is a good example.
As part of improving the Mifos configuration process install-time configuration settings were migrated from the database into properties files. The following content on configured values is included only for historical reference.
This page describes how to add database based configuration information to Mifos.
Currently there is support for generic integer based configuration parameters in Mifos. This functionality will most likely be refined or refactored in the future, but the current usage is as follows.
Say you want to add a configuration parameter "EnableMyFeature" that is either true or false.
INSERT INTO CONFIG_KEY_VALUE_INTEGER(CONFIGURATION_KEY, CONFIGURATION_VALUE) VALUES ('myFeatureIsEnabled',0); |