You can write a simple batch application using a batch job controller and Enterprise JavaBeans (EJB) data stream, the command line, or the Apache ANT tool.
Some commands are split on multiple lines for printing purposes.
If your step has one input and one output stream you can alternatively use the Generic batch step of GenericXDBatchStep.
Batch data streams are accessed from the business logic, for example, from the batch job steps by calling BatchDataStreamMgr with jobID and stepID. JobID and stepID are retrieved from the step bean properties list using keys BatchConstants.JOB_ID and BatchConstants.STEP_ID.
You should already have access to the BatchConstants class.
The batch datastream framework provides several ready-to-use patterns to work with different types of datastreams such as file and database. To use the batch datastream framework, complete the following steps.
JobStepContext ctx= JobStepContextMgr.getContext();
You can use the PersistentMap helper class to simplify the storing of basic types such as Boolean and double in the persistent user data area of the job step context.
<batch-data-streams>
<bds>
<logical-name>inputStream</logical-name>
<props>
<prop name="PATTERN_IMPL_CLASS" value="MyBDSStreamImplementationClass"/>
<prop name="file.encoding" value="8859_1"/>
<prop name="FILENAME" value="${inputDataStream}" />
<prop name="PROCESS_HEADER" value="true"/>
<prop name="AppendJobIdToFileName" value="true"/> </props>
<impl-class>com.ibm.websphere.batch.devframework.datastreams.patterns.FileByteReader
</impl-class>
</bds>
The PATTERN_IMPL_CLASS class denotes the user
implementation of the BDS framework pattern and the impl-class property
denotes the supporting class.Use skip-record processing to skip read and write record errors in transactional batch jobs. Specify skip-record policies in the xJCL. Read the topic on skip record processing for further information.
Use retry-step processing to try job steps again when the processJobStep method encounters errors in a transactional batch job. Specify retry-step policies in the xJCL. Read the topic on retry-step processing for further information.
Use the transaction mode to define whether job-related artifacts are called in global transaction mode or local transaction mode. Read the topic on the configurable transaction mode for further information.
Provide an implementation for the com.ibm.websphere.batch.listener.JobListener interface to add additional initialization and clean up for jobs and steps. Specify the job listener in the xJCL using the job-level listener element.
The job listener beforeJob() method is invoked before any user artifact is invoked. The job listener afterJob() method is invoked after the last user artifact is invoked. The job listener beforeStep() method is invoked before any step-related user artifact. The job listener afterStep() method is invoked as the last step-related user artifact. Each time the job listener is invoked, it logs a message to the job log.
If your step has exactly one input and one output stream you could alternatively use the Generic batch step of GenericXDBatchStep.
Batch data streams are accessed from the business logic, for example, from the batch job steps by calling BatchDataStreamMgr with jobID and stepID. JobID and stepID are retrieved from the step bean properties list using keys BatchConstants.JOB_ID and BatchConstants.STEP_ID.
You should already have access to the BatchConstants class.
The batch datastream framework provides several ready-to-use patterns to work with different types of datastreams such as file and database. To use the batch datastream framework, complete the following steps.
JobStepContext ctx= JobStepContextMgr.getContext();
You can use the PersistentMap helper class to simplify the storing of basic types such as Boolean and double in the persistent user data area of the job step context.
java -cp ${WAS_INSTALL_ROOT}/plugins/com.ibm.ws.batch.runtime.jar
com.ibm.ws.batch.packager.WSBatchPackager
-appname=<Application_Name>
-jarfile=<jarfile containing the POJO batch steps>
-earfile=<name of the output EAR file without the .ear extension>
[-utilityjars=<semicolon separated list of utility jars>]
[-debug]
[-gridJob]
java -cp ${WAS_INSTALL_ROOT}/plugins/com.ibm.ws.batch.runtime.jar
com.ibm.ws.batch.packager.WSBatchPackager
-appname=XDCGIVT
-jarfile=XDCGIVTEJBs.jar
-earfile=XDCGIVT
java -cp ${WAS_INSTALL_ROOT}/plugins/com.ibm.ws.batch.runtime.jar
com.ibm.ws.batch.packager.WSBatchPackager
-Dfile.encoding=ISO8859-1
-appname=<Application_Name>
-jarfile=<jarfile containing the POJO batch steps>
-earfile=<name of the output EAR file without the .ear extension>
[-utilityjars=<semicolon separated list of utility jars>]
[-debug]
[-gridJob]
For example for batch jobs, issue java -cp ${WAS_INSTALL_ROOT}/plugins/com.ibm.ws.batch.runtime.jar
com.ibm.ws.batch.packager.WSBatchPackager
-Dfile.encoding=ISO8859-1
-appname=XDCGIVT
-jarfile=XDCGIVTEJBs.jar
-earfile=XDCGIVT
Use one of the following methods.
<WASHOME>/stack_products/WCG/bin/WSBatchPackager.sh
-appname=<application_name>
-jarfile=<jar_file_containing_POJO_step_classes>
-earfile=<output_ear_file_name>
[-utilityjars=<semicolon_separated_utility_jars>]
[-nonxadsjndiname=<non-xa_datasource_JNDI_name_for_CursorHoldableJDBCReader>;<non-XA_datasource_JNDI_name_2>;...]
[-debug]
./WSBatchPackager.sh -appname=XDCGIVT -jarfile=XDCGIVTEJBs.jar -earfile=XDCGIVT -utilityjars=myutility.jar -nonxadsjndiname=jdbc/ivtnonxa
<WASHOME>/stack_products/WCG/bin/WSBatchPackager.sh
-Dfile.encoding=ISO8859-1
-appname=<application_name>
-jarfile=<jar_file_containing_POJO_step_classes>
-earfile=<output_ear_file_name>
[-utilityjars=<semicolon_separated_utility_jars>]
[-nonxadsjndiname=<non-xa_datasource_JNDI_name_for_CursorHoldableJDBCReader>;<non-XA_datasource_JNDI_name_2>;...]
[-debug]
./WSBatchPackager.sh -Dfile.encoding=ISO8859-1 -appname=XDCGIVT -jarfile=XDCGIVTEJBs.jar -earfile=XDCGIVT -utilityjars=myutility.jar
-nonxadsjndiname=jdbc/ivtnonxa
Open a command prompt and ensure that java is on the path.
If your step has exactly one input and one output stream you could alternatively use the Generic batch step of GenericXDBatchStep.
Batch data streams are accessed from the business logic, for example, from the batch job steps by calling BatchDataStreamMgr with jobID and stepID. JobID and stepID are retrieved from the step bean properties list using keys BatchConstants.JOB_ID and BatchConstants.STEP_ID.
You should already have access to the BatchConstants class.
The batch datastream framework provides several ready-to-use patterns to work with different types of datastreams such as file and database. To use the batch datastream framework, complete the following steps.
JobStepContext ctx= JobStepContextMgr.getContext();
You can use the PersistentMap helper class to simplify the storing of basic types such as Boolean and double in the persistent user data area of the job step context.
<taskdef name="pgcpackager" classname="com.ibm.ws.batch.packager.PGCPackager"
classpath="${WAS_INSTALL_ROOT}/plugins/com.ibm.ws.batch.runtime.jar" />
<pgcpackager appname="<appname>" earFile="<location name of EAR file to generate>"
jarfile="location of the POJO jar file"/>