Source:
public void extractParticipantsInfo(String studyOid, String siteOid, String accessToken, String customerUuid, UserAccountBean userAccountBean, String schema, JobDetail jobDetail,boolean incRelatedInfo) { CoreResources.setRequestSchema(schema); Study site = studyDao.findByOcOID(siteOid); Study study = studyDao.findByOcOID(studyOid); logger.info("Execute method asynchronously. " + Thread.currentThread().getName()); List<StudySubject> studySubjects = studySubjectDao.findAllByStudy(site.getStudyId()); List<OCUserDTO> userDTOS = new ArrayList<>(); sdf_fileName.setTimeZone(TimeZone.getTimeZone("GMT")); String fileName = study.getUniqueIdentifier() + DASH + study.getEnvType() + PARTICIPANT_ACCESS_CODE +"_"+ sdf_fileName.format(new Date())+".csv"; try { for (StudySubject studySubject : studySubjects) { if (!studySubject.getStatus().equals(Status.DELETED) && !studySubject.getStatus().equals(Status.AUTO_DELETED)) { if (studySubject.getStatus().equals(Status.AVAILABLE) || studySubject.getStatus().equals(Status.SIGNED)) { OCUserDTO userDTO = buildOcUserDTO(studySubject,incRelatedInfo); ParticipantAccessDTO participantAccessDTO = getAccessInfo(accessToken, siteOid, studySubject.getLabel(), customerUuid, userAccountBean,true,incRelatedInfo); if (participantAccessDTO != null && participantAccessDTO.getAccessCode() != null && incRelatedInfo) { userDTO.setAccessCode(participantAccessDTO.getAccessCode()); } userDTOS.add(userDTO); } } } writeToFile(userDTOS, studyOid, fileName); } catch (Exception e) { persistJobFailed(jobDetail, fileName); logger.error(" Access code Job Creation Failed "); } persistJobCompleted(jobDetail, fileName); }

Target:
public void extractParticipantsInfo(String studyOid, String siteOid, String accessToken, String customerUuid, UserAccountBean userAccountBean, String schema, JobDetail jobDetail,boolean incRelatedInfo) { CoreResources.setRequestSchema(schema); Study site = studyDao.findByOcOID(siteOid); Study study = studyDao.findByOcOID(studyOid); logger.info("Execute method asynchronously. " + Thread.currentThread().getName()); List<StudySubject> studySubjects = studySubjectDao.findAllByStudy(site.getStudyId()); List<OCUserDTO> userDTOS = new ArrayList<>(); sdf_fileName.setTimeZone(TimeZone.getTimeZone("GMT")); String fileName = study.getUniqueIdentifier() + DASH + study.getEnvType() + PARTICIPANT_ACCESS_CODE +"_"+ sdf_fileName.format(new Date())+".csv"; try { for (StudySubject studySubject : studySubjects) { if (!studySubject.getStatus().equals(Status.DELETED) && !studySubject.getStatus().equals(Status.AUTO_DELETED)) { if (studySubject.getStatus().equals(Status.AVAILABLE) || studySubject.getStatus().equals(Status.SIGNED)) { OCUserDTO userDTO = buildOcUserDTO(studySubject,incRelatedInfo); ParticipantAccessDTO participantAccessDTO = getAccessInfo(accessToken, siteOid, studySubject.getLabel(), customerUuid, userAccountBean,false,incRelatedInfo); if (participantAccessDTO != null && participantAccessDTO.getAccessCode() != null && incRelatedInfo) { userDTO.setAccessCode(participantAccessDTO.getAccessCode()); } userDTOS.add(userDTO); } } } writeToFile(userDTOS, studyOid, fileName); } catch (Exception e) { persistJobFailed(jobDetail, fileName); logger.error(" Access code Job Creation Failed "); } persistJobCompleted(jobDetail, fileName); }