Hi,
I am currently executing a DMF project from my code with:
DMFQuickImportExport::doPGImport(defintionGroup, executionId, true);
This works great, but it runs synchronous. I want to run it in batch mode. I tried the following (DMFBatchImporter):
public void runInBatchMode(DMFExecutionId executionId, str definitionGroup) { BatchHeader batchHeader; BatchInfo localBatchInfo; DMFBatchImporter importAsBatch = new DMFBatchImporter(); importAsBatch.parmExecutionId(executionId); importAsBatch.parmReadyForBatchRun(true); SysRecurrenceData sysRecurrenceData = SysRecurrence::defaultRecurrence(); sysRecurrenceData = SysRecurrence::setRecurrenceEndAfter(sysRecurrenceData, 1); localBatchInfo = importAsBatch.batchinfo(); localBatchInfo.parmGroupId(definitionGroup); batchHeader = batchHeader::construct(); batchHeader.addTask(importAsBatch); batchHeader.parmRecurrenceData(sysRecurrenceData); batchHeader.save(); info("Batch job created"); }
The batch job kicks off, but never finishes. The data is stuck in Pending status:
Any thoughts?
Thanks.
Judy,
Thank you!. I did search the AOT, but your suggestion put me on the right path.
Here is the solution:
DMFDefinitionGroup defGroup = DMFDefinitionGroup::find(defintionGroup, true); WSTG_Helpers::StartImportInBatch(defGroup, executionId);
public static void StartImportInBatch(DMFDefinitionGroup _definitionGroup, DMFExecutionId executionId) { DMFBatchImporter batchImporter = new DMFBatchImporter(); batchImporter.batchInfo().parmBatchExecute(NoYes::Yes); batchImporter.parmReadyForBatchRun(true); DMFExecutionId xexecutionId = DMFPackageImporter::PrepareDefinitionGroupForImport(_definitionGroup.DefinitionGroupName, executionId, curExt(), true); batchImporter.parmExecutionId(xexecutionId); batchImporter.saveLast(); batchImporter.batchInfo().doBatch(); }
What is the status of the batch job itself?
Hi PhillyNJ,
Regarding this DMFBatchImporter class, I think there are many examples in AOT that you can refer to that call some known functions. And have you debugged your code yet?
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156