You can use the <terminate> element to terminate a STAX job:
http://staf.sourceforge.net/current/STAX/staxug.html#Header_Terminate_Element


Thanks,
David


                                                                       
 David Bender          11501 Burnet Rd.   Phone (T/L): 1-512-286-5315  
 STAF/STAX Development Bldg. 903-5B002    (363-5315)                   
                       Austin, TX         ITN: 23635315                
 IBM Software Group,   78758-3400         Email: bda...@us.ibm.com     
 WPLC                                                                  
                                                                       
                                                                       






                                                                       
  From:       Sangram Bakshi <san...@gmail.com>                        
                                                                       
  To:         David Bender/Austin/i...@ibmus                            
                                                                       
  Cc:         staf-users@lists.sourceforge.net                         
                                                                       
  Date:       05/01/2010 12:33 AM                                      
                                                                       
  Subject:    Re: [staf-users] Running tests in Parallel.              
                                                                       





Thanks David , i tried it ,it runs fine.

Also i wanted to know how to terminate a staf job on a condition. I mean on
reaching a condition wanted to stop a staf job


Regards
Sangram

On Sat, May 1, 2010 at 12:01 AM, David Bender <bda...@us.ibm.com> wrote:
  The updated job looks fine

  Thanks,
  David


                                                                       
 David Bender          11501 Burnet Rd.   Phone (T/L): 1-512-286-5315  
 STAF/STAX Development Bldg. 903-5B002    (363-5315)                   
                       Austin, TX         ITN: 23635315                
 IBM Software Group,   78758-3400         Email: bda...@us.ibm.com     
 WPLC                                                                  
                                                                       





  Inactive hide details for Sangram Bakshi ---04/29/2010 05:55:33 AM---Hi ,
  In a staf job i am trying to run a test on different Sangram Bakshi
  ---04/29/2010 05:55:33 AM---Hi , In a staf job i am trying to run a test
  on different target machines from a
                                                                       
                                                                       
 From:                   Sangram Bakshi <san...@gmail.com>             
                                                                       
                                                                       
 To:                     staf-users@lists.sourceforge.net              
                                                                       
                                                                       
 Date:                   04/29/2010 05:55 AM                           
                                                                       
                                                                       
 Subject:                [staf-users] Running tests in Parallel.       
                                                                       






  Hi ,

  In a staf job i am trying to run a test on different target machines from
  a main machine .
  Also after the tests run successfully , the output of the tests in the
  target machines are captured in a file and trasferred to main machine .

  For this i am using the following code.

   <paralleliterate var="testMach" in="machname" indexvar="i">
        <sequence>

      <process name="'Starting Test on machine %s.....' % testMach">
                <location>testMach</location>
                <command mode="'shell'">'%s/%s ' % (tdir,rtstscript)
  </command>
                <stdout>'%s/%s_%s_%s_%s_%s_%s' %
  (tdir,rname,testMach,time_now[0],time_now[1],time_now[2],extn)</stdout>
            </process>
          <if expr="RC == 0">

    <message log="1">'Test Succeeded Run on %s !!!! - RC: %s, Result: %s' %
  (testMach,RC,STAFResult)</message>
        </if>
       <if expr="RC != 0">

    <message log="1">'Failed to run Test on %s !!!! - RC: %s, Result: %s' %
  (testMach,RC, STAFResult)</message>

   </if>
       </sequence>
      </paralleliterate>

         <!-- Get the Tests Reports from the test machines  -->

      <paralleliterate var="testMach" in="machname" indexvar="i">
       <sequence>
            <stafcmd name ="'Start Copying Test Report from remote
  machine ..... '">
             <location>testMach</location>
               <service>'FS'</service>
         <request>'COPY FILE %s/%s_%s_%s_%s_%s_%s TODIRECTORY
  c:/STAF/stax_jobs' % (tdir,rname,testMach,time_now[0],time_now
  [1],time_now[2],extn)</request>
                  </stafcmd>
             <if expr="RC == 0">

    <message log="1">'Transferred Report  on %s !!!! - RC: %s, Result: %s'
  % (testMach,RC,STAFResult)</message>
        </if>
       <if expr="RC != 0">

    <message log="1">'Failed to Transfer report  on %s !!!! - RC: %s,
  Result: %s' % (testMach,RC, STAFResult)</message>

   </if>

           </sequence>
          </paralleliterate>


  Now the reports get transferred only after the tests gets completed in
  all the machines .The test may take less time in one machine to
  complete , more time in another machine. I wanted to transfer the test
  out put files to get transferred as and when the test ends in the
  mahcines and not wait for all the machines to end the tests.

  So for that i wanted the code to be like :  (Do let me know if this is
  fine , i mean any side effects)

   <paralleliterate var="testMach" in="machname" indexvar="i">
        <sequence>

      <process name="'Starting Test on machine %s.....' % testMach">
                <location>testMach</location>
                <command mode="'shell'">'%s/%s ' % (tdir,rtstscript)
  </command>
                <stdout>'%s/%s_%s_%s_%s_%s_%s' %
  (tdir,rname,testMach,time_now[0],time_now[1],time_now[2],extn)</stdout>
            </process>
          <if expr="RC == 0">

    <message log="1">'Test Succeeded Run on %s !!!! - RC: %s, Result: %s' %
  (testMach,RC,STAFResult)</message>
                    <sequence>
                        <stafcmd name ="'Start Copying Test Report from
  remote machine ..... '">
                          <location>testMach</location>
                             <service>'FS'</service>
         <request>'COPY FILE %s/%s_%s_%s_%s_%s_%s TODIRECTORY
  c:/STAF/stax_jobs' % (tdir,rname,testMach,time_now[0],time_now
  [1],time_now[2],extn)</request>
                             </stafcmd>
                        <if expr="RC == 0">

                    <message log="1">'Transferred Report  on %s !!!! - RC:
  %s, Result: %s' % (testMach,RC,STAFResult)</message>
                         </if>
                    <if expr="RC != 0">

                       <message log="1">'Failed to Transfer report  on
  %s !!!! - RC: %s, Result: %s' % (testMach,RC, STAFResult)</message>

                    </if>

                     </sequence>

        </if>
       <if expr="RC != 0">

    <message log="1">'Failed to run Test on %s !!!! - RC: %s, Result: %s' %
  (testMach,RC, STAFResult)</message>

   </if>
       </sequence>
      </paralleliterate>


  Regards
  Sangram




  ------------------------------------------------------------------------------

  _______________________________________________
  staf-users mailing list
  staf-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/staf-users




------------------------------------------------------------------------------

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users





<<inline: graycol.gif>>

<<inline: ecblank.gif>>

------------------------------------------------------------------------------
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to