Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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
Sourav_Roy
Contributor II
Contributor II

Hi,

 

Please try again using implementing the below settings in tContextLoad

 

0695b00000GfCHRAA3.jpgAlso,

Alternatively try using ImplicitContextLoad from the below tab:

0695b00000GfCW0AAN.png

Anonymous
Not applicable

Hello,

It looks like there is a problem in the defined variables in the context.

Are your context variables in your job OR a list of context variables in a context group?

You can try is to type your context in your tJava and hit ctrl+space. This will show you a list of autocomplete options. Your available context variables will be in that list.

Here is online related scenario about: TalendHelpCenter: Reading data from different MySQL databases using dynamically loaded connection pa...

Hope it helps.

Best regards

Sabrina

 

gjeremy1617088143

Hi, here the variables you can use for error in tContextLoad :

((String)globalMap.get("tContextLoad_1_ERROR_MESSAGE"))

((String)globalMap.get("tContextLoad_1_KEY_NOT_INCONTEXT"))

((String)globalMap.get("tContextLoad_1_KEY_NOT_LOADED"))

Send me Love and Kudos

 

kakooo16
Creator
Creator
Author

Hello jeremy ,

 

All of these variable print me Null

What component do i have to use and what link ?

kakooo16
Creator
Creator
Author

From File "YOUR_Path" what path exactly ??

gjeremy1617088143

those variables are AFTER variables(they will be accessible after the component was executed),

i think you can use a tjava linked to the tlContextLoad with a oncomponent error link, and you have to set :

if a vairable loaded, but not in the context : error

if a variable in the context, but not loaded : error

in the basic settings of the component.

and if your tContextLoad is named tContextLoad_1 :

in the tJava :

System.out.println(((String)globalMap.get("tContextLoad_1_ERROR_MESSAGE")));

System.out.println(((String)globalMap.get("tContextLoad_1_KEY_NOT_INCONTEXT")));

System.out.println(((String)globalMap.get("tContextLoad_1_KEY_NOT_LOADED")));

kakooo16
Creator
Creator
Author

0695b00000GfNS9AAN.png 

 

Here is the output :

 

0695b00000GfNGaAAN.png 

 

I want just to get the variable that is not loaded by contextLoad

 

Because Costing_Date Variable is an int and when i charge it in tLoadContext with "XXXX" the variable is not loaded correctly

 

I want to get this particular error to the user that added the wrong value 'XXXX'

gjeremy1617088143

path of your context file

kakooo16
Creator
Creator
Author

I'm not defining a group context , i'm declaring variables in context directly how to know the context of job ?