AX Batch Job Dependencies – Avoid SQL Blocking

AX Batch Job Dependencies – Avoid SQL Blocking

AX Batch Job Dependencies – Avoid SQL Blocking

Want to make your AX batch jobs run more efficiently? Does your business run multiple batch jobs that you would like to have start in a series dependent on other jobs? In addition, you can avoid extended blocking by tying batch jobs together that hit the same tables.

When running your business with AX, it can require the use of many batch jobs completing tasks in the background in order to minimize the need for manual intervention in the system. When these batches are setup as individual jobs, businesses can run into issues from system blocking of tables to inefficient system management because of the timing of execution of jobs. As an example, let’s say you would like to first run the Inventory status change batch job to block inventory that shouldn’t be available. Ideally, when this job finishes would be the best time to then execute the release of sales or transfer orders. As opposed to setting up both batch jobs independently and hoping the timing works out each time they run, these can be setup as batch tasks with conditions ensuring that one job ends before another starts. In a similar scenario, if your business uses a cleanup job for cases when a job ends in error, this tool can be used to only trigger the cleanup job when the initial job ends in error.

In order to setup this up:

System Administration>Inquiries>Batch jobs

1

On this page, click File>New or CTRL+N to create new.
Give the Batch job a description, then click CTRL+S to save the record and activate the ability to View Tasks:

2

In the Batch tasks screen click File>New or CTRL+N to create new.

Give the first batch job in the sequence a description, choose the Company accounts for which it will run, and choose the Class name of the batch.

3

Then click File>New or CTRL+N again to add the next batch in sequence.

[Once you’ve added the next task(s) click F5 to refresh the screen and display the tasks in sequence as they were created, and to how they will execute.]

4

Now to create conditions within the job (in this example we are going to say we don’t want the Auto Release of Sales Orders to occur if the Inventory Status Change job ends in error), click the job for which you’d like to create a condition and click inside the Has conditions grid in the bottom of the screen and press CTRL+N for a new condition.

The tasks that you can choose from, from the above defined list of batch tasks, will be in the drop down for the Task ID.

5

Once the Task ID is chosen, choose the Expected Status that the following batch task will be dependent on. In this example, we are choosing “Ended” to say that the Inventory Status Change job must be ended in order for the Release job to begin. The other choices are “Error,” like our example of a cleanup job that would only run when a batch ends in an error, or “Ended or Error” if you’d like the following job to start whether it ends or errors.

6

In addition, you can state in the Condition type if you have multiple conditions whether it can hit Any of the conditions or must hit All of the conditions.

7

  • Batch jobs can be setup as batch tasks in a sequence with conditions for the execution of the following job(s)
  • Creating batch job tasks in a sequence as opposed to as individual jobs can help the system run more efficiently and prevent table blocking

 

Share on Google+Tweet about this on TwitterShare on LinkedInShare on FacebookEmail this to someone