Wednesday, 20 April 2016

Multi threading–Adding run time tasks

Last year I posted about multi threaded operation using BOF Also uploaded a sample project you could use to test it out or use as a template.

Multithreading with Business Operation Framework [AX 2012]

One thing I picked up after testing it in a large scale project which required scheduling it on a non default (blank) batch group. This had a few issues:

Originally I was using the 

batchHeader.addTask(this.newTaskController(recIdSet));

Below are the two issues of using this method like this.

1. There is a known issue to set the controller execution mode to be Synchronous.

Whitepaper: https://www.microsoft.com/en-us/download/details.aspx?id=29215

Screenshot of the known issue.

2016-03-31_1223

This separates it as its own batch job which disappears after it is finished. This is not the desired result when we are adding tasks at runtime. We want to keep them as tasks under the main batch.

2. Another issue is it will set the batch group as the default batch (blank). In my case the blank batch group was not my ideal batch server.

I rewrote that section as per below.

2016-03-31_1220

2 comments:

Aman Nain said...

Hi Munib, good post.

Your link to xpo does not work. Can you provide a working link?

For some more reading on multi-threading and adding dependency, read my post
http://amannain.blogspot.com.au/2014/04/multi-threading-dependent-tasks-in.html

Aman Nain said...

My take on a multi-threaded batch job template

http://amannain.blogspot.com.au/2016/05/multi-threaded-batch-job-template.html