Viewing Java batch jobs in Admin Center

With the Admin Center Java Batch tool, you can view the progress and status of your Java™ batch jobs.

Before you begin

To use the Java Batch tool, you must enable the tool in Admin Center and have batch jobs to view:

  1. Ensure that the configuration file for the server that runs Admin Center has the following Liberty features:
    • adminCenter-1.0
    • batchManagement-1.0
  2. Add the Java Batch tool to your dashboard. See Customizing the Toolbox.
  3. Create and deploy a Java batch application and then submit batch jobs. The database of batch jobs must be persisted. A database must be used in the persistence configuration even if all jobs run on the same server as the job that runs on the Java batch tool. The Java batch tool can be used to view and manage jobs and job logs of servers that use the same job repository. The scope of the tool's administration function equals the scope of the job repository.
  4. If the batch jobs or job logs do not reside on the server that runs Admin Center, configure CORS on each remote server that has batch jobs or job logs to enable Admin Center to request job information from each remote server. In a multiple-server batch environment, Admin Center relies on CORS to relax the same-origin policy for remote calls to other Liberty servers. Your CORS configuration on remote servers that Admin Center accesses must specify the URL of the Admin Center server in the allowedOrigins attribute of the cors element:
    
    <cors
        domain="/ibm/api/batch"
        allowedOrigins="https://Admin_Center_host:Admin_Center_port"  
        allowedHeaders="Accept, Accept-Encoding, Content-Type, X-Requested-With" 
        allowedMethods="GET, PUT, DELETE, OPTIONS"
        exposeHeaders=""
        allowCredentials="true"
        maxAge="3600"/>
    

    The CORS configuration does not need to be on the Liberty server where Admin Center runs. See Configuring Cross Origin Resource Sharing on a Liberty server. For details on cors attributes, see cors - Cross-Origin Resource Sharing (cors).

About this task

View and filter your Java batch jobs by using the Java Batch tool.

Procedure

  • Customize the dashboard.
    • Select the number of job instances to display.
      By default, the dashboard displays 100 updated job instances, with the most recent displayed first. From the dashboard footer, select the maximum number of job instances to display. Choices include 50, 100, 500, and 1000.
      Tip: If the selection is 1000 and the job instance you want to examine is not shown in the dashboard, change the filter options.
    • Select the columns of job information to display.

      Job information includes the batch job name and ID, the application name, the job submitter, the date of the last update, and the job instance state. You can choose the columns to display.

      1. Select Column Selection Column selection icon.
      2. From the list, select the columns that you want displayed. Clear the columns that you don't want displayed.
  • View job executions.
    1. Hover over a Batch Job Name and expand the twistie The twistie that expands.

      In the executions tables, the values in the Host and Server Name columns are links to corresponding pages in the Explore tool. If you install the Explore tool, you can get more status information on these elements.

    2. Select the job execution ID number to view details about the job.
      The job execution details page shows details about job steps and partitions.
      • Partitions are indicated by Partitions Partitions icon.
      • In the Server section of the job execution details page, the values for the Name and Host fields are links to their corresponding pages in the Explore tool. If you install the Explore tool, you can get more status information on these elements.
    3. To view details about another job execution, you can change the number on the URL.
      For example, if you change 2 in the URL to 4, you can view Job Execution ID 4 without using the interface. See the change in the following URLs:

      https://host_name:port_number/adminCenter/#javaBatch/jobexecutions/2

      https://host_name:port_number/adminCenter/#javaBatch/jobexecutions/4

    4. Select Column Selection Column selection icon to display more or less information about the job execution.
  • View a log file for a batch job.
    1. Select View log file View log file icon.
    2. From the Log view footer, you can select Top of Logs and End of Logs arrows to view lengthy log files.
    3. Select Download to download the log file.
  • Manage a job instance.
    1. Select Actions Actions icon for a job instance.
    2. Select an action.
      Restart
      Starts a job execution again. By default, the Restart action uses the parameters of the previous job execution.

      You can change the parameters in the Restart dialog:

      1. Deselect Reuse parameters from previous execution.
      2. Use Add parameter Add parameter icon to add parameters, use Remove parameter Remove parameter icon to remove parameters, or edit existing parameter names and values.
      3. Click Restart.
      Stop
      Stops a running job execution.
      Purge
      Deletes all database entries and, optionally, deletes job logs associated with the job instance.
    3. Confirm the selection.
  • Filter information about job instances.

    By default, the tool lists job instances of all states. You can set up numerous search criteria options. If you search by using the same criteria, such as two instance states, the criteria are filtered as or operators. If you filter by using different criteria, such as one instance state and one instance ID, the criteria are filtered as and operators. To change the information that is displayed, change the search criteria:

    1. Select Add Search Criteria Add Search Criteria icon.
    2. From the list of search filter criteria, select one of the following options and specify a value:
      • Instance State to display job instances that have one of following states:
        • All to display job instances with the most recently updated appearing last
        • Queued to view all instances of Submitted, JMS Queued, and JMS Consumed states. Or select Submitted, JMS Queued, and JMS Consumed individually.
        • Dispatched
        • Ended filters for all instances with Failed, Stopped, Completed, and Abandoned states. Or select Failed, Stopped, Completed, and Abandoned individually.
      • Instance ID to display a job instance with the specified job execution ID.
      • Last Update to display job instances with the specified date.
      • Last Update Range to display active job instances between the specified dates.
      • JES Job Name to display job instances with the specified job name. You can use the wildcard (*) operator anywhere in the string.
      • JES Job ID to display job instances with the specified job ID. You can use the wildcard (*) operator anywhere in the string.
      • Submitter to display job instances with the specified submitter name. The search is case insensitive. You can use the wildcard (*) operator anywhere in the string.
      • Application Name to display job instances with the specified application name. The search is case insensitive. You can use the wildcard (*) operator anywhere in the string.
      • Batch Job Name to display job instances with the specified batch job name. The search is case insensitive. You can use the wildcard (*) operator anywhere in the string.
    3. Select Search Search icon. to run your query.

    To clear your query, select Clear Search Field Clear Search Field icon.

What to do next

To refresh the current page, select Refresh Refresh icon.

To return to the dashboard, select Dashboard Dashboard icon.

From the job execution details or job log file page, you can select from the horizontal navigation bar to display a different page.