Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to execute one action or another depending on the result of a tJava component.
If the job runs before 15:00, the trigger (if_10_15) will be executed.
If the job is executed after 15:00, it will be the trigger (if_15_18) that will be executed.
I do not know how to do this. I put an exit in each of my conditions of my tJava (row1.etat) and connected it via a trigger "Run if" containing the conditions if (row1.etat == -1), if (row1.etat == 0) and if (row1.etat == 1).
But I have some errors.
If anyone could show me the right way, it would be nice.
Thank you in advance.
My tJava code :
SimpleDateFormat dateformat = new SimpleDateFormat("hh:mm"); Date hLim = dateformat.parse("15:00"); String pattern = "HH:mm"; Date hNow = new Date(); int etat = TalendDate.compareDate(hNow, hLim, pattern); // Faire passer la valeur de etat en argument au "Trigger Run if" if (etat == -1){ System.out.println(etat + " / " + hNow + " / " + " Tournée demain matin"); row1.etat = etat; } if (etat == 0){ System.out.println(etat + " / " + hNow + " / " + " Tournée demain matin"); row1.etat = etat; } else if (etat == 1){ System.out.println(etat + " / " + hNow + " / " + " Tournée demain après-midi"); row1.etat = etat; }
My job structure :
Try putting the etat variable into the globalMap and reading it in the 'if' connections from there. It might not work as a row variable like you have it.
Thanks a lot for your respons. Everything works now with your solution.