| IQMS2ImportDocumentTask Method |
Namespace: PIX.Services.V12.Api2
void ImportDocumentTask( Guid remoteQmsId, Guid remoteDocumentTaskId, Guid destinationQdsId, DocumentNode destinationDocument )
Only source document folders that the caller have access to will be returned.
Requires membership of local group QlikView Management API and the role Document Folder Administrator. |
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 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(); //Find a the remote QMS service. ServiceInfo remoteQMSService = apiClient.GetServices(ServiceTypes.RemoteQlikViewManagementService).FirstOrDefault(); //Find a local QDS service ServiceInfo localQDS = apiClient.GetServices(ServiceTypes.QlikViewDistributionService).FirstOrDefault(); //Get the tasks of a remote document. Guid remoteDocId = new Guid ("12a32214-1122-112a-8099-8765ce564112"); // The remote document ID. List<TaskInfo> taskInfos = apiClient.RemoteGetTaskListForDocID(remoteQMSService.ID, remoteDocId); //Get a local document. Guid localDocId = new Guid("c7c66836-f00b-47c4-8099-23ff7f178423"); // The local document ID. DocumentNode destinationDocument = apiClient.GetSourceDocuments(localQDS.ID).Where(dn => dn.ID == localDocId).FirstOrDefault(); if (destinationDocument != null) { //Apply each remote task on the local document. foreach(TaskInfo taskInfo in taskInfos) { apiClient.ImportDocumentTask(remoteQMSService.ID, taskInfo.ID, localQDS.ID, destinationDocument); } } } catch (Exception ex) { Console.WriteLine("An exception occurred: " + ex.Message); } // wait for user to press any key Console.ReadLine(); } }