Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to change the value of a context variable and save it permanently in a context file.
Here is what I tried already :
The System.out.println() gives me a "b", but when I go into the file written by the tContextDump component it still prints an "a" :
Thanks for the help.
Hi,
You need to use tContextLoad to update your context, so you need to follow this design:
As you see the context contains 3 variables. tLogRow_45 gives the initial values for them.
In tJavaRow, I set the value of the "sample" variable like this before to use tContextLoad:
output_row.key = input_row.key; if(input_row.key.equals("sample")) output_row.value = "100"; else output_row.value = input_row.value;
Then the next tContextDump gives me the expected result as you can see.
That's for the principle, maybe there is other approach to do that.
Hi,
You need to use tContextLoad to update your context, so you need to follow this design:
As you see the context contains 3 variables. tLogRow_45 gives the initial values for them.
In tJavaRow, I set the value of the "sample" variable like this before to use tContextLoad:
output_row.key = input_row.key; if(input_row.key.equals("sample")) output_row.value = "100"; else output_row.value = input_row.value;
Then the next tContextDump gives me the expected result as you can see.
That's for the principle, maybe there is other approach to do that.