com.ibm.wsspi.batch

Interface ResultsAlgorithm

  • All Superinterfaces:
    com.ibm.batch.spi.ResultsAlgorithm


    public interface ResultsAlgorithm
    extends com.ibm.batch.spi.ResultsAlgorithm
    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:
    • To influence the return code of the batch job based on the return code of the batch step that just ended. Note that there are two types of return codes: the return code of an individual batch step and the return code of the batch job to which the step belongs.
    • To provide a place holder for triggers or actions to take based on various step return codes.
    • Results Algorithms are applied to a batch job via xJCL. They are declared in xJCL and then applied to batch steps. Note that multiple results algorithms can be applied to a batch step. At the end of a batch step, the batch execution environment checks the xJCL of the batch job to see which results algorithms to invoke. For each results algorithm specified, the Batch Execution Environment passes to the algorithm the return code of the batch step - the integer returned by the destroyJobStep method of the step - and the current return code of the batch Job in the grid endpoint database. The results algorithm can then take any action based upon the return codes passed in. The algorithm then passes a return code for the batch job back to the Batch Execution Environment which is persisted to the grid endpoint database as the current return code of the batch job; this return code can be the same as the return code that the Batch Execution Environment passed to the results algorithm in the first place or it can be different depending on logic coded into the results algorithm. This SPI can be used to create custom Result Algorithms.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int fireResultsAlgorithms(java.lang.String jobid, java.lang.String stepname, int steprc, int jobrc)
      Called by the Batch Execution Environment at the end of the batch step to which the results algorithm is applied.
      java.lang.String getalgorithmName()
      Returns the algorithm name
      boolean initialize(ResultsAlgorithm result)
      Called by Batch Execution Environment to initialize the Results Algorithm.
    • Method Detail

      • initialize

        boolean initialize(ResultsAlgorithm result)
        Called by Batch Execution Environment to initialize the Results Algorithm. The com.ibm.wsspi.batch.xjcl.ResultsAlgorithm object represents the configuration data of the ResultsAlgorithm specified in xJCL.
        Specified by:
        initialize in interface com.ibm.batch.spi.ResultsAlgorithm
        Parameters:
        result - The ResultsAlgorithm configuration data from xJCL
        Returns:
        boolean indicating if the algorithm was initialized successfully
      • getalgorithmName

        java.lang.String getalgorithmName()
        Returns the algorithm name
        Specified by:
        getalgorithmName in interface com.ibm.batch.spi.ResultsAlgorithm
        Returns:
        algorithm name
      • fireResultsAlgorithms

        int fireResultsAlgorithms(java.lang.String jobid,
                                java.lang.String stepname,
                                int steprc,
                                int jobrc)
        Called by the Batch Execution Environment at the end of the batch step to which the results algorithm is applied. The return code returned by the destroyJobStep method of the step is passed in and the current return code of the batch job in the grid endpoint database is also passed in. This enables the results algorithm to fire triggers for certain return codes. The integer returned by this method becomes the return code of the batch job; this allows the implementer of this algorithm to influence the return code of the batch job based on the step return code and the current job return code.
        Specified by:
        fireResultsAlgorithms in interface com.ibm.batch.spi.ResultsAlgorithm
        Parameters:
        jobid - The id of the job.
        stepname - The name of step.
        steprc - The return code of the batch step for which this algorithm is being fired.
        result - The current return code of the batch job
        Returns:
        boolean indicating if the algorithm was initialized successfully
IBM WebSphere Application ServerTM
Release 8.5