Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
francisco_marti
Contributor III
Contributor III

NPrinting Sept2017: is there a way to trigger a NPrinting task from Qlik Management Console

Hi.

I've got the need to trigger a task in NPrinting once a QMC task is reloaded. It's a task that we reload very frequently during the day.

I could do a task in NPrinting that triggers every few minutes but I think this would cause problems in the performance of NPrinting as the experience with this tool has shown me.

So I need to know if there is a right way to do this.

Recently I've read about this in this article:

STT - Finetuning your NPrinting 17 Deployment

and there it has the same question as me:

Q: Question for 17.4: How can we trigger a NP17 job from QS or QV QMC?

A: currently not available

But I can't believe this is not ready for NPrinting!

Is this really so?

Thank you.

14 Replies
amarti
Partner - Contributor III
Partner - Contributor III

Hi Francisco,

does it work with Qlik Sense too? Or is there another version?

Thanks,

Alessandro

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

It is jus Qlik load script so it works the same in Qlik Sense and QlikView

i built a library to simplify whole task. Details here:

https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

and here

https://nprintingadventures.com/2019/11/28/nprinting-api-qlik-rest-subroutines-v1-1/

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
gbaldwin1971
Contributor
Contributor

Hi Lech, this is a fantastic piece of development and it works a treat. I do however have a question that I hope you can answer. The script assumes that you only have 1 'App' within N Printing, how would I get this to work for multiple 'Apps'?

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

I am replying from my cell phone hence cant check my answer now. From top of my head my script should have app parameter which you can pass individually or in the loop. Passing it in the loop would require you to call one of the subroutines in qlik script loop. 

i will get back to you with example later

 

cheers

lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @gbaldwin1971 

so yeah as expected there is one of the sample "jobs" in library which goes through all apps and all tasks.

"Publish All Tasks from All Applications"

Search for this bit of code:

 

//  Publish All Tasks from All Application                          parameters: [AppNames Array (required),TaskName(optional), ConnectionName(optional), ReloadTimeout(optional)]

        SUB NP_JOB_Reload_N_PublishTask_All(vNPrintingAppsArray,vNPrintingTaskName,vNPrintingConnectionName,vNP_ReloadDuration)

            //  Authenticate
                Call NP_Authenticate;
                Drop Table cookie_items;
            //  Loop through Apps (vNPrintingAppsArray is comma separated list of NPrinting application names wrapped in single quotes - 'App_Name_1,App_Name_2')

                Let vNPrintingAppsArray = CHR(39)&Replace(vNPrintingAppsArray,',',CHR(39)&','&CHR(39))&CHR(39);                

                For each vNPrintingAppName in $(vNPrintingAppsArray)

                    //  Get AppId by Name
                        Call NP_GetAppID('$(vNPrintingAppName)')
                        Drop Table apps_items;
                    //  Get and Reload Connections
                        Call NP_ConnectionReload('$(vNPrintingConnectionName)','$(vNP_ReloadDuration)')
                    //  Get Task 
                        Call NP_GetTasks('$(vNPrintingTaskName)')
                    //  Trigger Tasks
                        Call NP_TriggerTasks
                    //  Clean     
                        Drop tables 
                            task_items
                            ,connection_items
                            ,_post_items
                        ;
                
                Next
        
        ENDSUB

 

  

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.