Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've 2 subjobs (Subjob #1 & #2) whom return values (put in the globalmap) and i want to execute another subjob (Subjob #3) if these values are equals.
I'v tried with the "if" trigger but the third subjob is always played even if values aren't equals.
----
# Subjob #1 : Sales query
tMysqlInput_1 ----- tMap_1 ------ tFileOutputDelimited_1 (myFile.csv)
|
|
|
tAggregateRow_1 ----- tJava_1 (globalMap.put("CA_Ventes",row4.SUM)
# Subjob #2 : Statistics query
tMysqlInput_2 ----- tJava_2 (globalMap.put("CA_Stats",row5.SUM_MONTANT_LIVRE_)
# Subjob #3 : (globalMap.get("CA_Stats") == globalMap.get("CA_Ventes"))? put FTP : Die and call
------
Any idea ?
PS : i use TOS for Data integration v6.5.1.
Thanks.
JCP
Hi,
The problem came from the way i compared my values in the if trigger.
I replace :
globalMap.get("CA_Stats") == globalMap.get("CA_Ventes")
By :
((BigDecimal)globalMap.get("CA_Stats")).compareTo(((BigDecimal)globalMap.get("CA_Ventes"))) == 0
And it works fine.
Thanks !
JCP
Hi,
What are you trying to do in subjob3?
Regards,
Hi,
The subjob #3 puts the file generated by subjob#1on an FTP server.
JCP.
The looks like it should be OK. Can you post a screenshot please and also show the RunIf condition? It might also be interesting to see how you set the globalMap values.
The job :
The second id condition : globalMap.get("CA_Stats") != globalMap.get("CA_Ventes")
The subjob #3 isn't yet designed but i tried with Sendmail and Die components.
Components tJava_2 and tJava_3 put values in the globalmap :
#2 :
globalMap.put("CA_Ventes",row2.SUM);
#3 :
globalMap.put("CA_Stats",row3.SUM_MONTANT_LIVRE_);
Thanks,
JCP
can you please check globalMap assignment working properly ?
Display global value before using in condition.
I tried the same and it's working.
Regards,
I've modified the job because globalmap variables were'nt well assigned.
The component tJava_4 print the variables as shown above in the execution tab.
Variables are equals but the "not" condition is always played.
so issue resolved ? if yes please mark it as solved.
Regards,
Hi,
The problem came from the way i compared my values in the if trigger.
I replace :
globalMap.get("CA_Stats") == globalMap.get("CA_Ventes")
By :
((BigDecimal)globalMap.get("CA_Stats")).compareTo(((BigDecimal)globalMap.get("CA_Ventes"))) == 0
And it works fine.
Thanks !
JCP