Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
kakooo16
Creator
Creator

How to get the error of tContextLoad

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 ?

Labels (2)
15 Replies
Anonymous
Not applicable

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

 

 

kakooo16
Creator
Creator
Author

it is correct and initialized : 2020

 

See below screen shot 0695b00000GfNhEAAV.pngWhen 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 ?

kakooo16
Creator
Creator
Author

Here is my job design

 

0695b00000GfNkrAAF.png 

0695b00000GfNluAAF.png 

and my context is

 

0695b00000GfNUuAAN.png 

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

 

gjeremy1617088143

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")

kakooo16
Creator
Creator
Author

How to do that ? ad a custom string

gjeremy1617088143

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