WebSphere Extended Deployment, Version 6.0.x
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


Results algorithm

Results algorithms are an optional feature of the batch programming model.

A results algorithm allows for two types of actions to occur at the end of a batch step:

Results algorithms are applied to a batch job through XML Job Control Language (xJCL). These algorithms are declared in xJCL and then applied to batch steps.

At the end of a batch step, the long-running execution environment check the xJCL of the batch job to determine which results algorithm to invoke. For each results algorithm specified, the long-running execution environment pass to the algorithm the return code of the batch step, which is the integer returned by the destroyJobStep method of the step, and the current return code of the batch job in the long-running execution environment database. The results algorithm can then take any action based on the return codes passed in. The algorithm then passes a return code for the batch job back to the long-running execution environment, which is persisted to the long-running execution environment database as the current return code of the batch job. This return code can be the same as the return code that the long-running execution environment passed to the results algorithm initially, or the return code can be different, depending on logic coded into the results algorithm. If a results algorithm is not specified on a batch step, the job return code is that of the results algorithm from the previous step. If no results algorithms are specified, the job return code is zero (0).

A results algorithm system programming interface (SPI) is also provided, which you can use to write your own algorithms and apply them to batch jobs.

The jobsum results algorithm

WebSphere Extended Deployment supports a jobsum results algorithm. Jobsum returns the highest return code of job steps to the long-running execution environment. For example, there are three steps in the job (step1, step2, step3) where the following conditions exist:
  • step1 returned 5
  • step2 returned 8
  • step 3 returned 2. The jobsum algorithm ensures that 8 is passed to the long-running execution environment as the final return code of the job.

Example of applying a jobsum and custom results algorithm to steps

<job name="PostingSampleEar">

  <results-algorithms>
     <results-algorithm name="jobsum">
        <classname>com.ibm.wsspi.resultsalgorithms.jobsum</classname>
  </results-algorithm>

     <results-algorithm name="custom_algorithm">
           <classname>my_custom_algorithm</classname>
     </results-algorithm>

</results-algorithms> 


<job-step name="Step1">

     <results-ref name="jobsum">
  </job-step>

<job-step name="Step2">

     <results-ref name="custom_algorithm">
  </job-step>

</job>



Related concepts
The batch programming model
Batch job steps
Batch controller bean
Concept topic    

Terms of Use | Feedback

Last updated: Oct 16, 2009 11:08:29 AM EDT
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/com.ibm.websphere.xd.doc/info/scheduler/cxdbatchres.html