This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Process activity
|
Process activity {( {sessionID}{;}{options} )} -> Function result | ||||||||
Parameter | Type | Description | ||||||
sessionID | Text |
![]() |
Session ID | |||||
options | Longint |
![]() |
Return options | |||||
Function result | Object |
![]() |
Snapshot of running processes and/or (4D Server only) user sessions | |||||
The Process activity command returns a snapshot of running processes and/or (4D Server only) connected user sessions at a given time. This command returns all processes, including internal processes that are not reachable by the Process info command.
By default when used without any parameters, Process activity returns an object containing the following properties:
On 4D Server, you can filter information to be returned using the optional sessionID and options parameters:
Constant | Type | Value | Comment |
Processes and sessions | Longint | 0 | Returns both "processes" and "sessions" lists (default value) |
Processes only | Longint | 1 | Returns only the "processes" list |
Sessions only | Longint | 2 | Returns only the "sessions" list |
Note: When executed on 4D in remote or local mode, Process activity always returns the list of running processes (sessionID and options parameters are ignored).
The "sessions" property contains a collection of objects describing all running sessions on the server.
For a description of session object properties, please refer to the Session info command.
Notes:
The "processes" property contains a collection of process objects describing all running processes.
For a description of process object properties, please refer to the Process info command.
On the server, the Process activity command returns an additional "session" property:
Additional property | Type | Description |
session | Object | The .info property of the session in which the process is running. Undefined if the Processes only parameter is passed. |
You want to get the collection of all user sessions:
//To be executed on the server
var $o : Object
var $i : Integer
$processName;$userName Text
$o:=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
You want to get all processes related to the current session:
// to be executed on the server
var $sessionID : Text:=Session.id
var $o : Object
$o:=Process activity($sessionID ;Processes only)
_o_PROCESS PROPERTIES
Process info
Session storage by ID
WEB Get server info
Product: 4D
Theme: Processes
Number:
1495
Created: 4D v16 R4
Modified: 4D v16 R5
Modified: 4D v17 R5
Modified: 4D v19 R4
Modified: 4D v20 R7
Renamed: 4D v20 R7 (Get process activity)
4D Language Reference ( 4D v20 R7)