Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello ,
I have a tfilelist component wich read positional files , i want to upsert(create or update) all files of previous month.
In the "RUN if" i wrote this condition :
TalendDate.compareDate(TalendDate.getFirstDayOfMonth(TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM")) , TalendDate.getFirstDayOfMonth(TalendDate.parseDate("yyyy-MM-dd", "mtime_string")), "yyyy-MM-dd")==0
and it will generate this error :
java.lang.NumberFormatException: For input string: "mtim"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at routines.system.FastDateParser$DateParser.parse(FastDateParser.java:127)
at java.text.DateFormat.parse(DateFormat.java:364)
at routines.TalendDate.parseDate(TalendDate.java:928)
at routines.TalendDate.parseDate(TalendDate.java:886)
at local_project.importdonneesventeversionfinalmoisdernier_0_1.ImportDonneesVenteVersionFinalMoisDernier.tFileList_1Process(ImportDonneesVenteVersionFinalMoisDernier.java:1367)
at local_project.importdonneesventeversionfinalmoisdernier_0_1.ImportDonneesVenteVersionFinalMoisDernier.tSalesforceConnection_1Process(ImportDonneesVenteVersionFinalMoisDernier.java:911)
at local_project.importdonneesventeversionfinalmoisdernier_0_1.ImportDonneesVenteVersionFinalMoisDernier.runJobInTOS(ImportDonneesVenteVersionFinalMoisDernier.java:10709)
at local_project.importdonneesventeversionfinalmoisdernier_0_1.ImportDonneesVenteVersionFinalMoisDernier.main(ImportDonneesVenteVersionFinalMoisDernier.java:10471)
Exception in component tFileProperties_1 (ImportDonneesVenteVersionFinalMoisDernier)
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "mtime_string"
at routines.TalendDate.parseDate(TalendDate.java:942)
at routines.TalendDate.parseDate(TalendDate.java:886)
at local_project.importdonneesventeversionfinalmoisdernier_0_1.ImportDonneesVenteVersionFinalMoisDernier.tFileList_1Process(ImportDonneesVenteVersionFinalMoisDernier.java:1367)
at local_project.importdonneesventeversionfinalmoisdernier_0_1.ImportDonneesVenteVersionFinalMoisDernier.tSalesforceConnection_1Process(ImportDonneesVenteVersionFinalMoisDernier.java:911)
at local_project.importdonneesventeversionfinalmoisdernier_0_1.ImportDonneesVenteVersionFinalMoisDernier.runJobInTOS(ImportDonneesVenteVersionFinalMoisDernier.java:10709)
at local_project.importdonneesventeversionfinalmoisdernier_0_1.ImportDonneesVenteVersionFinalMoisDernier.main(ImportDonneesVenteVersionFinalMoisDernier.java:10471)
Caused by: java.text.ParseException: Unparseable date: "mtime_string"
at java.text.DateFormat.parse(DateFormat.java:366)
at routines.TalendDate.parseDate(TalendDate.java:928)
... 5 more
At least you need a data flow after tFileProperties to get the desired property.
Arrange your job like this:
tFlowToIterate is used to get the mtime_string field value as a global variable:
Then for the If trigger, change the condition like this:
TalendDate.compareDate(TalendDate.getFirstDayOfMonth(TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM")) , TalendDate.getFirstDayOfMonth(TalendDate.parseDate("yyyy-MM-dd", (String)globalMap.get("mtime_string"))), "yyyy-MM-dd")==0
Thanks.I resolve the problem.