Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have a Qlik Sense file in which I'm triggering an Nprinting task
script runs successfully and the nprinting task is triggered
what I want is to know from Qlik Sense if the task failed or ran successfully
kindly advise on how to achieve this
Hi @ali_hijazi
I have already implemented this in my NPrinting.qvs
https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/
Have a look at the "NP_GetExecutionDetails" sub as it is all there ready to use.
cheers
You may be able to achieve that requirement by setting up and configuring Qlik Alerting.
https://help.qlik.com/en-US/alerting/Content/QlikAlerting/system-alerts.htm
NPrinting, as you may know already, does not have built in alerting capabilities. You need to manually review the executions page for execution activity.
For question around Qlik Alerting, please visit: https://community.qlik.com/t5/Alerting/bd-p/qlik-alerting-discussions
Kind regards...
but what I want is to be able to listen if there is a failure in Nprinting task in the script
@ali_hijazi NPrinting does not have this capability in the product.
Hi @ali_hijazi
I have already implemented this in my NPrinting.qvs
https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/
Have a look at the "NP_GetExecutionDetails" sub as it is all there ready to use.
cheers
Hello @Lech_Miszkiewicz
I used your script in Nprinting.qvs
I'm able to trigger the desired task
but inside the sub which is NP_GetExecutionDetails
the below lines give error (which are inside the loop)
actual when you read data resident RestNPExecutionsTable I get table not found
RestNPExecutionsTable:
SQL SELECT
"id",
"result",
"progress",
"status",
"completed"
FROM
JSON (wrap off) "data"
WITH
CONNECTION( URL "$(vExecutionURL)", HTTPHEADER "cookie" "$(vCookie)", QUERY "Limit" "$(vQuery_Limit)")
;
executions:
LOAD
id as execution_id,
result as execution_result,
progress as execution_progress,
status as execution_status,
completed as execution_completed
RESIDENT
RestNPExecutionsTable
WHERE
id='$(zLastExecution)'
;
DROP TABLE RestNPExecutionsTable;
Hi @ali_hijazi
This load script screenshot looks strange as it seems to be straight after authentication and obtaining a cookie. Normally you would need to trigger task, get that task ID and pass it to the executions so you can trace its status.
Have you inspected load script log? I have put many TRACE statements to ensure as much traceablity as possible. In the query there should be zLastExecution variable populated with last execution ID. Is your script resolving this variable?
The other thing is how many executions you are running at once?
well yes the zLastExecution was giving empty string
but now it works
a question
what would be the value of vExecutionStatus if the task is aborted or failed
cause I want to check if the task failed I need to throw an exception saying the task failed or was aborted
so that the script doesn't continue to execute
kindly advise
Hi @ali_hijazi
I have cut corners here and only set the rules for couple statuses.
You need to add your own script to handle particular status for wahtever status you wish to capture: