9
Using EDX in QlikView 11 http://community.qlik.com/docs/DOC- 2650 creado por Arthur Lee el 23-nov-2011 16:15, modificado por última vez por Arthur Lee el 18-ago-2013 13:55 Versión 11 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

Using EDX in QlikView 11

Embed Size (px)

Citation preview

Using EDX in QlikView 11

http://community.qlik.com/docs/DOC-2650

creado por Arthur Lee el 23-nov-2011 16:15, modificado por ltima vez por Arthur Lee el 18-ago-2013 13:55 Versin 11 A QlikView Technology White PaperPublished: November, 2011www.qlik.comIntroductionEvent 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 CasesUsing an External Scheduler or ETL ToolMany 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: Batch processes are long-running, so starting aseparate process to handle them provides a simple way for the scheduler tomonitor the batch processes. The scheduler can be configured to run the batchusing a particular operating system account that provides the required securitycontext. If the batch process fails, the standard operatingsystem error handler can be used to pass this information back to the scheduleror ETL tool.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 DetectionIn 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 nonQlikView 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 ActionTheQlikView 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. The marketing department at a pharmaceutica lcompany has an organizational division between the analysts and the product managers. The analysts are in charge of loading a dozen external data sources of varying quality. Once the data relating to a particular product is ready, the running of a QlikView batch loads the data and publishes the application to the relevant product managers. A software company with thousands of employees wants each employee to have access to their sales data up to the last 30 minutes. The computer resources needed to support such data usage are massive. Since the salespeople only use the system once a week on average, it is decided to allow each user to run a QlikView batch to generate a QVW (for the user)whenever needed. EDX in QlikView 11In 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 VersionsFrom a functionality perspective, the following has changed compared to using EDX in QlikView 10: Because communication is with QMS instead of QDS, a QDS cluster can be used to load balance EDX calls. If high availability is required for the batch environment, QMS is a single point of failure. Consider either virtualization of QMS or an active/passive system. The overall success or failure code of aQlikView batch can be returned. Previously, the status of the task could be fetched (that is, the definition of the batch job), but not the execution ofthe batch job. The execution of subsequent tasks can be followed.Notes on Using the QMS APIFinally,some notes on using the QMS API in QlikView 11: The EDX password must not be null. Use an empty string, if no password is configured. The QDS ID is required in the function call that starts the EDX batch job. However, higher-level privileges than membership in QlikView EDX are required to get a QDS ID. The simple solution is to pass an empty GUID for the QDS ID, which means QMS will search for the task in all configured QDS instances. Almost all projects today only have one logical QDS configured, so this can be a useful solution. EDX can be used without a QlikView Publisher license. Simply pass the name of the QVW instead of a task name and the reloadschedule of the QVW will run.

Puntos Creado Por Arthur Lee el 23-nov-2011 16:15, Modificado por ltima Vez Por Arthur Lee el 18-ago-2013 13:55 Versin 11 Una Tecnologa Libro Blanco QlikViewPublicado: noviembre de 2011www.qlik.comIntroduccinEvent Driven Ejecucin (EDX), permite la ejecucin de trabajos por lotes de QlikView en base a los acontecimientos externos. El uso principal de EDX es tener un programador o Extract externo, transformacin y carga (ETL) (por ejemplo, Informatica) ejecutar trabajos por lotes de QlikView como parte de un proceso por lotes grandes. Hay tambin otros casos de uso, porejemplo, provocando un lote de QlikView cuando un archivo llega y lotes iniciadas por el usuario. En este documento se describen los requisitos para cada uno de estos tres casos de uso.El cdigo de ejemplo (que se adjunta a continuacin como QMSEDX-v1.exe) y ejecutable (que se adjunta a continuacin como QMSEDX_CommandLine_v1.exe) que se entrega junto con este documento se utiliza la nueva API EDX, lo que significa este documento y el cdigo de ejemplo son tiles tanto cuando se utiliza el funcionalidad EDX por primera vez y cuando se migra de anteriores versionsof la API EDX.Casos de usoEl uso de un programador externo o herramienta ETLMuchas grandes organizaciones tienen otros requisitos de proceso por lotes que acaba de QlikView. Tales organizaciones a menudo utilizan una herramienta estndar para ejecutar todos los procesos por lotes, por lo que los costos de capacitacin de TI se reducen al mnimo y las operaciones comunes (por ejemplo, la tala y relanzamiento) se manejan en un lugar central. Adems, el procesamiento por lotes QlikView es casi siempre dependiente de estar disponibles nuevos datos y, en muchos casos estos datos se crea por otros procesos por lotes. Un planificador o ETL herramienta externa se puede utilizar para preparar los datos y ejecute el lote QlikView para cargarlo.La mayora de herramientas del programador y ETL estn diseados para ejecutar programas de lotes externos a travs de una interfaz de lnea de comandos. Las razones para esto son: Procesos por lotes son de larga duracin, por lo que a partir aseparate proceso de manejar les proporciona una forma sencilla para el programador tomonitor los procesos por lotes. El programador se puede configurar para ejecutar el batchusing una cuenta de sistema operativo en particular que proporciona la SecurityContext necesario. Si el proceso por lotes falla, el controlador de errores operatingsystem estndar puede ser utilizado para pasar esta informacin a la herramienta de ETL scheduleror.La principal alternativa al uso de una herramienta de lnea de comandos se utiliza algn tipo de servicios web. Por desgracia, llamadas web no puede ser utilizado para procesos de larga ejecucin, ya que se produce un tiempo de espera, finalmente. Una solucin comn a este problema es comenzar el proceso con una peticin web y luego seguir regularmente con las solicitudes posteriores para determinar si la solicitud original ha finalizado con xito o no.Deteccin del archivo de llegadaEn muchos departamentos de TI, la comunicacin entre sistemas no es orquestada por ETL o incluso integracin de aplicaciones empresariales (EAI), herramientas. En su lugar, los archivos son empujados. Por ejemplo, un trabajo por lotes no QlikView que extrae datos de una base de datos de produccin suele ser propiedad del equipo de TI ejecutar la base de datos, lo que significa que el equipo es responsable de la creacin y configuracin del trabajo por lotes y la garanta de que se ejecute la correctly.On QlikView lado, un programa que comprueba si un archivo ha llegado debe estar en ejecucin, de modo que el archivo se puede utilizar en un lote QlikView posterior.En este escenario, simplemente iniciar el proceso por lotes QlikView debera ser suficiente. No hay necesidad de seguir su ejecucin. El programa es tpicamente un servicio de Windows que se ejecuta todo el tiempo.Accin iniciada por el usuarioAPI TheQlikView Automation proporciona una serie de funciones que se ejecutan secuencias de comandos por lotes QlikView, por ejemplo, Document.Reload () . Sin embargo, normalmente no es una buena idea dejar que los usuarios ejecuten los trabajos por lotes, ya que un trabajo por lotes QlikView normalmente reemplaza el conjunto de datos de una aplicacin utilizada por muchos users.This significa un solo usuario puede interferir con el trabajo de todos los dems a menos que el lote QlikView est configurado cuidadosamente. Debido a esto, la funcionalidad de proceso por lotes est desactivado en una implementacin de QlikView Server. El departamento de marketing de una lcompany pharmaceutica tiene una divisin organizativa entre los analistas y los directores de producto. Los analistas estn a cargo de la carga de una docena de fuentes de datos externas de diversa calidad. Una vez que los datos relativos a un determinado producto est listo, el funcionamiento de un lote QlikView carga los datos y publica la solicitud a los gerentes de producto de referencia. Una compaa de software con miles de empleados quiere que cada empleado tenga acceso a sus datos de ventas hasta los ltimos 30 minutos. Los recursos informticos necesarios para apoyar esa utilizacin de los datos son enormes. Dado que los vendedores slo utilizan el sistema una vez por semana, en promedio, se decidi permitir que cada usuario ejecute un lote QlikView para generar un QVW (para el usuario) cuando sea necesario.EDX en QlikView 11En QlikView 11, EDX corre a travs de la API de Servicio de Gestin de QlikView (QMS). Este es un cambio importante de QlikView 10, donde EDX se realiza mediante llamadas directamente a un servicio de distribucin de QlikView (SCD). El API QMS es una API de servicios web que utiliza el Protocolo de acceso a objetos theSimple (SOAP). Las aplicaciones cliente hacen HTTP (web) peticiones a QMS en el puerto 4799. El sistema est garantizado por NT LAN Manager (NTLM), as como las medidas de proteccin especiales para evitar ciertos tipos de ataques de secuestro conocidos como "llave de servicio limitado de tiempo". Esta combinacin de seguridad significa que la aplicacin cliente debe estar escrito en. NET, por lo que el cdigo de ejemplo proporcionado es proyectos / NET soluciones desarrolladas en Microsoft Visual Studio 2010..La aplicacin cliente utiliza NTLM para autenticar una cuenta de Windows al SGC. QMS comprueba entonces que los grupos de Windows de la cuenta de Windows para la aplicacin cliente sea miembro de determinar la funcin llama el usuario est autorizado a hacer. La mayor parte de la API de QMS requiere la pertenencia a un grupo local llamado "API de administracin de QlikView", pero para ejecutar EDX, un grupo separado, se debe utilizar "QlikView EDX". Ambos grupos son grupos locales de Windows en el servidor donde se ejecuta QMS.La aplicacin cliente realiza llamadas para instruir QMS para iniciar una tarea y, a cambio recibe un cdigo de error que indica el xito o el fracaso, as como una identificacin ejecucin. El ID de ejecucin identifica de forma nica la ejecucin de la tarea en lugar de la propia tarea. La aplicacin cliente sondea peridicamente QMS para comprobar el progreso de la ejecucin de la tarea. Esta solicitud encuesta devuelve una estructura de datos que contiene, entre otras cosas, el estado de ejecucin, hora de inicio, hora de parada (si ya est terminado), y una lista de los nuevos identificadores de ejecucin. Estos ID de ejecucin posteriores representan la ejecucin de las tareas que se desencaden porque la tarea inicial ha terminado. La aplicacin cliente puede seguir toda una serie de tareas interrelacionadas que juntas componen un flujo completo lote paralelizada.Por ltimo, los ejemplos de salidas de cdigo de informacin de registro y devuelve un cdigo de error para el sistema operativo. El cdigo de error se puede recuperar de una manera estndar, por ejemplo, mediante el uso de la % ERRORLEVEL% variable de entorno en un archivo BAT.Los cambios respecto a versiones anterioresDesde una perspectiva de funcionalidad, lo siguiente ha cambiado en comparacin con el uso de EDX en QlikView 10: Porque la comunicacin es con QMS lugar de QDS, un grupo QDS puede utilizarse para equilibrar la carga EDX llama. Si se requiere una alta disponibilidad para el medio ambiente por lotes, QMS es un punto nico de fallo. Considere bien la virtualizacin del SGC o un sistema activo / pasivo. El xito o fracaso de cdigo aQlikView lotes pueden ser devueltos. Anteriormente, el estado de la tarea se encontraron (es decir, la definicin del trabajo por lotes), pero no la ejecucin Ofthe trabajo por lotes. La ejecucin de las tareas posteriores puede ser seguido.Notas sobre el uso de la API de QMSPor ltimo, algunas notas sobre el uso de la API de QMS en QlikView 11: La contrasea EDX no debe ser nulo. Utilice una cadena vaca, si no se configura ninguna contrasea. Se requiere que el ID QDS en la llamada a la funcin que inicia el trabajo por lotes EDX. Sin embargo, se requieren privilegios de nivel superior a la pertenencia a "QlikView EDX" para obtener una ID QDS. La solucin ms sencilla es pasar un GUID vaco para el QDS ID, lo que significa QMS buscar la tarea en todos los casos QDS configurados. Casi todos los proyectos actuales slo tienen uno QDS lgicos configurados, as que esto puede ser una solucin til. EDX se puede utilizar sin licencia QlikView Publisher. Basta con pasar el nombre de la QVW en lugar de un nombre de la tarea y la reloadschedule del QVW se ejecutar.