use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveAccountStatuses.
@Override
public AccountStatusDto retrieveAccountStatuses(Long loanAccountId) {
LoanBO loanAccount = this.loanDao.findById(loanAccountId.intValue());
try {
List<ListElement> loanStatesList = new ArrayList<ListElement>();
AccountStateMachines.getInstance().initializeLoanStates();
List<AccountStateEntity> statusList = AccountStateMachines.getInstance().getLoanStatusList(loanAccount.getAccountState());
for (AccountStateEntity accountState : statusList) {
loanStatesList.add(new ListElement(accountState.getId().intValue(), accountState.getName()));
}
return new AccountStatusDto(loanStatesList);
} catch (StatesInitializationException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class AccountStateMachines method initializeLoanStates.
public void initializeLoanStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.LOAN_ACCOUNT;
CustomerLevel level = null;
String configName = getConfigurationName(accountType, level);
try {
statesMapForLoan = loadMap(AccountStates.TRANSITION_CONFIG_FILE_PATH_LOAN, configName);
accountStateEntityListForLoan = retrieveAllAccountStateList(accountType);
removeLoanReversalFlagForCancelState();
populateLoanStatesViewMap();
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class AccountStateMachines method retrieveNextPossibleAccountStateObjectsForLoan.
private List<AccountStateEntity> retrieveNextPossibleAccountStateObjectsForLoan(StateEntity accountStateEntityObj) throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleAccountStateObjectsForLoan()");
List<AccountStateEntity> stateEntityList = new ArrayList<AccountStateEntity>();
try {
List<StateEntity> stateList = statesMapForLoan.get(accountStateEntityObj);
if (null != stateList) {
for (StateEntity accountStateEntity : stateList) {
for (AccountStateEntity accountStateEnty : accountStateEntityListForLoan) {
if (accountStateEntity.sameId(accountStateEnty)) {
stateEntityList.add(accountStateEnty);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class AccountStateMachines method retrieveNextPossibleCustomerStateForClient.
private List<CustomerStatusEntity> retrieveNextPossibleCustomerStateForClient(StateEntity customerStateEntityObj) throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleCustomerStateForClient()");
List<CustomerStatusEntity> stateEntityList = new ArrayList<CustomerStatusEntity>();
try {
List<StateEntity> stateList = statesMapForClient.get(customerStateEntityObj);
if (null != stateList) {
for (StateEntity customerStateEntity : stateList) {
for (CustomerStatusEntity customerStatusEntry : customerStatusListForClient) {
if (customerStatusEntry.sameId(customerStateEntity)) {
stateEntityList.add(customerStatusEntry);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class AccountStateMachines method retrieveNextPossibleCustomerStateForGroup.
private List<CustomerStatusEntity> retrieveNextPossibleCustomerStateForGroup(StateEntity customerStateEntityObj) throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleCustomerStateForGroup()");
List<CustomerStatusEntity> stateEntityList = new ArrayList<CustomerStatusEntity>();
try {
List<StateEntity> stateList = statesMapForGroup.get(customerStateEntityObj);
if (null != stateList) {
for (StateEntity customerStateEntity : stateList) {
for (CustomerStatusEntity customerStatusEntry : customerStatusListForGroup) {
if (customerStatusEntry.sameId(customerStateEntity)) {
stateEntityList.add(customerStatusEntry);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
Aggregations