Process.GetProcessByIdAsync
Description
Gets the ProcessInfo from the connected AI Command Center.
Signature [C#]
Task<ProcessInfo> GetProcessByIdAsync(int processId);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
processId | int | Required | Specify the process ID to retrieve the process information. |
Output
| Property | Description |
|---|---|
| Task<ProcessInfo> | Returns the information of a process using its Id. |
Remarks
Use GetProcessByIdAsync API to get the ProcessInfo from the connected AI Command Center.
Example
C#
public async Task GetProcessById()
{
IControlRoomContext context = LoginControlRoom();
try
{
int processId = 1;
ProcessInfo process = await context.Processes.GetProcessByIdAsync(processId);
Console.WriteLine("Process Name: " + process.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.