Tasks.GetPendingTasksByUserNameAsync
Description
The API gets the list of pending tasks for the specified user.
Signature [C#]
Task<CRTasks> GetMyPendingTasksAsync(string userName, string processName = null)
Properties
Input
Property | Description |
---|---|
username | Specify the username to retrieve their pending tasks. |
processName | Specify the username to retrieve the associated pending tasks. |
Output
Property | Description |
---|---|
Task<CRTasks> | Returns pending tasks information for current user. |
Remarks
Use GetPendingTasksByUserNameAsync API to get the list of pending tasks information for the specified user.
Example
C#
public void GetPendingTasksByUserName()
{
IControlRoomContext context = LoginControlRoom();
string username = "cr_user";
string processName = "demo_process";
CRTasks cRTasks = Task.Run(() => context.Tasks.GetPendingTasksByUserNameAsync(username, processName)).Result;
foreach (CRTaskInfo taskData in cRTasks.Data)
System.Console.WriteLine("Task Name: " + taskData.Name);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;
connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);
context.Open();
return context;
}