Process activity
Process activity () : Object
Process activity ( options ) : Object
Process activity ( sessionID ) : Object
Process activity ( sessionID ; options ) : Object
Parâmetro | Tipo | Descrição | |
---|---|---|---|
sessionID | Text | → | Session ID |
options | Integer | → | Return options |
Resultado | Object | ← | Snapshot of running processes and/or (4D Server only) user sessions |
História
Release | Mudanças |
---|---|
20 R7 | Support of sessionID parameter |
Descrição
The Process activity command returns a snapshot of running processes and/or (4D Server only) connected user sessions at a given time.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:
- "processes", a collection of all processes
- "sessions" (4D Server only), a collection of all sessions
On 4D Server, you can filter information to be returned using the optional sessionID and options parameters:
- If you pass a user session ID in the sessionID parameter, the command only returns information related to this session. By default if the options parameter is omitted, the returned object contains a collection with all processes related to the session and a collection with a single object describing the session. If you pass an invalid session ID, a null object is returned.
- You can select the collection(s) to return by passing one of the following constants in the options parameter:
Parâmetros | Valor | Comentário |
---|---|---|
Processes and sessions | 0 | Returns both "processes" and "sessions" lists (default value) |
Processes only | 1 | Returns only the "processes" list |
Somente sessões | 2 | Returns only the "sessions" list |
When executed on 4D in remote or local mode, Process activity
always returns the list of running processes (sessionID and options parameters are ignored).
Sessions
The "sessions" property contains a collection of objects describing all running sessions on the server. Para obter uma descrição das propriedades do objeto de sessão, consulte o comando Session info
.
- Você pode obter o objeto de uma sessão usando o comando Session.
Process activity
returns remote client sessions, stored procedure session and rest sessions but not Web sessions (limitation).
Processes
The "processes" property contains a collection of process objects describing all running processes. Para obter uma descrição das propriedades do objeto de processo, consulte o comando Process info
.
On the server, the Process activity
command returns an additional "session" property:
Additional property | Tipo | Descrição | |
---|---|---|---|
session | Object | A propriedade .info da sessão onde o processo está sendo executado. Undefined if the Processes only parameter is passed. |
Exemplo 1
You want to get the collection of all user sessions:
//To be executed on the server
var $o : Object
var $i : Integer
vat $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
Exemplo 2
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)