public String execute(){
if(getDunning().getName() != null || !"".equalsIgnoreCase(getDunning().getName())){
addActionError("Name is required");
}
Dunning dunning;
if(getDunning().getId() == null || "".equalsIgnoreCase(getDunning().getId())){
dunning = new Dunning();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
dunning = (Dunning) manager.getById(Dunning.class, getDunning().getId());
logInfo = dunning.getLogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
dunning.setLogInformation(logInfo);
dunning.setName(getDunning().getName());
dunning.setDescription(getDunning().getDescription());
dunning.setPdefault(getDunning().getPdefault());
dunning.setSendDunningLetters(getDunning().getSendDunningLetters());
dunning.setCreateLevelsSequentially(getDunning().getCreateLevelsSequentially());
manager.save(dunning);
setDunning(dunning);
return SUCCESS;
}