The Get process activity command, added with 4D v16 R4, makes it possible to retrieve a list of running processes and connected users. With 4D v16 R5 we’ve further enhanced the command to make parsing the results easier. In addition to that, a new systemID attribute has been added to uniquely identify any process, whatever its type: user, 4D or spare.
Easy parsing
To provide even more flexibility when calling Get process activity, a new session object is now included as part of the processes collection. This lets you easily retrieve session information, like the user name for example, from a given process using object notation.
C_OBJECT($o)
C_LONGINT($i)
$o:=Get process activity // Get process & session info
For ($i;0;($o.processes.length)-1) // Iterate over the "processes" collection
$processName:=$o.processes[$i].name
$userName:=String($o.processes[$i].session.userName) // Easy access to userName, use String() because session object might be undefined
End for
Process System ID
The Get process activity command now returns a new systemID attribute for the objects of the processes collection. Allowing you to uniquely identify any process: user process, 4D process or spare process.
Please note that the same systemID is also used in the “4DRequestsLog.txt” and “4DRequestsLog_ProcessInfo.txt” log files. See the documentation about logs for more details.