Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trigger EDX Qlikview 10

I used to run the trigger edx function posted by bbt (http://community.qlik.com/forums/t/18961.aspx) on Qlikview 9 perfectly.

However, I can't make it work on Qlikview 10. It stops at the command

objHttp.Send strKeyRequest

I read that the services have been merged. I am connected to http://myserver:4720/qtxs.asmx.

Any help on this topic?

Regards,

Marco

39 Replies
Not applicable
Author

Hi brindlogcool,

Thanks for replying. No, I am not getting any error.

But, is it possible to achieve it without edx?....I had a read a post on using control file that was scheduled to reload..Any workaround?

-Anju

brindlogcool
Creator III
Creator III

I have been using EDX in version 10. And there is so much change in the way the EDX works between version 9,10,11. It would be easier if possible you can upload your files . There are experts in the community they can help you out.

Not applicable
Author

Hi,

This is the edx macro..

'*****************************************************************************************

'*

'*  R E L O A D     E D X

'*

'*****************************************************************************************

Sub RunTask

tp = MsgBox("Are you sure?", 1)

if tp=2 then

exit sub

end if

CONST SUCCESS                   = 0   

CONST TASKNOTFOUND              = 1

CONST TASKISALREADYRUNNING      = 2

CONST NOEDXTRIGGERFOUND         = 3

CONST OTHERERROR                = 9

CONST WAITING                   = 0   

CONST RUNNING                   = 90   

CONST FINISHEDWITHWARNINGS      = 91

CONST FINISHEDWITHERRORS        = 92

dim xmlHttp

set xmlHttp = CreateObject("Microsoft.XMLHTTP")

set xml = createobject("Microsoft.XMLDOM")

set xmlObj = createobject("Microsoft.XMLDOM")

                    

'***********************************************************************

' This ROWS must be modified

'***********************************************************************

url = "http://localhost:4780/qtxs.asmx"   

doc = "reloadvictim.qvw"                      

userID = "optima.test"                  

pass = "rocpsgvtdice123"                                     

'***********************************************************************

ITERATIONS=10000

DELAY=30

METHOD = "<Global method=""RequestEDX"" key=""" & GetTimeLimitedRequestKey(url, doc, userID, pass) &  """>"

METHOD = METHOD & "<i_TaskIDOrTaskName>" & doc & "</i_TaskIDOrTaskName>"

METHOD = METHOD & "<i_Password>" & pass & "</i_Password>"

METHOD = METHOD & "<i_VariableName>vCond</i_VariableName><i_VariableValueList><string>1</string></i_VariableValueList>"

METHOD = METHOD & "</Global>"

DIM AsAt

AsAt = Now()

' Submit request to the QDS via HTTP

xmlHttp.open "POST",url,false, userID, pass

xmlHttp.setRequestHeader "Content-Type","text/xml"

xmlHttp.setRequestHeader "Content-Length", Len(METHOD)

xmlHttp.Send METHOD

select case xmlHttp.Status

    case 200:

      

        ' Load the Response into an XML object

        xml.async = false

        xml.loadXML(xmlHttp.responseText)

        ' Parse the XML Response extracting Status, Log, etc

        TaskStartResult = ""

        set xmlObj = xml.SelectNodes("//RequestEDX/RequestEDXResult/*")

        for node = 0 to (xmlObj.length -1)

            select case xmlObj.item(node).nodeName

                case "TaskStartResult":

                    TaskStartResult = xmlObj.item(node).text

                  

                    select case TaskStartResult

                        case "Success":

                            TaskStartResultCode = SUCCESS

                        case "TaskNotFound":

                           TaskStartResultCode = TASKNOTFOUND

                        case "TaskIsAlreadyRunning":

                            TaskStartResultCode = TASKISALREADYRUNNING

                        case "NoEDXTriggerFound":

                            TaskStartResultCode = NOEDXTRIGGERFOUND

                        case "OtherError":

                            TaskStartResultCode = OTHERERROR

                        case else

                            TaskStartResultCode = OTHERERROR

                    end select 'TaskStartResult

                    RC = TaskStartResultCode

                case "TaskStartResultCode":

                    select case xmlObj.item(node).text

                        case "0":

                            TaskStartResultCode = SUCCESS

                        case "1":

                            TaskStartResultCode = TASKNOTFOUND

                        case "2":

                            TaskStartResultCode = TASKISALREADYRUNNING

                        case "3":

                            TaskStartResultCode = NOEDXTRIGGERFOUND

                        case "9":

                            TaskStartResultCode = OTHERERROR

                        case else

                            TaskStartResultCode = OTHERERROR

                    end select 'TaskStartResultCode

                    RC = TaskStartResultCode

                case "Log":

                   

                    Message = Split( xmlObj.item(node).text, chr(9))

            end select 'nodeName

        next 'iteration

    case 401:

        msgbox "ERROR: The credentials for QDS (" & url & ") are incorrect."

        exit sub

    case 403:

        msgbox "ERROR: User is not authorised to request EDX tasks."

        exit sub

    case 404:

        msgbox "ERROR: The URL for QDS (" & url & ") is incorrect."

        exit sub

    case 503:

        msgbox "ERROR: The QDS (" & url& ") is unavailable."

        exit sub

    case 12029:

        msgbox "ERROR: The QDS (" & url & ") is not accessible."

        exit sub

    case else

        msgbox "ERROR: An error (" & xmlHttp.Status & ") occurred trying to access the QDS."

      

end select 'xmlHttp

'-----------------------------------------------------------------------------

'- GetTaskStatus

'-----------------------------------------------------------------------------

i = 0

Finished = False

WAIT = true

do while (TaskStartResultCode = SUCCESS) AND (WAIT = True) AND (i < ITERATIONS) AND Finished=False

'    sleep( DELAY * 1000)

   

   

    METHOD = "<Global method=""GetTaskStatus"" key=""" & GetTimeLimitedRequestKey(url, doc, userID, pass) &  """>"

    METHOD = METHOD & "<TaskNameOrId>" & doc & "</TaskNameOrId>"

    METHOD = METHOD & "</Global>"

    AsAt = Now()

    ' Submit request to the QDS via HTTP

    xmlHttp.open "POST",url,false, userID, pass

    xmlHttp.setRequestHeader "Content-Type","text/xml"

    xmlHttp.setRequestHeader "Content-Length", Len(METHOD)

    xmlHttp.Send METHOD

 

  '

 

 

    select case xmlHttp.Status

        case 200:

           

            xml.async = false

            xml.loadXML(xmlHttp.responseText)

          

            set xmlObj = xml.SelectNodes("//GetTaskStatus/GetTaskStatusResult/TaskStatus/*")

            for node = 0 to (xmlObj.length -1)

               

                select case xmlObj.item(node).nodeName

                    case "Status":

                        GetTaskStatus = xmlObj.item(node).text

                        select case GetTaskStatus

                            case "Waiting":

                                Finished = True

                                RC = WAITING

                                Msgbox AsAt & chr(9) & "[Waiting.........]"

                            case "Running":

                                Finished = False

                                RC = RUNNING

                                Msgbox AsAt & chr(9) & "[Waiting.........]"

                            case "FinishedWithWarnings":

                                Finished = True

                                RC = FINISHEDWITHWARNINGS

                                Msgbox AsAt & chr(9) & "[" & GetTaskStatus & "]"

                            case "FinishedWithErrors":

                                Finished = True

                                RC = FINISHEDWITHERRORS

                                Msgbox AsAt & chr(9) & "[" & GetTaskStatus & "]"

                            case else

                                Finished = True

                                RC = OTHERERROR

                                Msgbox AsAt & chr(9) & "[Errore!]"

                        end select

                    case "LastLogMsg":

                        LastLogMsg = xmlObj.item(node).text

                        if ShowMessages = True then

                           Msgbox " "

                            Msgbox LastLogMsg

                            Msgbox " "

                        end if

                end select 'nodeName

            next 'node

        case 401:

            Msgbox "ERROR: The credentials for QDS (" & url & ") are incorrect."

            exit sub

        case 403:

            Msgbox "ERROR: User is not authorised to Get Task Status....."

            exit sub

        case 404:

            Msgbox "ERROR: The URL for QDS (" & url & ") is incorrect."

            exit sub

        case 503:

            Msgbox "ERROR: The QDS (" & url & ") is unavailable."

            exit sub

        case 12029:

            Msgbox "ERROR: The QDS (" & url & ") is not accessible."

            exit sub

        case else

            Msgbox "ERROR: An error (" & xmlHttp.Status & ") occurred trying to access the QDS."

            exit sub

    end select

    i = i + 1

Loop

xmlObj  = null

xml     = null

xmlHttp = null

end sub

'-----------------------------------------------------------------------------

'- GetTimeLimitedRequestKey

'-----------------------------------------------------------------------------

Function GetTimeLimitedRequestKey(dsURL, document, userID, password)    

set xmlHttp = CreateObject("Microsoft.XMLHTTP")

set xml = createobject("Microsoft.XMLDOM")

set xmlObj = createobject("Microsoft.XMLDOM")

        

    DIM METHOD '

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

    xmlHttp.open "POST",dsURL,false, userID, password

    xmlHttp.setRequestHeader "Content-Type","text/xml"

    xmlHttp.setRequestHeader "Content-Length", Len(METHOD)

    xmlHttp.Send METHOD

    select case xmlHttp.Status

        case 200:

           

            xml.async = false

            xml.loadXML(xmlHttp.responseText)

            set xmlObj = xml.SelectNodes("//GetTimeLimitedRequestKey")

            for node = 0 to (xmlObj.length -1)

                if xmlObj.item(node).nodeName = "GetTimeLimitedRequestKey" then

                    GetTimeLimitedRequestKey = xmlObj.item(node).text

               end if

            next 'node

        case 401:

            msgbox "ERROR: The credentials for QDS (" & dsURL & ") are incorrect."

            exit function

        case 403:

            msgbox  "ERROR: User is not authorised to interact with QDS."

            exit function

        case 404:

            msgbox "ERROR: The URL for QDS (" & dsURL & ") is incorrect."

            exit function

        case 503:

            msgbox  "ERROR: The QDS (" & dsURL & ") is unavailable."

            exit function

        case 12029:

            msgbox  "ERROR: The QDS (" & dsURL & ") is not accessible."

            exit function

        case else

            msgbox  "ERROR: An error (" & xmlHttp.Status & ") occurred trying to access the QDS."

    end select

End Function

Sub Rld

Call RunTask

End Sub

Not applicable
Author

The username optima.test is present in 'QlikView Administrators'. I also manually create a group 'QlikView EDX' and added the user to it.

The link http://localhost:4820/qtxs.asmx

displays'Internet explorer cannot display the webpage'

-Anju

Not applicable
Author

Hello Gurus,

Urgent help required.

I am working on triggerring the QMC tasks in batch(based on ETL Load completion) instead of scheduling/time trigger in QMC. The idea is to reduce the load on QMC and overcome the limitation  of n number of simultaneous tasks in QMC. I tried the /r or /l option but it is doing a plain reload on the Client(In a new window) than on the Server. I want to remove the scheduling from QMC, but want to monitor those tasks in QMC. In other words, the existing waterfall QMC tasks are to be triggered from windows bat program based on ETL Load completion so that the QMC schedules can be removed, but still the tasks should be able to be monitored in QMC.

Thanks

BJ

Michael_Reese
Employee
Employee

Did you get this working?

alex_stone
Creator
Creator

Hi,

'***********************************************************************

' This ROWS must be modified

'***********************************************************************

url = "http://localhost:4780/qtxs.asmx"  

doc = "reloadvictim.qvw"                     

userID = "optima.test"                 

pass = "rocpsgvtdice123"                                    

'***********************************************************************

Question 1: url: How can I get the correct url information?

Question 2: userID: is the domain user?

Question 3:

     will pop up the error message when I click the reload button.

     ERROR: The QDS(http://xxxx:4780/qtxs.asmx) is unavailable.

Not applicable
Author

Hello Giuseppe,

I'm trying to run 'RUN_TASK_BY_EDX.QVW' example in QlikView 11 environment (QlikView AccessPoint) and I get the error :

    - ERROR: An error(0) ocurred trying to Access QDS --> xmlHttp.Status returns 0

The "button method" used in 'RUN_TASK_BY_EDX.QVW' is compatible in QlikView 11?

The url variable that I used:

     -  url = "qvp://servername:4720/qtxs.asmx"

Many thanks!

Regards!

Anonymous
Not applicable
Author

Hi Anju,

I was looking at the code you published above.

I'm actually looking for a way to read the status of a task in QEMC and then (eventually) start a reload.

I think the code above could be useful for my purpose, but I need to ask you a question...

what GetTimeLimitedRequestKey stands for? what's the role of this key?

Thank you so much

IB

Not applicable
Author

Good afternoon,

Someone could guide me as I can the name of my URL for the QDS.

Because I want to complete the next line and it gives me error

Url = "server: 4720 / qtxs.asmx"

Greetings.