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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Manually firing off the trigger "On Component Error" from a tJavarow

I would like to error out a tJavaRow with a condition in my code,  is that possible to fire off the "On Component Error" with code?
0683p000009MDRp.png
Labels (3)
3 Replies
Anonymous
Not applicable
Author

Hi,
The Java code of the  tJavaRow  will be executed for each row. The  tJavaRow  is normally used as an intermediary component.
For your use case, you can use tJava component which  is used to execute a piece of Java code as a separate subjob in most cases. The Java code will be executed only once.
Best regards
Sabrina
Anonymous
Not applicable
Author

Am I missing something. The answer does not actually answer the question!

I also have a tJavaRow that gets information from a web service for each record that goes through it.

Is I get an error from the web service or it becomes unavailable I want to trigger an alternate execution path through a On Component error.

 

So how do I trigger this On Component error?

akumar2301
Specialist II
Specialist II

Hello

Which component you are using to fetch webservice ? If webservice failes you could attach onComponentError to it.

On tjavarow , you could throw runtime Exception to trigger oncomponenterror
E.g
throw new Exception(“manual error”)
Or int x = 10/a
If error , a=0 otherwise a=1