|
|
The following C# code example retrieves all tasks that are based on a process named MortgageLoan - Prebuilt. The status of each returned task is checked to ensure that it is a completed task. Information such as the name of the user who completed the task is retrieved and displayed.using System;using System.Collections;using System.ComponentModel;using System.Data;using System.IO ;namespace RetrieveTaskInformation{class Class1{[STAThread]static void Main(string[] args){try{//Create an OutputServiceService objectTaskManagerQueryServiceService queryManager = new TaskManagerQueryServiceService();queryManager.Credentials = new System.Net.NetworkCredential("administrator", "password");//Create an OutputServiceService objectTaskManagerServiceService taskManager = new TaskManagerServiceService();taskManager.Credentials = new System.Net.NetworkCredential("administrator", "password");//Create a Task Search FilterTaskSearchFilter filter = new TaskSearchFilter();filter.serviceName = "MortgageLoan - Prebuilt";filter.adminIgnoreAllAcls=true;//Perform the task searchObject[] allTasks = queryManager.taskSearch(filter);//Determine the number of returned tasksint num = allTasks.Length;Boolean myTrue = true;Boolean myFalse = false;//Iterate through the Object arrayfor (int i=0; i<num;i++){//Extract the TaskRow instance from the Object arrayTaskRow myTask = (TaskRow)allTasks[i];//Ensure that the task is completedif (myTask.taskStatus == 100){//Get the identifier of the user who completed the tasklong taskId = myTask.taskId;TaskInfo taskInfo = taskManager.getTaskInfo(taskId,myTrue,myFalse,myFalse);ParticipantInfo user = taskInfo.assignedTo;String userId = user.specifiedUserId;//Display task informationConsole.WriteLine("The task identifier value is "+taskId +"\n"+"The user identifier is "+userId);}}}catch (Exception ee){Console.WriteLine(ee.Message);}}}}
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/quickStarts_Tasks.21.15.html