|
During Mifos implementations, the financial institution may want to implement custom functionality. Example: At the time of approval of a loan, the loan amount should not exceed 5 times the sum of balances available in all the savings accounts of the customer.
Ideally this should be done using a configurable rules engine. However, if a facility is available where a technical specialist can add some Java code and hook this code to an event when the code will be executed, it will help 'extend' Mifos functionality for a specific implementation without having to modify existing Mifos Java classes. If specialists modify existing Mifos classes, then upgrading Mifos without losing these changes could be a challenge.
There could be a configuration within Mifos as follows: ApplicableFor: Loans Event: PreLoanApproval Inputs: LoanAccountData, ClientData (these have to be existing Java classes from Mifos X code - objects of these) ClassToInvoke: com.specialist.mifosx.extensions.LoanRules MethodToInvoke: doPreApprovalChecksForLoans
If configured, then Mifos will invoke the method from the class specified when the event happens.
Meanings: ApplicableFor - whether it is applicable for Clients, Loans, Savings etc. Events - will be one of a predefined list. The predefined list could be as follows:
-
preClientCreate / preClientUpdate / preClientClose
-
preClientApprove / preClientReject
-
postClientCreate / postClientUpdate / postClientClose
-
postClientApprove / postClientReject
-
preLoanCreate / preLoanUpdate / preClientDelete
-
preLoanApprove / preLoanReject
-
postLoanCreate / postLoanUpdate / postClientDelete
-
postLoanApprove / postLoanReject
-
Etc.
ClassToInvoke: The Java class which has the custom code to be invoked MethodToInvoke: The Java method within the above class which has the custom code to be invoked
I think this will be the first step to integrating a rules engine eventually to various 'events' in Mifos X.
|