I want to define a global variable for a whole job, but as I don't know the Java language, it's hard to find what's wrong. I defined an object tSetGlobalVar_1 where I added a variable with key "filtre" associated with a value "PNOM". But how to use it, for example in a tJava object with a simple println ? Thanks. Thomas
I have a onejob where the tSetGlobalVar component is placed. How do i set a value to key(tSetGlobalVar)n my onejob from my secondJob. Please suggest.
1)In onejob, define a context variable, eg:myVarName(string), set the value of key(tSetGlobalVar) as context.myVarName.
2)In secondJob, use a tRunJob to run onejob, on tRunJob, set value to context variable defined in onejob.
Best regards
Actually i am using the tRunJob to run the secondJob from my oneJob, and inside the secondJob i want to set the VALUE for KEY("FILE_EXISTS") inside the oneJob. I tried putting a code in tJava in secondJob as - globalMap.put("FILE_EXISTS", "TRUE"); But value returned will be null inside oneJob. Please suggest.
For solving these kind of issues, I used java singleton object and placed all the variables those are required in all or most of the jobs. The main job places the values in singleton object and other jobs those are called from main job uses the values placed in the singleton object.
Example : The database credentials are placed in Singleton object and the oher sub jobs uses these database credential placed in Singleton object.
Hope you know what is a singleton object. Incase you do not know what is a singleton object, then please get the information from net.
There is an example job placed at
http://www.talendforge.org/exchange/tos/extension_view.php?eid=156 and it uses singleton object.
I guess your problem will also be solved in case you use Singleton object and the example found at the above URL explanes it clearly.
Thanks and Regards,
Pravu Mishra.
I have a job where data is laoded from a CSV file into a MS SQL Server DB. Data is rejected from both the CSV and DB. I want to have a total count of rejected records. CSV--->DB ----> (rejected) tjavaflex ----> report file | | | tjavaflex----> report file My job will first reject the CSV records and then the DB ones. Can I get the count of Rejected Records and how to use it in tjavaflex component so that after a limit is reached, I end my job