Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

Pull in library via maven/gradle from Artifactory

<dependency>
   <groupId>edu.hawaii.its.kfs</groupId>
   <artifactId>kfs-webservice-client</artifactId>
   <version>1.5</version>
</dependency>


Java method to call one of the endpoints

public static AccountItem validateAccountInKFS(AccountItem item)
{
  String returnFlag = ""; 
  UhAccountWebService service = SpringFacade.getUhAccountService();
  String displayInfo = null;

  if (item.getAcctAccount() != null && !item.getAcctAccount().equalsIgnoreCase("")) {
  try {

    AccountWebType a = service.getAccountByPrimaryId(item.getAcctCampus(), item.getAcctAccount());

    if (a != null) {
      item.setAcctTitle(a.getAccountName().getValue());
      item.setAcctFoCode(a.getUhFoCode().getValue());
      item.setAcctRespPerson(a.getAccountsSupervisoryFullName().getValue());
      item.setAcctSupervisorUhuuid(a.getAccountsSupervisorySystemsIdentifier().getValue());
      item.setAcctFoUhuuid(a.getAccountFiscalOfficerSystemIdentifier().getValue());

      displayInfo = translateForTesting(a);
      _log.debug(displayInfo);
    }
    else {
      item.setAcctTitle(StringUtils.EMPTY);
      item.setAcctFoCode(StringUtils.EMPTY);
      item.setAcctRespPerson(StringUtils.EMPTY);
      item.setAcctSupervisorUhuuid(StringUtils.EMPTY);
      item.setAcctFoUhuuid(StringUtils.EMPTY);
    }
    returnFlag = checkAccountStatus(a);

    if (StringUtils.isBlank(returnFlag) && StringUtils.isNotBlank(item.getAcctSubAccount())) {
    UhSubAccountWebType s = service.getSubAccountByPrimaryId(item.getAcctCampus(), item.getAcctAccount(), item.getAcctSubAccount().toUpperCase());
    if (s != null) {
      displayInfo = translateForTesting(s);
      _log.debug(displayInfo);
    }

    returnFlag = checkSubAccountStatus(s);
  }
  }
  catch (Exception e) {
    _log.debug(GeneralUtil.getCustomStackTrace(e));
    returnFlag = "1";
    _log.debug("Account Info Not Found In KFS " + item.getAcctCampus() + item.getAcctAccount() + item.getAcctSubAccount());
  }
  }
  item.setAcctFlag(returnFlag);
  _log.debug("KFS Account Validation: " + item.getAcctCampus() + " / " + item.getAcctAccount() + " / "
  + item.getAcctSubAccount() + ": " + item.getAcctFlag());
  return item;
}


  • No labels