Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Abrie_M
Contributor III
Contributor III

Trigger a windows task once a Replicate task has completed successfully

Good day

We have a requirement to trigger another process once a Replicate full load has completed successfully. 

I can only think of using the command line options (gettaskstatus) and once the status is stopped with no error tables, to then trigger a next process.

 

Any other suggestions?

 

Thanx

Abrie

Labels (2)
1 Solution

Accepted Solutions
lyka
Support
Support

Good Day!

Using repctl commands or using QEM APIs, you can develop a script that will check for the current task status . 

 

Please refer to the QEM APIs'

https://help.qlik.com/en-US/enterprise-manager/November2021/Content/EnterpriseManager/EnterpriseMana...

https://help.qlik.com/en-US/enterprise-manager/November2021/Content/EnterpriseManager/EnterpriseMana...

 

thanks

Lyka

View solution in original post

4 Replies
KellyHobson
Support
Support

Hey @Abrie_M ,

Another idea is to have a notification set up for when the full load completes. This way you would not have to keep running gettaskstatus over and over. 

Server -> Notifications -> Task Events -> Processing Status -> Full Load Completed

Then configure the email to trigger the next process:

https://www.firstpost.com/tech/news-analysis/how-to-trigger-an-application-via-email-in-outlook-3614...

Best,

Kelly 

lyka
Support
Support

Good Day!

Using repctl commands or using QEM APIs, you can develop a script that will check for the current task status . 

 

Please refer to the QEM APIs'

https://help.qlik.com/en-US/enterprise-manager/November2021/Content/EnterpriseManager/EnterpriseMana...

https://help.qlik.com/en-US/enterprise-manager/November2021/Content/EnterpriseManager/EnterpriseMana...

 

thanks

Lyka

Abrie_M
Contributor III
Contributor III
Author

Thanx for the feedback. Our BI team will be using Automic as a scheduling tool, so they will probably have to check the task status using the API's.

Heinvandenheuvel
Specialist II
Specialist II

@Abrie_M I think that's the right choice. Nobody likes 'polling' but at the end of the day it's not that big a deal.

There is perhaps a opportunity for end-of-load-action option. Start a command on replicate server, create a file with status on replicate server, dump a row in a control table on target, execute some sql on target whatever. Right now the only choice appears to be to stop or not.

Using the API (REPCTL command line, or properly through Enterprise Manager) there is more information and just loading/done. When there are issues the polling loop can report on excessive load times, excessive tables in error count and check progress in general and looking at the task_status. There will be data elements like:

full_load_completed_tables_count, full_load_loading_tables_count, full_load_queued_tables_count,
full_load_error_tables_count;

full_load_completed, full_load_start_time, full_load_finish_time;

There are alternatives. For example one could poke at the <data>/tasks/<taskname>task_tables.sqlite database and check the (single) row in the load_status table. Of course that's unsupported and might change... but it hasn't for 10 years now and it won't 🙂 (Famous last words).

The optional attrep_history table in the target database also has a little potential, but it is probably not updated often enough and not enough detail in the timeslot_type = "FULL LOAD" rows.

For some applications it is even useful to scan the repsrv.log and reptask__<taskname>,log files. That can show you when a task started and stopped, and you could scan for errors and count tables as they are loaded but somewhat surprisingly there is no simple 'load completed for all tables' in there. Ditto for the MetricsLog.txt file in the <logs>/metrics directory.

UPDATE: There will be a clear message in the reptask log "Stop task after full load finished", and general stop messages in repsrv.log and metrics IF you allow the task to stop. By chance I tested with a task  with no active selection under "Stopping the Task after Full Load - After Full Load  completes, stop the task: " under fullload setting under task settings. my bad.

Hein.