Skip to main content Skip to complementary content

GetEDXTaskStatus Method

Overloads

GetEDXTaskStatus(Guid, Guid)

Gets the EDX task status.

GetEDXTaskStatus(Guid, Guid)

Gets the EDX task status.

Declaration

      EDXStatus GetEDXTaskStatus(Guid qdsID, Guid executionID)
    

Parameters

Type Name Description
System.Guid qdsID

The QDS ID.

System.Guid executionID

The execution instance ID.

Returns

Type Description
EDXStatus

The status of a specific execution of the task.

Remarks

security

Requires membership of local group QlikView EDX.

Examples

The following example shows how to trigger a task and then wait until it has finished or a certain amount of time has passed.

The service key injection is assumed to be handled behind the scenes. For an example of how to inject the service key, see Samples.

    using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using QMSAPI;

class Program
{
    static void Main(string[] args)
    {
        try
        {
            // create a QMS API client
            IQMS apiClient = new QMSClient();

            //retrieve a time limited service key
            ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();

           //Get a Distribution Service.
           ServiceInfo qdsService = apiClient.GetServices(ServiceTypes.QlikViewDistributionService).FirstOrDefault();

           if (qdsService != null)
           {
               //Trigger the task
               TriggerEDXTaskResult result = apiClient.TriggerEDXTask(qdsService.ID, "PauseEDX", "edx", "", new List<string>());

               EDXStatus executionStatus = null;

               //Wait until the task is completed or 60 seconds has passed.
               SpinWait.SpinUntil(() =>
                   {
                       System.Threading.Thread.Sleep(1000);
                       Console.WriteLine("Checking the task...");

                       //Get the current state of the task.
                       executionStatus = apiClient.GetEDXTaskStatus(qdsService.ID, result.ExecId);

                       //Return true if the task has completed.
                       return executionStatus != null && executionStatus.TaskStatus == TaskStatusValue.Completed;
               }, 60 * 1000);

               //Write the result
               if (executionStatus != null)
                   Console.WriteLine(executionStatus.TaskStatus);
               else
                   Console.WriteLine("Failed to get execution status.");

           }
        }
        catch (Exception ex)
        {
            Console.WriteLine("An exception occurred: " + ex.Message);
        }
        // wait for user to press any key
        Console.ReadLine();
    }
}
  

See Also

TriggerEDXTask(System.Guid, System.String, System.String, System.String, System.Collections.Generic.List<System.String>)

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com