Section "process: Run a process" in the STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_Process talks 
about this.  It says:

process: Run a process
The process element represents a STAF process which will be executed on a 
specified machine. It submits a START request to the STAF PROCESS service 
to run the specified command on the specified machine and waits for the 
process to complete running before continuing to the next element in the 
STAX job. You should use the process element instead of a stafcmd element 
if you want to start a process and wait for it to complete. 
After a process has completed (or if it could not be started) the 
following variables are set and can be referenced by the job: 
RC - the return code from the process. It is numeric. If it's the actual 
return code from the process, it is a Python Long numeric type (e.g. 0L, 
25L). If an error occurred starting the process, it is a Python Integer 
numeric type. 
STAFResult - the STAF result from starting the process. If the process 
failed to start successfully, it contains any error messages from starting 
the process in a Python string type. If the process started successfully, 
it is set to special Python object None. 
STAXResult - contains any files specified by returnstdout, returnstderr, 
and/or returnfile(s). If no files are returned, STAXResult is set to 
special Python object None. If one or more files are returned, the format 
of STAXResult is a list as follows: 
[ [<File 1 rc>, <File 1 data>], [<File 2 rc>, <File 2 data> ], ... ]
Each entry in the list represents a returned file and consists of a 
2-element list as follows: 
1.      <File n rc> is a number containing the STAF return code indicating 
the success or failure of retrieving the file's contents 
2.      <File n data> is a string containing the file's contents 
Files will be returned in the order of standard output, then standard 
error, then any files specified with the returnfile(s) element(s). 


So, like it says, if the process failed to start successfully, the RC will 
contain the STAF return code and the STAFResult will contain any error 
messages from starting the process. 

If the process started successfully, the RC will contain the process 
return code and the STAFResult will be set to None.  If one or more files 
are returned, the STAXResult will contain a list of the file results.

To check if the process was successful, you can check if the RC == 0 as 
that means that the process was successfully started and the process was 
successful.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   Luca Robusto <lucarobu...@gmail.com>
To:     STAF-USERS-REQUESTS <staf-users@lists.sourceforge.net>, 
Date:   03/15/2013 06:16 AM
Subject:        [staf-users] staf RC vs Process RC under STAX SCRIPT



I am having doubt in how to get RC about staf execution or process
execution called by staf "process start".

How can I get the second RC about the process called?

Luca.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to