Skip to main content Skip to complementary content

GetTaskStatusNodes Method

Overloads

GetTaskStatusNodes(List<TaskStatusNodeRequest>, TaskStatusFilter, TaskStatusScope)

Gets the task status nodes.

Declaration

      List<TaskStatusNode> GetTaskStatusNodes(List<TaskStatusNodeRequest> taskStatusNodeRequests, TaskStatusFilter filter, TaskStatusScope scope)
    

Parameters

Type Name Description
System.Collections.Generic.List<TaskStatusNodeRequest> taskStatusNodeRequests

The task status node requests.

TaskStatusFilter filter

The filter to be used

TaskStatusScope scope

The scope.

Returns

Type Description
System.Collections.Generic.List<TaskStatusNode>

A list of matching TaskStatusNodes

Remarks

Return a type depending on whether or not QDS ID and/or category name is specified, but never return a type that is higher up in the type chain than the root type; QDS > Category > Task > Dependent Task

Using DependentTask as root type in the request list will produce an error since it is implicitly a child element.


QDS IDspecified

Category namespecified
Task IDspecified
Root type:QDS
Root type:Category
Root type:Task
No NoNoQDSCategoryTask
Yes NoNoCategoryCategoryTask
No YesNo---TaskTask
Yes YesNoTaskTaskTask
No NoYes------Dep.Task
Yes NoYes------Dep.Task
No YesYes---Dep.TaskDep.Task
Yes YesYesDep.TaskDep.TaskDep.Task
security

Requires membership of local group QlikView Management API and the role Document Folder Administrator.

Examples

The following code example shows how to make a GetTaskStatusNodes service call. It starts by adding a new task status node request array. We also need to populate the array with an object or any attempt to traverse the array will end in an exception.

Next a filter is created which says that only failed document tasks.

Finally it retrieves the task status nodes for this object. It will produce a list of the categories at the root level of that specific QDS.

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();        

            Guid qdsId = new Guid("c7c66836-f00b-47c4-8099-23ff7f178423"); // The originating QDS ID.
            List<TaskStatusNodeRequest> taskStatusNodeRequests = new List<TaskStatusNodeRequest>(); // Creating a new task status node request array.
            TaskStatusNodeRequest taskStatusNodeRequest = new TaskStatusNodeRequest(); // Populating the array with a new object.
            taskStatusNodeRequest.RootType = TaskStatusNodeType.QDS;
            taskStatusNodeRequest.QDSID = qdsId;
            taskStatusNodeRequests.Add(taskStatusNodeRequest);

            TaskStatusFilter taskStatusFilter = new TaskStatusFilter();
            taskStatusFilter.TaskStatuses.Add(TaskStatusValue.Failed);
            taskStatusFilter.TaskTypes.Add(TaskType.DocumentTask);

            List<TaskStatusNode> statusNodes = apiClient.GetTaskStatusNodes(taskStatusNodeRequests, taskStatusFilter, TaskStatusScope.All); // A service call using the array and a scope.
            foreach(TaskStatusNode node in statusNodes) {
                Console.WriteLine(node.Name + "\\t" + node.Status);
            }

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

See Also

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