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:
Wonderful example application, thanks for sharing.
I didn't see a license file attached to this. I'm working on a project and would like to pretty much use your source code as is - with some minor mods. But in order to do that I really need to have an MIT or Apache 2.0 license for this code. Any chance of having the author clarify?
Hi,
Can any one guide me on getting qmsedx.exe for qlikview version 9 ?
-Anju
Hi,
I got it working in Dev Box where App Server and Publisher server is in the same Box, I changed the config file correctly. I am usinghttp://community.qlik.com/docs/DOC-2650 code for the setup.
In Stage we have diff servers for App and Publisher. I am asked to set EDX in Publisher server. But I am getting the Error "There was no endpoint listening athttp://localhost:4799/QMS/Service that could accept the message.". I am able to ping the App Server from Publisher server properly. And I am using the full App Server path with the correct Port Number in the config file. BTW, the port # I have given in the config file is a different one than 4799 but correct according to the Port # in our Server.
Update: I created/added to Qlikview EDX group in App Server and it is working fine. Pls let know why I am not able to trigger EDX from PubServer.
Other question is --> Is there any way to reference the EDX.exe in App Server from Pub Server?
What could be the issue?
Bestin
Hi,
Im getting the error:
"Failed to create a client to the specified Uri.
The HTTP request was forbidden with client authentication scheme 'Ntlm'."
When I try to run the QMSEDX.exe file.
And the Application Event log tells me that QMSEDX.exe has crashed due to an unhandled exception.
Anyone having similar troubles?
Has anyone been able to compile this for framework 3.5?
Hello,
Thanks for the program. I am getting the following error:
"Failed to start the task due to the following error:NoEDXTriggerFound"
I can query my list of tasks, it even returns "TaskNotFound" if I miss-spell the task. I cannot find the reason for the NoEDXTriggerFound.
I am just testing this atm so am running it from the command line.
Many thanks!
Sorted it, I forgot to add a trigger to the task in QMC, D'oh!
Is this executable file supported by QlikTech?
Thanks.
No
The program has been created and made available to us by someone else - the author of this article I presume (and we are very thankful to him for it)
Having said that, it is very well documented above works without any issues and cant really see the need for too much support and you can always post your issues on the community and in most cases the do get answered promptly.
Other alternative I can think of is to write your own executable using the Qliktech published API (you *might* be able to get some degree of support via your Qliktech contacts) or pay someone else to do it (and get support for it separately from them)
Thanks Alex. Just find there is a nice document and wondering it is done by QT.
Thanks Arthur Lee.