use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class SavingsServiceFacadeWebTier method retrieveAccountStatuses.
@Override
public AccountStatusDto retrieveAccountStatuses(Long savingsId) {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = toUserContext(user);
SavingsBO savingsAccount = this.savingsDao.findById(savingsId);
try {
List<ListElement> savingsStatesList = new ArrayList<ListElement>();
AccountStateMachines.getInstance().initializeSavingsStates();
List<AccountStateEntity> statusList = AccountStateMachines.getInstance().getSavingsStatusList(savingsAccount.getAccountState());
for (AccountStateEntity accountState : statusList) {
savingsStatesList.add(new ListElement(accountState.getId().intValue(), accountState.getName()));
}
return new AccountStatusDto(savingsStatesList);
} catch (StatesInitializationException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class AccountStateMachines method initializeCenterStates.
public void initializeCenterStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.CUSTOMER_ACCOUNT;
CustomerLevel level = CustomerLevel.CENTER;
String configName = getConfigurationName(accountType, level);
try {
statesMapForCenter = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_CENTER, configName);
customerStatusListForCenter = retrieveAllCustomerStatusList(level);
populateCenterStatesViewMap();
} 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 retrieveNextPossibleAccountStateObjectsForSavings.
private List<AccountStateEntity> retrieveNextPossibleAccountStateObjectsForSavings(StateEntity accountStateEntityObj) throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleAccountStateObjectsForSavings()");
List<AccountStateEntity> stateEntityList = new ArrayList<AccountStateEntity>();
try {
List<StateEntity> stateList = statesMapForSavings.get(accountStateEntityObj);
if (null != stateList) {
for (StateEntity accountStateEntity : stateList) {
for (AccountStateEntity accountStateEnty : accountStateEntityListForSavings) {
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 initializeGroupStates.
public void initializeGroupStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.CUSTOMER_ACCOUNT;
CustomerLevel level = CustomerLevel.GROUP;
String configName = getConfigurationName(accountType, level);
try {
statesMapForGroup = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_GROUP, configName);
customerStatusListForGroup = retrieveAllCustomerStatusList(level);
populateGroupStatesViewMap();
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
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);
}
}
Aggregations