Top
Top
LibraryEASYProcess Reference ManualBatch Job

Batch Job Overview

A batch job is a process that runs in the background of your application. It is initiated by EASYProcess instead of by a button or a webpage visit.

Batch jobs can be set to run on a schedule. This can be useful for a refresh of records, such as an item import. The schedule can be set to run out of regular business hours in case the process takes a lot of server resources and would not want to hinder the customer experience while browsing the site.

Batch jobs can be set to run daily to refresh records like items, addresses, or promotions. This sort of frequency is intended for records that are stored in JDE or another database and need to be refreshed daily, but are not likely to change during the day. A real time query to JDE is not necessarily needed.

If a process initiated by a user is very time consuming, you can use a batch job to run that process in the background freeing up the user to continue using your application without being stuck waiting for the process to finish. An example of this batch job would be an excel upload. The user could upload an excel with thousands of rows. The process to do this may take more than the timeout value on the browser, so the user should not wait while it is being processed.

In this example, the button process would not actually process the excel. Instead, the button process on the page would be changed to save a record in a database for the batch job to pick up. The button process will be very quick since it is only saving a record to a database.

Batch Jobs which pick up records from a database queue should be scheduled to run every 5 or 10 minutes. This sort of process could then process the information and, when finished, send out an email to the user when the process is done and provide information on what was done and if there were any unexpected results.


Managing Batch Jobs

 Managing Batch Jobs

Setting up a batch job instance

The first thing you need to do is set up the instance of your batch job, this will create all the other configuration variables that allow you to customize how our batch job runs. To do this you go into the Configuration menu and under Configurations/Systems you should see BatchJob.

Then you will see five boxes, the ones we will be focusing on will be Add New Instance, and Instance. You use Add New Instance to create your batch job instance, you can then modify the instance using the edit button in the Instance box, you would really only do this if you were changing the name of the instance.

To create the new instance you click on the Instance text box in Add New Instance and you give your batch job a meaningful name, then you give it a meaningful description in the Instance Description text box and then you can ignore the Test Process Id and Activate Monitoring checkbox as batch jobs monitor themselves. You then click Add and you should see your new batch job instance appear under batch job on the left hand side of the screen.

Setting the batch job variables

There are a number of variables associated with the batch job instance each adding flexibility to the batch job and how it can be scheduled.

  • Enabled
  • This is a True or False option, if it is set to True your batch job will run according to the schedule set up for it, if it is set to False it will not run.
  • Last Run Date
  • This is a text box that we do not need to set, it gets set automatically whenever the batch job runs, updating the user on when it ran last.
  • Batch Job Log Level
  • This determines the level of logs returned by the batch job, this overrides the log level of the process the batch job calls, so if you are in the process and you do not see logs try checking the log level here.
  • Batch Job Type
  • This determines what your batch job will execute, if it is set to Workflow it will execute a workflow batch, if it is set to process it will execute the process entered into the process id text box, if it is set to log manager it will run the log manager exe. Log manager should already be set up so you should never have to use the log manager option.
  • Process Id
  • The process id, normally looking like PRC-10000xxx, that gets executed when the batch job runs.
  • Run
  • Determines the schedule of your batch job, options are:
  • Daily: In coordination with the Start On selections will run your batch job every day at the specified time.
  • Weekly: in coordination with the Start On selections and the Day of Week text box, will run your batch job on a specific day of the week.
  • Monthly: in coordination with the Start On selections and the Day text box, will run your batch job on a specific day of the month.
  • Yearly: in coordination with the Start On selections and the Date text box, will run your batch job on a specific date in the year.
  • Once: In coordination with the Start On selections and the Date text box, will run your batch job on a specific date in the year but only once.
  • Start On
  • Used in conjunction with the Run variable, you can set what time your batch job will start on the day that it should run.
  • Hours: Starts at 0 and goes to 23
  • Minute: starts at 0 and goes to 59
  • Second: starts at 0 and goes to 59
  • Setting this to all 0s will make the batch job run at midnight server time.
  • Date
  • Allows you to enter in the Date your batch job will run on, will only be available and used when you have Yearly or Once chosen for the Run variable, drop down arrow displays a calendar to select from.
  • Day
  • Allows you to enter in the Day your batch job will run on, will only be available and used when you have Monthly chosen for the run variable, drop down allows you to choose from 1 to 31 which corresponds to the day of the month.
  • Day of Week
  • Allows you to enter in the Day of the week your batch job will run on, will only be available and used when you have Weekly chosen for the Run variable, drop down arrow displays Monday through Sunday.
  • Repeat
  • True or False which determines whether you want your batch job to run multiple times throughout the day, works in conjunction with Repeat In variables.
  • Repeat In
  • Determines how often the batch job will repeat throughout the day
  • Hours: Starts at 0 and goes to 23
  • Minute: starts at 0 and goes to 59
  • Second: starts at 0 and goes to 59
  • EP App Server Name
  • Can be set to the Application Server or can be left blank, if you manually run the batch job from this window it will use the server you are on, if that server is not the application server you should set this variable.
  • Configuration Profile
  • If you have multiple profiles set up, you can set value to match that profile, then when the batch runs for that profile it can different settings as compared to another batch with a different profile.
  • Group Job
  • This can be set to True or False. If it is set to True it will allow you to schedule batch jobs to be run as a group. To Accomplish this you need to set this flag to true and then through a process or manually enter records into the table EP_Profile_Configuration_Instance_GroupJobs table, giving it a GroupJ ob name in the GroupJob field, entering in the batch job name into the BatchJob field, and setting  a priority number which will determine the order in which the batch jobs will run. The only batch job in the group that needs to have this flag set to true is the first one, and the group will start when the first batch job is scheduled to start. If you add other batch jobs to the group job their schedules will be ignored.
  • Group Job Wait Time In Seconds
  • This determines how long to wait in seconds before starting the next batch job in a group of batch jobs.
  • Status
  • Displays the status of the currently running batch job. Can be left alone as it is set by the system while a batch job is running.
  • Token
  • Token of the current or most recent batch job that run. Can be left alone as it is set by the system.
  • Windows Process Id
  • Displays the current, or most recent, windows process id. Should be left alone as it is set by the system.

After you have made the appropriate changes click the save button at the bottom to make sure you do not lose your changes.

Viewing Batch Logs

On the right hand side of the screen you can view the logs of the batch job without having to go to the process. You can also Refresh and Purge the logs for that batch job as well.

Manually Starting a Batch Job

You can manually start and stop a batch job from the configuration screen by clicking the start ot stop buttons, it will also give you basic information that can be set by the batch job itself.

This does not automatically refresh itself though so if you are looking to see these values you change you need to click refresh while the batch job is running.


Powered by EASYProcess (© 2019 K-Rise Systems, Inc).