11 Replies Latest reply: Apr 6, 2011 3:59 PM by hrdzpqkv RSS

    EDX - Task Completion

      I have been able to put the code together to send the EDX request to start a Publisher job in QlikView 9.0 SR1. I need help getting a response back when the task has finished. Is there another request to the EDX that needs to be made, and if so, what is the XML tag that I need to look for.

      Thanks for your help.

        • EDX - Task Completion

          Check out the recently released SR2 where you can request the status of the task via EDX.


            • EDX - Task Completion

              I have downloaded and installed 9.0 SR2. I looked through the documentation that is along with SR2 and the only information I see on triggering the EDX is starting the process. Is the request to the EDX the same to get the status of the task as it is to start the task?

                • EDX - Task Completion

                  Leave it with me a few days - I'm working on 'extracting' the missing documentation from the R&D team ...



                    • EDX - Task Completion

                      Does anyone have any code or documentation on how to monitor a task triggered by an EDX request for its completion?

                        • EDX - Task Completion


                          We are trying to implement something which I think will give you an idea on how to do what you need, here is the code, we are running ver. 9 SR7.



                          Dim objHttp
                          Dim strUrl
                          Dim strData
                          Dim strKeyRequest
                          Dim strKeyAwnser

                          ' Create a HTTP instance
                          Set objHttp = CreateObject("Microsoft.XMLHTTP")

                          strUrl = "http://SERVERNAME:4720/qtxs.asmx"

                          strKeyRequest ="<Global method=""GetTimeLimitedRequestKey"" />"

                          objHttp.open "POST",strUrl,false
                          objHttp.setRequestHeader "Content-Type","text/xml"
                          objHttp.setRequestHeader "Content-Length", Len(strKeyRequest)
                          objHttp.Send strKeyRequest

                          'Parse the awnser
                          Dim strKey
                          strKey = ParseKeyAwnser(objHttp.ResponseText)

                          'Get the string to send in the request that triggers the task
                          Dim strTaskStatusString


                          strTaskName = "TASK NAME to MONITOR"

                          strTaskStatusString = GetTaskStatusString(strKey,strTaskName,strTaskPassword)

                          'MsgBox strTaskStatusString

                          'Do the actual request to trigger the task
                          objHttp.open "POST",strUrl,false
                          objHttp.setRequestHeader "Content-Type","text/xml"
                          objHttp.setRequestHeader "Content-Length", Len(strKeyRequest)
                          objHttp.Send strTaskStatusString

                          'Get the awnser, the awnser can contain different things but for now I only care to see if we find success
                          dim strAwnser
                          strAnwser = objHttp.ResponseText

                          'MsgBox strAnwser

                          MsgBox ParseStatusAwnser(strAnwser)


                          'Functions Section
                          Function ParseKeyAwnser(strKeyAwnser)
                          Dim intStartPos
                          Dim IntKeyLen

                          'Get the starting and the end position of the key
                          intStartPos = InStr(strKeyAwnser,"<GetTimeLimitedRequestKeyResult>")+Len("<GetTimeLimitedRequestKeyResult>")
                          intKeyLen = InStrRev(strKeyAwnser,"</GetTimeLimitedRequestKeyResult>") - intStartPos

                          'Get and return the key
                          ParseKeyAwnser = Mid(strKeyAwnser,intStartPos,intKeyLen)

                          End Function

                          Function ParseStatusAwnser(strKeyAwnser)

                          Dim intStartPos
                          Dim IntKeyLen
                          Dim strFinalLog
                          Dim strCurrentStatus
                          Dim strDoAlert

                          'Get the starting and the end position of the Status Key
                          intStartPos = InStr(strKeyAwnser,"<Status>")+Len("<Status>")
                          intKeyLen = InStrRev(strKeyAwnser,"</Status>") - intStartPos

                          strCurrentStatus = Mid(strKeyAwnser,intStartPos,intKeyLen)

                          If strCurrentStatus = "Running" Then
                          strFinalLog = "Not Available"
                          'Get the starting and the end position of the Log Key
                          intStartPos = InStr(strKeyAwnser,"<LastLogMsg>")+Len("<LastLogMsg>")
                          intKeyLen = InStrRev(strKeyAwnser,"</LastLogMsg>") - intStartPos

                          strFinalLog = Mid(strKeyAwnser,intStartPos,intKeyLen)
                          End If

                          'Get the starting and the end position of the Do Alert Key
                          intStartPos = InStr(strKeyAwnser,"<DoAlert>")+Len("<DoAlert>")
                          intKeyLen = InStrRev(strKeyAwnser,"</DoAlert>") - intStartPos

                          strDoAlert = Mid(strKeyAwnser,intStartPos,intKeyLen)

                          'Get and return the key
                          ParseStatusAwnser = "Current Status is: " & strCurrentStatus & " and the Do Alert is " & strDoAlert

                          End Function

                          Function GetTaskStatusString(strRequestKey,strTaskName,strTaskPassword)

                          'Make the string and insert the key
                          GetTaskStatusString = "<Global method=""GetTaskStatus"" key=""" & strRequestKey & """><TaskNameOrId>" & strTaskName & "</TaskNameOrId></Global>"

                          End Function


                        • EDX - Task Completion

                          Rough notes, but hopefully this should help:

                          The call to get the taskstatus looks like this:
                          <Global method="GetTaskStatus" key="%timelimitedkey% >
                          <TaskNameOrId>Notepad, EDX triggered</TaskNameOrId> </Global>

                          answer could look like this:

                          HTTP/1.1 200 OK
                          Connection: close
                          Content-Length: 694
                          Cache-Control: private, max-age=0
                          Content-Type: text/xml; charset=utf-8
                          Date: Thu, 29 Oct 2009 11:42:55 GMT
                          Server: Microsoft-HTTPAPI/2.0

                          <DocumentPath />
                          <LastLogMsg>Executing c:\windows\notepad.exe Executing commandline: "c:\windows\notepad.exe" in folder "c:\windows".
                          Process exited with exit code: 0 at 2009-10-29 12:31:31 Process exited with exit code: 0 at 2009-10-29 12:31:31 The task "Notepad, EDX triggered" finished successfully</LastLogMsg>
                          <Name>Notepad, EDX triggered</Name>
                          <Server />
                          <Start>On EDX</Start>
                          <LastExec>2009-10-29 12:31:34</LastExec>
                          <Summary />

                          One important thing though:
                          If you only want to fire of EDX then membership in Qlikview EDX is enough but if you also want to get status of a task you need to be member of Qlikview Administrator.

                          • EDX - Task Completion

                            Hi Chris,

                            since we switched from 8.5 to 9.0 I miss the EDX set-up starting page w/ the test-option for URL. In the past we created a dumb webpage on the local server which started a QV-job on that server. I learned that isn't supported anymore... Any docu avail. now how to set a EDX using URL's ?

                            Thks, Tom


                      • EDX - Task Completion
                        Andrew Douglas

                        I was able to get a sample C# program (unsupported) from support that has an example of startign and monitoring a task (see attachment). However the issue I still have with this is that it only monitors the original tasks and does not demonstate a way to monitor dependent tasks that may be triggered by the initiated task.

                        In our 8.5 environment we had jobs that would run several tasks and we could monitor the status of the entire job (includign all tasks) using the EDX WebService. With the changes in v9.0 so far I have not found a way to repicate this functionality and be able to monitor the status of all triggered tasks.

                        if anyone has an example of being able to monitor dependent tasks that would be very helpful.