Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Multi thread batch job not executing in the selected batch group

$
0
0

Hi,

I have a multi thread batch that it doesn't matter what batch group I select to be executed in, the thread tasks are always created on the empty batch group. If affects how is processed because the batch group I want my process to run has some batch servers assigned for its processing and the empty batch group has a different set of servers for processing.

This means that any batch process I have that is multi thread will run its child tasks on the wrong servers rather than the ones defined in the batch group I selected when executing the process.

Class: CustAgingSnapshot

// Code to create the batch header

if (!hasJobBeenSplit && isRunInBatch)
    {
        batchHeader = BatchHeader::getCurrentBatchHeader();

        if (batchHeader == null)
        {
            batchHeader::construct(this.parmCurrentBatch().RecId);
        }

// Code to create the extra tasks
private void createSubJobs(BatchHeader _batchHeader)
{
    CustAgingSnapshot custAgingSnapshot;

    custAgingSnapshot = CustAgingSnapshot::construct();

    custAgingSnapshot.unpack(this.pack());
    custAgingSnapshot.parmHasJobBeenSplit(true);

    batchInfo = custAgingSnapshot .batchInfo();
    batchInfo.parmCaption(strFmt('%1 : %2', fromCustomer, toCustomer));
    _batchHeader.addRuntimeTask(custAgingSnapshot, this.parmCurrentBatch().RecId);
}


End result: 

The very first task that is created when the batch is created and it's assigned with the right batch group I selected when executing my process, the following tasks created with an empty batch group, hence they are executed in another servers.

How can I make sure child tasks are created with the same batch group?

Thanks,


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>