use of org.kuali.rice.location.framework.state.StateEbo in project cu-kfs by CU-CommunityApps.
the class Account method getAccountState.
/**
* Gets the accountState attribute
*
* @return Returns the accountState
*/
@Override
public StateEbo getAccountState() {
if (StringUtils.isBlank(accountStateCode) || StringUtils.isBlank(accountCountryCode)) {
accountState = null;
} else {
if (accountState == null || !StringUtils.equals(accountState.getCode(), accountStateCode) || !StringUtils.equals(accountState.getCountryCode(), accountCountryCode)) {
ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(StateEbo.class);
if (moduleService != null) {
Map<String, Object> keys = new HashMap<String, Object>(2);
keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, accountCountryCode);
keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountStateCode);
accountState = moduleService.getExternalizableBusinessObject(StateEbo.class, keys);
} else {
throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.");
}
}
}
return accountState;
}
Aggregations