I have two string values in my benchmark test in Eclipse. Provided that one of them is empty. Users can be used to log in and log out.
I want to assign a null value as not every User has a departure date.
I will use my engineering work in sail point software.
ECLIPSE
public static void main(String[] args) {
// TODO Auto-generated method stub
DateTimeFormatter sdf = DateTimeFormatter.ofPattern("dd/MM/yyyy");
String tarihEnd= null;
String tarihStart = "18/01/2023";
try {
if (tarihEnd !=null || tarihStart!=null)
{
LocalDate jobLeavingDay = LocalDate.parse(tarihEnd,sdf);
LocalDate jobStartingDay = LocalDate.parse(tarihStart,sdf);
LocalDateTime beginDate = jobLeavingDay.atTime(8, 00);
LocalDateTime endDate = jobLeavingDay.atTime(16, 30);
LocalDateTime nowDateTime = LocalDateTime.now();
if(nowDateTime.compareTo(beginDate)==1 && nowDateTime.compareTo(endDate)==-1)
System.out.println("False1");
else if(jobLeavingDay.compareTo(nowDateTime.toLocalDate())<0 && jobStartingDay.compareTo(nowDateTime.toLocalDate())<0) // jobleaving and jobstarting < nowdatetime = true
System.out.println("True1");
else if (jobStartingDay.compareTo(nowDateTime.toLocalDate())<0 && jobLeavingDay.compareTo(nowDateTime.toLocalDate()) >0)
System.out.println("False2");
else if (jobStartingDay.compareTo(nowDateTime.toLocalDate())>0)
System.out.println("True");
else if (jobStartingDay.compareTo(nowDateTime.toLocalDate())<0)
System.out.println("False3"); //jobleaving null, jobStarting_NowDate den once gelirse
}} catch (Exception e) {
tarihStart=null;
tarihEnd=null;
}
}
}
SAILPOINT
Identification is done here. Extracts information from csv file.
Example: The actual value of the user who will start work on 20/12/2022 should be true.
But even if I put the > sign or give isAfter it gets false value every time.
What is the point to be edited here?
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import sailpoint.object.*;
DateTimeFormatter sdf= DateTimeFormatter.ofPattern("dd/MM/yyyy");
Attributes attrs = link.getAttributes();
String tarih = attrs.getString("JobLeaveDate");
String tarih2 = attrs.getString("JobStartDate");
try{
if(tarih!=null || tarih2!=null {
LocalDate jobLeavingDay = LocalDate.parse(tarih, sdf);
LocalDate jobStartingDay = LocalDate.parse(tarih2, sdf);
LocalDate nowDate = LocalDate.now();
//LocalDateTime beginDate = jobLeavingDay.atTime(8, 00);
// LocalDateTime endDate = jobLeavingDay.atTime(16, 30);
// LocalDateTime nowDateTime = LocalDateTime.now();
if (jobStartingDay.compareTo(nowDate)>0)
stat="True";
else if (jobStartingDay.compareTo(nowDate)<0)
stat="False";
} } catch (Exception e) {
tarih=null;
}
return (stat)