Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello ,
I'm having a problem to get the error caused by setting a wrong value :
Example :
Cost (Integer)
Value Passed : "XXXX"
Here is my output of tLoadContext :
[statistics] connecting to socket on port 4068
[statistics] connected
Setting a value for the key "Cost " has failed. Error message: For input string: "XXXX"
How to get the global Variable that defines the error in the console ?
Hello,
How did you configure your input file with key and value columns?
The parameter Costing_Date Variable should be correspond to the parameter name in the delimited files.
Best regards
Sabrina
it is correct and initialized : 2020
See below screen shot When the user pass Costing_date wrongly ('XXXX') the contextLoad show this error :
Setting a value for the key "Costing_date" has failed. Error message: For input string: "XXXX"
Now , i want to get just this error ? how can i achieve this ?
Here is my job design
and my context is
when i run my job i get this error :
[statistics] connected
Setting a value for the key "Costing_date" has failed. Error message: For input string: "XXXX"
I just want to get this error when i set the key wrong as the example below
So you can do this :
ad a custom string to the java part to see if its ok :
System.out.println("hello" + ((String)globalMap.get("tContextLoad_1_ERROR_MESSAGE")));
System.out.println("hello" + ((String)globalMap.get("tContextLoad_1_KEY_NOT_INCONTEXT")));
System.out.println("hello" + ((String)globalMap.get("tContextLoad_1_KEY_NOT_LOADED")));
if your message in the console is : hello and the error message
you got it.
So you can connect a twarn to the tcontextload instead of tjava with on component error and in the message field of the tmap you set the value of the variable:
ex :(String)globalMap.get("tContextLoad_1_ERROR_MESSAGE")
How to do that ? ad a custom string
just add for example : "hello" + in the println as i mentionned in the post, if all variables are null you 'll see nothing
if one of them is not null you'll see hello followed by your error message in the console