Tasks.GetPendingTasksByUserNameAsync
Description
The API gets the list of pending tasks for the specified user.
Signature [C#]
Task<CRTasks> GetPendingTasksByUserNameAsync(string userName, string processName = null, bool isInOutArgsRequired = true);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
userName | string | Required | Specify the username to retrieve their pending tasks. |
processName | string | Optional; null | Specify the processName to retrieve the associated pending tasks. |
isInOutArgsRequired | bool | Optional; true | Specify true if you also want to retrieve the argument value. |
Output
| Property | Description |
|---|---|
| Task<CRTasks> | Returns pending tasks information for the specified user. |
Remarks
Use GetPendingTasksByUserNameAsync API to get the list of pending tasks information for the specified user.
Example
C#
public async Task GetPendingTasksByUserName()
{
IControlRoomContext context = LoginControlRoom();
try
{
string username = "cr_user";
string processName = "demo_process";
CRTasks cRTasks = await context.Tasks.GetPendingTasksByUserNameAsync(username, processName);
foreach (CRTaskInfo taskData in cRTasks.Data)
System.Console.WriteLine("Task Name: " + taskData.Name);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}
See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.