Click or drag to resize
IQMS2GetTaskStatusNodes Method
Gets the task status nodes.

Namespace: PIX.Services.V12.Api2
Assembly: 
Syntax
List<TaskStatusNode> GetTaskStatusNodes(
	List<TaskStatusNodeRequest> taskStatusNodeRequests,
	TaskStatusFilter filter,
	TaskStatusScope scope
)

Parameters

taskStatusNodeRequests
Type: System.Collections.GenericListTaskStatusNodeRequest
The task status node requests.
filter
Type: PIX.QMSAPI.DataObjectsTaskStatusFilter
The filter to be used
scope
Type: PIX.QMSAPI.DataObjectsTaskStatusScope
The scope.

Return Value

Type: ListTaskStatusNode
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 ID
specified

Category name
specified

Task ID
specified

Root type:
QDS

Root type:
Category

Root type:
Task
NoNoNoQDSCategoryTask
YesNoNoCategoryCategoryTask
NoYesNo---TaskTask
YesYesNoTaskTaskTask
NoNoYes------Dep.Task
YesNoYes------Dep.Task
NoYesYes---Dep.TaskDep.Task
YesYesYesDep.TaskDep.TaskDep.Task
Security note Security Note

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.

C#
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