0% found this document useful (0 votes)
45 views

Sage X3 How Get A List of Client Running Processes

This document provides a subprogram that returns an integer array containing the IDs of all running client processes connected to the Sage X3 application server. The subprogram takes two parameters - an integer array to store the process IDs and an integer to store the number of running processes. An example shows how to use the subprogram and display the number of running processes. A second example demonstrates deleting records from a work table where the process ID does not match a running process.

Uploaded by

Axl Axl
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Sage X3 How Get A List of Client Running Processes

This document provides a subprogram that returns an integer array containing the IDs of all running client processes connected to the Sage X3 application server. The subprogram takes two parameters - an integer array to store the process IDs and an integer to store the number of running processes. An example shows how to use the subprogram and display the number of running processes. A second example demonstrates deleting records from a work table where the process ID does not match a running process.

Uploaded by

Axl Axl
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sage X3 how get a list of client running

processes
• Autore articolo
• Di mcarminati
• Data dell'articolo
• 15 Novembre 2012
• Nessun commento su Sage X3 how get a list of client running processes
The following Subprog returns into an Integer array the list of all running processes of clients
connected to X3 application server.
The Subprog needs this two local variables as parameters:
XPROCID, an Integer array in which are inserted the numbers of running processes
XNUM, an Integer which returns the count of running processes
#
#Restituisce una lista con tutti gli ID dei processi attivi sul server
#
Subprog GET_ALLPROCESS(XPROCID,XNUM)
Variable Integer XPROCID
Variable Integer XNUM
Local Char RESULT(250)(1..dim(XPROCID))
Local Integer STAT
Local Char ORDSYS(250)
Local Integer J , I, T
Local Char CHAINE(250)
Local Char PROCESS(250)
ORDSYS = "psadx -afghimnopxt -l"-GLANGUE
Call SYSTEME2(adxmac(0),ORDSYS,"",STAT,RESULT) From ORDSYS
I = 3
XNUM = 0
While I<=STAT-1
If I>=dim(RESULT) Then
Call ERREUR(mess(161,115,1)) From GESECRAN : # Trop de lignes
Break
Endif
CHAINE = RESULT(I)
PROCESS = vireblc(mid$(CHAINE,1,instr(1,CHAINE," ")),2)
If PROCESS <> "" Then
T = val(PROCESS)
If T > 0 Then
XPROCID(XNUM) = T
XNUM += 1
Endif
Endif
I += 1
Wend
End

Here an example how to use the Subprog


Local Integer XNUM
Local Integer XPRCID(100)
Call GET_ALLPROCESS(XPRCID,XNUM)
Infbox "there are " + num$(XNUM) + " running client processes"
and a second one that show how delete records of a work table for all non-running processes
#
#Delete record not owned by running processes:
#YVP is a table used as temporary container for cosultations and/or report,
#the field YADXUID contains the value of variable adxuid(1)
#
Local Integer XNUM
Local Integer XPRCID(100)
Call GET_ALLPROCESS(XPRCID,XNUM)
Delete [F:YVP] Where find(YADXUID,XPRCID(0..XNUM))=0

You might also like