Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tSystem

I am using tSystem to run a Python script.

I am trying to use tSystem_1_EXIT_VALUE to know if the script was able to run. In the Python script, i have added a divided by zero which makes the script fails. On the console, I see the error output. I have tried to print the result by using tJavaRow (   System.out.println(((Integer)globalMap.get("tSystem_1_EXIT_VALUE")));    ) but I always get null!

I want to do a RunIf with the boolean output of EXIT_VALUE.

 

PS In tSystem, I did set up the output to both Console and Global Variable.

 

Thanks in advance 0683p000009MACn.png

 

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi sboivin,

 

Do not use tJavaRow, use tJava.

 

I have provided the flow below, please follow as directed.

 

tSystem -> Run IF (condition is : "true") -> tJava -> Run If (Condition is : ((Integer)globalMap.get("tSystem_1_EXIT_VALUE"))==1) -> tSendMail

 

0683p000009M5QH.jpg0683p000009M5NN.jpg0683p000009M5RP.jpg

 

Thanks and regards,

Subhadip

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hello,

 

tSYstem EXIT VALUE is an after variable an tJavaRow is used in Flow manner. Therefore you will always have null when you print in tJavaRow. Use tSystem ->runIf(true)->tJava and then Sysout to print the EXIT_VALUE.

 

Thanks and Regards,

Subhadip

Anonymous
Not applicable
Author

Thank 

You mean straight from tSystem to do a RunIf with 

 

((Integer)globalMap.get("tSystem_1_EXIT_VALUE"))==1

I tried but the condition disappears from the If.

 

Basically, I want to use tSendMail to send an email if the script fails.

 

 

 

Anonymous
Not applicable
Author

Hi,

 

use like this :

 

tSystem -> Run IF (condition is : "true") -> tJava -> Run If (Condition is : ((Integer)globalMap.get("tSystem_1_EXIT_VALUE"))==1) -> tSendMail

 

Thanks and regards,

Subhadip

Anonymous
Not applicable
Author

I am not able to do a RunIf on the tJavaRow, I get the 'not' sign. But then again do I really need it? I was just using it for debug purpose.

When I do the RunIf from tSystem to tSendEmail, I get an error, I am not able to save the condition.

Is it because I need to declare the variable in tSystem? I didn't do anything since it was a global variable in the description of tSystem.

Anonymous
Not applicable
Author

Hi sboivin,

 

Do not use tJavaRow, use tJava.

 

I have provided the flow below, please follow as directed.

 

tSystem -> Run IF (condition is : "true") -> tJava -> Run If (Condition is : ((Integer)globalMap.get("tSystem_1_EXIT_VALUE"))==1) -> tSendMail

 

0683p000009M5QH.jpg0683p000009M5NN.jpg0683p000009M5RP.jpg

 

Thanks and regards,

Subhadip

Anonymous
Not applicable
Author

Thanks Subhadip, it works 0683p000009MACn.png

I didn't see the tJava previously! Thanks for your help.