private void causeConditionforSubmitSavedDataType(ClaimantReminder claimantReminder) {
   if (claimantReminder.getClaimantClaim() != null
       && claimantReminder.getReminderType().getDescription().equals("Submit Saved Data")
       && (claimantReminder.getReminderStatus().toString().equals("Pending")
           || claimantReminder.getReminderStatus().toString().equals("NO_ADDRESS_AVAILABLE"))) {
     claimantReminder.setReminderStatus(ClaimantReminder.ReminderStatus.AUTO_RESOLVED);
   }
 }
  private boolean emailCheckForaClaimant(ClaimantReminder claimantReminder) {
    if (claimantReminder.getReminderStatus().equals(ReminderStatus.NO_ADDRESS_AVAILABLE)) {
      claimantReminder.setReminderStatus(ClaimantReminder.ReminderStatus.REJECT);

      createAwdRipObjectforRejectedReminder(claimantReminder);
      return false;
    }
    return true;
  }
 @Override
 public void write(List<? extends ClaimantReminder> items) throws Exception {
   for (ClaimantReminder claimantReminders : items) {
     ClaimantReminder claimantReminder =
         ClaimantReminder.findClaimantReminder(claimantReminders.getId());
     boolean verifyClaimantEmail = emailCheckForaClaimant(claimantReminder);
     if (verifyClaimantEmail) {
       causeConditionforSubmitClaimFormType(claimantReminder);
       causeConditionforSubmitSavedDataType(claimantReminder);
       causeConditionforSubmitDocumentsandNIGOType(claimantReminder);
       isValidCheck = causeConditionforcashOutstandingCheckType(claimantReminder);
       validateRemindertoSendEmail(claimantReminder);
     }
     claimantReminder.merge();
   }
 }
 private void generateReminderSentActivity(ClaimantReminder claimantReminder) {
   Activity activity = Activity.setActivityDefaults(new Activity());
   activity.setActivityCode(ActivityCode.CREATED);
   activity.setDescription("Claimant Reminder sent");
   activity.setActivityTypeDescription("Claimant Reminder");
   activity.setClaimant(claimantReminder.getClaimant());
   activity.persist();
 }
 private void causeConditionforSubmitDocumentsandNIGOType(ClaimantReminder claimantReminder) {
   if (claimantReminder.getClaimantClaim() != null
       && claimantReminder.getClaimantClaim().getClaimProofs() != null
       && (claimantReminder.getReminderType().getDescription().equals("Submit for NIGO")
           || claimantReminder.getReminderType().getDescription().equals("Submit Documents"))
       && (claimantReminder.getReminderStatus().toString().equals("Pending")
           || claimantReminder.getReminderStatus().toString().equals("NO_ADDRESS_AVAILABLE"))) {
     List proofstatus = new ArrayList<String>();
     Integer claimproofssize = claimantReminder.getClaimantClaim().getClaimProofs().size();
     Iterator i = claimantReminder.getClaimantClaim().getClaimProofs().iterator();
     while (i.hasNext()) {
       ClaimProof claimproof = (ClaimProof) i.next();
       if (claimproof.getStatus().toString().equals("IGO")) {
         proofstatus.add(claimproof.getStatus().toString());
       }
     }
     if (proofstatus.size() == claimproofssize)
       claimantReminder.setReminderStatus(ClaimantReminder.ReminderStatus.AUTO_RESOLVED);
   }
 }
 public void validateRemindertoSendEmail(ClaimantReminder claimantReminder) {
   if (claimantReminder.getReminderStatus().toString().equals("Pending")
       && claimantReminder.getReminderType().getSendReminder()
       && (claimantReminder.getReminderDueDate().before(new Date())
           || !claimantReminder.getReminderDueDate().after(new Date()))
       && (isValidCheck || isClaimantReminder)) {
     String event = Event.getCurrentEventCode() != null ? Event.getCurrentEventCode() : "";
     String mailSubject =
         event + " - Reminder to " + claimantReminder.getReminderType().getDescription();
     sendReminder(
         claimantReminder.getClaimant().getPrimaryContact().getEmail(),
         getRemindermailcontent(
             isValidCheck,
             isClaimantReminder,
             claimantReminder.getReminderType().getDescription()),
         mailSubject);
     claimantReminder.setReminderStatus(ClaimantReminder.ReminderStatus.COMPLETE);
     generateReminderSentActivity(claimantReminder);
   }
 }
 private void createAwdRipObjectforRejectedReminder(ClaimantReminder claimantReminder) {
   claimantReminder.sendFollowupReminderRip();
 }