Hi, i want to set value to Context Variable dynamically and require to use that context variable in number of jobs say for example: for example: context.date = date This variable(context.date) required to use in many jobs, can you please let me know how to implement this. i have tried below option it works only for corresponding job.
Hello kambham There is a component called tContextLoad which allows you to set context variables dynamically. It enable syou to read values from e.g. a file or DB and load them into the context. The schema which you need to give to tContextLoad is simply 2 strings: "key" and "value". It also allows you to add new variables. There is also the tContextDump component which allows you to dump the context for review. Hope this helps.
Hi, Thanks for your quick response. As per your email i developed job to read date value from file and load them into the context using tContextLoad, see the below screen shot for your reference and result after executing job. Starting job tcontext at 12:04 21/04/2016. connecting to socket on port 3346 connected tContextLoad_1 set key "date" with value "20151120" disconnected Job tcontext ended at 12:04 21/04/2016.
But when trying to use this context value(date)-20151120 in another job, it passing null value instead of context value. Can you please suggest weather my approach is correct or not?
Can you put a screenshot up of your job structure please? You say "But when trying to use this context value(date)-20151120 in another job, it passing null value instead of context value.". Does that mean that you are trying to pass the context variable to a child job?
But how are you calling (starting) those jobs (1,2,3,etc) after the context variable has been set? You have to consider context variables to have a lifespan of an individual job, unless you actively pass them to a child job or write them to a file/db to be used elsewhere. You can't just set them in one job and expect them to be available in a disconnected job without doing anything
Once you've loaded your Context, you can pass it through tRunJob either individually or by checking "Transmit whole context". You do need to add the context variables to each Job that needs to reference them.