use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class CenterServiceFacadeWebTier method initializeClientStates.
@Override
public void initializeClientStates(String clientGlobalNum) {
ClientBO client = this.customerDao.findClientBySystemId(clientGlobalNum);
try {
List<ListElement> savingsStatesList = new ArrayList<ListElement>();
AccountStateMachines.getInstance().initializeClientStates();
List<CustomerStatusEntity> statusList = AccountStateMachines.getInstance().getClientStatusList(client.getCustomerStatus());
for (CustomerStatusEntity customerState : statusList) {
savingsStatesList.add(new ListElement(customerState.getId().intValue(), customerState.getName()));
}
} catch (StatesInitializationException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class CenterServiceFacadeWebTier method initializeCenterStates.
@Override
public void initializeCenterStates(String centerGlobalNum) {
CenterBO center = this.customerDao.findCenterBySystemId(centerGlobalNum);
try {
List<ListElement> savingsStatesList = new ArrayList<ListElement>();
AccountStateMachines.getInstance().initializeCenterStates();
List<CustomerStatusEntity> statusList = AccountStateMachines.getInstance().getCenterStatusList(center.getCustomerStatus());
for (CustomerStatusEntity customerState : statusList) {
savingsStatesList.add(new ListElement(customerState.getId().intValue(), customerState.getName()));
}
} catch (StatesInitializationException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class CenterServiceFacadeWebTier method initializeGroupStates.
@Override
public void initializeGroupStates(String groupGlobalNum) {
GroupBO group = this.customerDao.findGroupBySystemId(groupGlobalNum);
try {
List<ListElement> savingsStatesList = new ArrayList<ListElement>();
AccountStateMachines.getInstance().initializeGroupStates();
List<CustomerStatusEntity> statusList = AccountStateMachines.getInstance().getGroupStatusList(group.getCustomerStatus());
for (CustomerStatusEntity customerState : statusList) {
savingsStatesList.add(new ListElement(customerState.getId().intValue(), customerState.getName()));
}
} catch (StatesInitializationException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.framework.exceptions.StatesInitializationException in project head by mifos.
the class AccountStateMachines method initializeClientStates.
public void initializeClientStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.CUSTOMER_ACCOUNT;
CustomerLevel level = CustomerLevel.CLIENT;
String configName = getConfigurationName(accountType, level);
try {
statesMapForClient = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_CLIENT, configName);
customerStatusListForClient = retrieveAllCustomerStatusList(level);
populateClientStatesViewMap();
} 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 retrieveNextPossibleCustomerStateForCenter.
private List<CustomerStatusEntity> retrieveNextPossibleCustomerStateForCenter(StateEntity customerStateEntityObj) throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleCustomerStateForCenter()");
List<CustomerStatusEntity> stateEntityList = new ArrayList<CustomerStatusEntity>();
try {
List<StateEntity> stateList = statesMapForCenter.get(customerStateEntityObj);
if (null != stateList) {
for (StateEntity customerStateEntity : stateList) {
for (CustomerStatusEntity customerStatusEntry : customerStatusListForCenter) {
if (customerStatusEntry.sameId(customerStateEntity)) {
stateEntityList.add(customerStatusEntry);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
Aggregations