com.ibm.wsspi.batch
Interface ResultsAlgorithm
All Superinterfaces:
com.ibm.batch.spi.ResultsAlgorithm
- public interface ResultsAlgorithm
- extends com.ibm.batch.spi.ResultsAlgorithm
- 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.
- int
- java.lang.String
- boolean
- boolean initialize(ResultsAlgorithm result)
- java.lang.String getalgorithmName( )
- int fireResultsAlgorithms(java.lang.String jobid,
- java.lang.String stepname,
- int steprc,
- int jobrc)
Method Summary
Modifier and Type | Method and Description |
---|---|
|
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.
|
|
getalgorithmName()
Returns the algorithm name
|
|
initialize(ResultsAlgorithm result)
Called by Batch Execution Environment to initialize the Results Algorithm.
|
Method Detail
initialize
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
Returns the algorithm name
Specified by:
getalgorithmName
in interface com.ibm.batch.spi.ResultsAlgorithm
Returns:
algorithm name
fireResultsAlgorithms
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. Returns:
boolean indicating if the algorithm was initialized
successfully