Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
context.TestVar = "Test Value";
context.setProperty("TestVar ", "Test Value");
context.synchronizeContext();
context.TestDateVar = TalendDate.getCurrentDate();
context.TestVar = "Test Value";
context.setProperty("TestVar ", "Test Value");
context.testValue ="testValue is now initialized";
context.synchronizeContext();
My findings
context.setProperty("mailFileName", "rejected.xlsx");
context.filePath="talend_files_0.1/out/";
//access variable set using setProperty method with getProperty
System.out.println("method1="+context.getProperty("mailFileName"));
System.out.println("method2="+context.filePath);
System.out.println("method3="+context.getProperty("filePath"));
System.out.println("method4="+context.mailFileName);
// after synchronization it outputs right values set without setPropperty and accessed with getProperty. But it //wipes out value set with setProperty after synchronization.
context.synchronizeContext();
System.out.println("method5="+context.getProperty("mailFileName"));
System.out.println("method6="+context.filePath);
System.out.println("method7="+context.getProperty("filePath"));
output
------
method1=rejected.xlsx
method2=talend_files_0.1/out/
method3=
method4=
method5=
method6=talend_files_0.1/out/
method7=talend_files_0.1/out/
method8=
From above scenario i understand that Synchronization sets the values of variables to the latest change made using methos
context.<variable> = value