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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Trigger another job, when tSystem output has certain text

Hi talend team,
I want to trigger a stored procedure, when I run in tSystems an external perl script, which finishes successfully.
This is the output of the perl script in the tSystem component:
Start loading data at: 2008-04-17 10:46:23
Preparing load of data in /path/to/file/file.TXT:

Records inserted: 672
Finished loading data at: 2008-04-17 10:46:24

So I used an If-Trigger connection and I tried this:
((String)globalMap.get("tSystem_1_OUTPUT")) =="Finished loading data"

But nothing happens ...
I guess you will suggest me to use regex, but I couldn't figure out how to use it.
Labels (2)
5 Replies
Anonymous
Not applicable
Author

You can execute regex with:
((string)globalMap.get("tSystem_1_OUTPUT"))).matches("Finished loading data")

For more information:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html
Hope this helps.
Bye
Volker
Anonymous
Not applicable
Author

Thanks Volker,
but I have no experience using regexp and I couldn't get it work. I added a screenshot of my job, where you can see the configuration of the if-trigger connection.
But I get the following error message, when I run this job:
Starte Job IMPORT_LPEX2_TO_DB am 09:58 18/04/2008.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
string cannot be resolved to a type
at inpower.import_lpex2_to_db.IMPORT_LPEX2_TO_DB.tFileList_1Process(IMPORT_LPEX2_TO_DB.java:373)
at inpower.import_lpex2_to_db.IMPORT_LPEX2_TO_DB.runJobInTOS(IMPORT_LPEX2_TO_DB.java:1386)
at inpower.import_lpex2_to_db.IMPORT_LPEX2_TO_DB.main(IMPORT_LPEX2_TO_DB.java:1305)
Job IMPORT_LPEX2_TO_DB endet am 09:58 18/04/2008.

Any suggestions
0683p000009MC4b.png
Anonymous
Not applicable
Author

I think string should be String.
Anonymous
Not applicable
Author

Sorry. Yes, string should be String.
I'm not a "regex-master" for java (each implementation is a little bit different).
You have to take care about the following two things:
matches() matches the whole string. So you need something like: ".*Finished loading data.*"
And you have a multiline string. I don't know if there are any specialties for that.
Bye
Volker
Anonymous
Not applicable
Author

Thanks that helped.
Marko