JSR 352 Java Batch

Use the JSR 352 Java Batch job type to schedule the running of Java Batch programs that implement the JSR 352 standard programming specification.

A description of the job properties and valid values are detailed in the context-sensitive help in the Dynamic Workload Console by clicking the question mark (?) icon in the top-right corner of the properties pane.
This section describes the required and optional attributes for JSR 352 Java Batch jobs. Each job definition has the following format and attributes:
Table 1. Required and optional attributes for the definition of a JSR 352 Java Batch job
Attribute Description and value Required
hostname The host name of the WebSphere Application Server Liberty Base application server where you want to run your Java Batch application.
port The port number where the application server is listening.
protocol The protocol for connecting to the application server. Supported values are http and https.
user name The user to be used for accessing the application server. This attribute is optional, depending on the settings on your server.
password The password to be used for accessing the application server. This attribute is optional, depending on the settings on your server.
keystore file path The fully qualified path of the keystore file containing the private key that is used to make the connection. If you use an HTTPS connection, ensure that the security certificates are configured for Job Manager on the workstation where the job is to run.
keystore file password The password that protects the private key and is required to make the connection. Required only if you specify a keystore file path.
number of retries The number of times that the program retries when connecting to the application server. Default value is 0.
retry interval (seconds) The number of seconds that the program waits before retrying to connect to the application server. Default value is 30 seconds.
application name The name of the JSR 352 Java Batch application to be started.
module name The name of the WAR file in which the JSR 352 Java Batch application is packaged.
EJB Component name The name of the EJB component within the batch application EJB module. If specified, the job is submitted under the EJB component context. Required only when the module is an EJB module. When the module is a WAR module, this attribute is not required.
job XML name The name of the job specification language XML file that will be used to submit this job.
job XML file The full path and file name of the job XML file that is used to submit the JSR 352 Java Batch job. If you specify this parameter, the job XML instructions that you specify in the Job XML field are ignored at run time.
job XML Enter the job XML instructions that you want to use at run time to submit theJSR 352 Java Batch job. The job XML instructions are validated when you save the HCL Workload Automation JSR 352 Java Batch job. The job XML instructions are ignored if a job XML file path is provided with the Job XML file parameter.
job parameters One or more parameters, and related value, that might be required by your JSR 352 Java Batch application.
Note: To configure the dynamic agent on which the JSR 352 job will run in cases where a proxy is setup between the agent and the machine, the following information on the proxy and authentication parameters have to be specified in the agent jobManager.ini file section:
[JavaJobLauncher]
The parameters to specify are:
-Dhttp.proxyHost=proxyhostURL 
-Dhttp.proxyPort=proxyPortNumber 
-Dhttp.proxyUser=someUserName 
-Dhttp.proxyPassword=somePassword

Scheduling and stopping a job in HCL Workload Automation

You schedule JSR 352 Java Batch jobs by defining them in job streams. Add the job to a job stream with all the necessary scheduling arguments and submit it.

You can submit jobs using the Dynamic Workload Console, Application Lab, or the conman command line.

After the submission, when the job is running and is reported in EXEC status in HCL Workload Automation, you can stop it if necessary by using the kill command fromr the Dynamic Workload Console. This action stops also the program execution on the application server.

Restarting a JSR 352 Java Batch job

When the scheduled time to run a JSR 352 Java Batch job is reached, the job is run by the agent. You can monitor and even interrupt the job by using the monitoring features of HCL Workload Automation. You can monitor the job by using any of the product interfaces.

During the job execution, when monitoring the job from the Dynamic Workload Console, the Workflow Details panel displays information about the steps that are already started on the JSR 352 Java Batch server. From the Monitor jobs view, in the Job Type column, click the hyperlink Workflow Details . The Workflow Details panel opens. If the JSR 352 Java Batch job fails, you can restart the workflow from the first failed step, within the same job instance. This happens in case of parallel steps also.

Job properties

You can see the job properties by running conman sj <job_name>;props, where<job_name> is the JSR 352 Java Batch job name.

The following example shows the properties that you can find in the Extra Information section of the output command:

Cache-Control=	no-cache="set-cookie, set-cookie2"
Content-Lenght=	658
Content-Type= 	application/json; charset=UTF-8
Date	=	Thu, 04 Jun 2015 14:36:12 GMT
ExitStatus = COMPLETED
Espires=	Thu, 01 Dec 2019 16:00:00 GMT
Job Batch Status= COMPLETED
Job Instance Id=	223
Job Name=	sleepy-batchlet
Set-Cookie=		LtpaToken2-=2xktDMTwg6MhU6Xm3MbmkGzLclxFSKwZHwOBM1XpTa+Qvs
Status Code=	200 OK
Step.1.BatchStatus= COMPLETED
Step.1.Name=	step1
X-Powered-By= 	Servlet/3.1
Job Execution Id=	220
Job Execution	=	https://localhost:9443/hcl/api/batch/jobinstances
/223/jobexecutions/220
Job Logs=	https://localhost:9443/hcl/api/batch/jobinstances/223/joblogs
Self=	https://localhost:9443/hcl/api/batch/jobinstances/223

You can export some of the JSR 352 Java Batch job properties that you see in the Extra Information section, to a successive job in the same job stream instance. For more information about the list of job properties that you can export, see Properties for JSR 352 Java Batch jobs .

Job log content

You can see the job log content by running conman sj <job_name>;stdlist, where <job_name> is the JSR 352 Java Batch job name.

See also

From the Dynamic Workload Console you can perform the same task as described in

Creating job definitions.

For more information about how to create and edit scheduling objects, see

Designing your Workload.