Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
A QlikView Technology White Paper
Published: November, 2011
www.qlik.com
Introduction
Event Driven Execution (EDX) allows the running of QlikView batch jobs based on external events. The primary usage of EDX is to have an external scheduler or Extract,Transform, and Load (ETL) tool (for example, Informatica) run QlikView batch jobs as part of a larger batch process. There are also other use cases, forexample, triggering a QlikView batch when a file arrives and user-initiated batches. This document describes the requirements for each of these three use cases.
The example code (attached below as QMSEDX-v1.exe) and executable (attached below as QMSEDX_CommandLine_v1.exe) that is delivered together with this document uses the new EDX API, which means this document and the example code are useful both when using the EDX functionality for the first time and when migrating from previous versionsof the EDX API.
Use Cases
Using an External Scheduler or ETL Tool
Many large organizations have other batch requirements than just QlikView. Such organizations often use a standard tool to run all batch processes, so that the IT training costs are minimized and common operations (for example, logging and re-launching) are handled in one central place. In addition, QlikView batch processing is almost always reliant on new data being available and in many cases this data is created by other batch processes. An external scheduler or ETL tool can be used to prepare the data and then run the QlikView batch to load it.
Most scheduler and ETL tools are designed to run external batch programs via a command line interface. The reasons for this include:
The main alternative to using a command line tool is using some sort of web services. Unfortunately,web calls cannot be used for long-running processes, since a timeout eventually occurs. A common solution to this problem is to start the process with a web request and then follow it up regularly with subsequent requests to find out if the original request has finished successfully or not.
File Arrival Detection
In many IT departments, the inter-system communication is not orchestrated by ETL or even Enterprise Application Integration (EAI) tools. Instead, files are pushed. For example, a non‑QlikView batch job that extracts data from a production database is typically owned by the IT team running the database, which means the team is responsible for creating and configuring the batch job and ensuring that it runs correctly.On the QlikView side, a program that checks if a file has arrived must be running, so that the file can be used in a subsequent QlikView batch.
In this scenario, simply starting the QlikView batch process should be enough. There is no need to follow its execution. The program is typically a Windows service as it runs all the time.
User-initiated Action
TheQlikView Automation API provides a number of functions that run QlikView batch scripts, for example, Document.Reload(). However, it is normally not a good idea to let users run batch jobs, since a QlikView batch job typically replaces the entire data set of an application used by many users.This means a single user can interfere with the work of all the others unless the QlikView batch is carefully configured. Because of this, the batch functionality is disabled in a QlikView Server deployment.
EDX in QlikView 11
In QlikView 11, EDX runs through the QlikView Management Service (QMS) API. This is a major change from QlikView 10, where EDX is realized by calls directly to a QlikView Distribution Service (QDS). The QMS API is a web service API that uses theSimple Object Access Protocol (SOAP). Client applications make HTTP (web) requests to QMS on port 4799. The system is secured by NT LAN Manager (NTLM) as well as special protective measures to avoid certain types of hijacking attacks known as “time limited service key”. This combination of security means the client application must be written in .NET and therefore the provided example code is .NET projects/solutions developed in Microsoft Visual Studio 2010.
The client application uses NTLM to authenticate a Windows account to QMS. QMS then checks which Windows groups the Windows account for the client application is member of to determine the function calls the user is allowed to make. Most of the QMS API requires membership in a local group called “QlikView Management API”, but to run EDX, a separate group, “QlikView EDX”, should be used. Both groups are local Windows groups on the server where QMS runs.
The client application makes calls to instruct QMS to start a task and in return receives an error code indicating success or failure, as well as an execution ID. The execution ID uniquely identifies the execution of the task as opposed to the task itself. The client application then periodically polls QMS to check the progress of the task execution. This poll request returns a data structure that contains, among other things, the execution status, start time, stop time (if already finished), and a list of new execution IDs. These subsequent execution IDs represent the execution of tasks that are triggered because the initial task has finished. The client application can then follow an entire set of inter-related tasks that together make up a full parallelized batch flow.
Lastly, the example code outputs log information and returns an error code to the operating system. The error code can be recovered in a standard way, for example, by using the %ERRORLEVEL% environment variable in a BAT file.
Changes Compared to Previous Versions
From a functionality perspective, the following has changed compared to using EDX in QlikView 10:
Notes on Using the QMS API
Finally,some notes on using the QMS API in QlikView 11:
Hello Friends,
I am crying for some help but no clues, I am looking for a solution in an urgent basis,
Kindly let me know your suggestions!!
I tried the procedures as provided with this forum to implement EDX in our QV Publisher but I am getting an error as follow
I done the following:
1) I created a .bat file with content and saved it in a shared folder in server:
D:\QLIKVIEW.FOLDERS\APPLICATIONS\DATA\SHAREDDATA\QMSEDX.exe -task="D:\QLIKVIEW.FOLDERS\APPLICATIONS\SOURCEDOCUMENTS\Sales.qvw" -qms=http://servername:4799/QMS/Service -password="123"
2) Placed QMSEDX.EXE in a shared folder in server
3) Placed QMSEDX.exe.config in a shared folder in server--> changed the localhost to our server name with in it.
4) Created a QlikView application in Server with a button and launched the .bat file created.
When I click the button in the application it is giving the error as "There is no end point listening at http://servername:4799/QMS/SERVICE:4799/QMS/SERVICE that could accept the message. This could often caused by incorrect address or soap action, see inner exception for more details.
Error while starting the task with id/name = D:\QLIKVIEW.FOLDERS\APPLICATIONS\SOURCEDOCUMENTS\Sales.qvw retries=3
Kindly let me know your suggestions!!
Kind regards,
Kiru
Kiru
You need to use the name of the QMC Task for the -task= parameter not the name of the QVW file. So your bat script has a line like
QMS.EDX -task="NameOfTaskInQMC" -qms=http://servername:4799/QMS/Service -password="123"
Hi Paul,
I appreciate your time. Finally I can able to run the appln in the server
but when I try to do it via access point :
after clicking the reload button,it is giving an error as "Access Denied" to the edx_file.bat file
Can anyone please let me know any suggestions to overcome it??
Kind regards,
Kiru
Kiru
Sorry I picked up on what looked like and obvious error in your script line example.
In fact seeing as your error is like "There is no end point listening..." it sounds more to do with the way the QMS service is setup or how you are referring to it. Please make sure the URL you use in the QMSEDX.EXE call matches the address setup for your QMS service.
See an earlier post on this thread from Bestin Jacob dated Jan 15, 2013. He had the same error and found that he was using the wrong port number.
Paul,
I sincerely appreciate your help!!
Finally the application is running in server i.e, when I click the reload button it is launching to .bat file and running the task as expected.
But when I click the reload button via access point it is giving access denied to the .bat file.
I am using a .bat file with the content as below for your refernece:
D:\QLIKVIEW.FOLDERS\APPLICATIONS\DATA\SHAREDDATA\QMSEDX.exe -task="Salestask" -password="123"
Can I kindly have your valuable suggestions?
Thanks,
Kiru
Kiru,
Did you setup the access permissions to the shared folder? I suppose you have to include the QV service account. (just a guess...)
Hi arthur,
Can we have a EDX trigger where a particular database is updated with new data and after it a qvw file should be reloaded(excuse if it silly , I am very new to this area).If so what are steps I have to go through,
Is there any need of writing a batch file.
Hi,
I'm looking for a procedure to read the status of QEMC tasks, before deciding to reload a certain document.
I was analysing various discussions here in Qlik Community and I found out codes for macro aimed to send http request to qds and save result on xml doc (http://community.qlik.com/message/294718#294718 or http://community.qlik.com/thread/52977). However I see many things has changed with qlikview 11, reading this article: a http request must be send to qms through a different port and, I guess (please correct me if I misunderstood), methods like GetTimeLimitedRequestKey() are no more secure because of NTLM control.
I downloaded the materials attached with the article but I know nothing about visual studio, can someone guide me to find in QMSEDX material what i'm looking for, that is a way of monitoring status task? And can I still do something in macro, avoiding external applications?
Thank you so much
IB
Hello Arthur,
Very Good documentation. This helped to understand more in detail of EDX.
I tried using the above code in QMSEDX_v1.exe in VS2010, and changed the
endpoint address="http://XXX:4799/QMS/Service" with my server name.
Also in the code at 1 place "static private Uri _qms with the same server name."
But when I execute the application, I get below error
"The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'."
What is this error exactly and what more change do I need to do?
I'm sure that this topic has been beaten like a dead horse, however, after doing extensive research, I still couldn't find an answer to my question. So pretty much, here's the scenario that I'm facing.
We have a Qlikview Server and Publisher and I would like to create a .bat file or trigger file, or something that that our external job program would call on, to process a task in the Qlikview Management Console. The reason being is that we have other jobs that populate our tables that Qlik pulls from, and those tables are populated inconsistently (maybe after around 10am on some days after3pm).
By creating a .bat/trigger file, our goal is to call on it and create another job that will have dependecies on the tables, meaning the tables will need to be populated first, before it gets kicked off. Any ideas or suggestions?
I have done some reading regarding EDX, but from what I have gather, most folks are using a web interface or a button that they click on manually, which will not work for us. If someone could point me in the right direction, I'd appreciate it.
Thanks!