I have such code which imports DMF package and it works fine when I run it not in batch
public class Class1 extends RunBaseBatch
{
public void run()
{
FileUploadTemporaryStorageResult result = this.parmFileUpload();
using(System.IO.MemoryStream stream = result.openResult() as System.IO.MemoryStream)
using(System.IO.Compression.ZipArchive zipArchive = new System.IO.Compression.ZipArchive(stream))
{
while select packageImportStaging
where packageImportStaging.PackageName == "Accounts Payable"
{
zipArchiveEntry = zipArchive.GetEntry(strFmt("%1 %2 %3%4zip", packageImportStaging.Sequence, "@SYS77038",
packageImportStaging.PackageName, "@SYS35672"));
var unzippedStream = zipArchiveEntry.Open();
FileUploadTemporaryStorageResult result2 = File::SendFileToTempStore_GetResult(unzippedStream, zipArchiveEntry.FullName);
batchImporter = DMFPackageImporter1::construct();
batchImporter.parmDMFDefinitionGroupName(packageImportStaging.PackageName);
batchImporter.parmDMFSourceName("Package");
batchImporter.parmFileUpload(result2);
batchImporter.run();
}
}
}
}
DMFPackageImporter1 run() code
public void run()
{
DMFDefinitionGroupName definitionGroupNameLoc = this.parmDMFDefinitionGroupName();
DMFDefinitionGroupName definitionGroupNameProject = "@SYS1052" + " " + definitionGroupNameLoc;
FileUploadTemporaryStorageResult result = this.parmFileUpload();
info("line 90");
var packageFilePath = result.getFileId();
info("line 94");
DMFEntityBase::addEntityForProcessingV3(
definitionGroupNameProject,
definitionGroupNameProject,
"",
this.parmDMFSourceName(),
packageFilePath,
"",
NoYes::No,
NoYes::No
);
info("line 103");
//Setting up an execution Id to link the DIXF Project to an execution
DMFExecutionId executionId = DMFUtil::setupNewExecution(definitionGroupNameProject);
//Begin the execution on the DIXF Project
DMFQuickImportExport::doPGImport(definitionGroupNameProject, executionId, true, false);
}
When I run it in batch like that
public class Class1 extends RunBaseBatch
{
public void run()
{
FileUploadTemporaryStorageResult result = this.parmFileUpload();
//create batch header
batchHeader = BatchHeader::construct();
batchHeader.parmCaption("Import DMF Packages");
using(System.IO.MemoryStream stream = result.openResult() as System.IO.MemoryStream)
using(System.IO.Compression.ZipArchive zipArchive = new System.IO.Compression.ZipArchive(stream))
{
while select packageImportStaging
where packageImportStaging.PackageName == "Accounts Payable"
{
zipArchiveEntry = zipArchive.GetEntry(strFmt("%1 %2 %3%4zip", packageImportStaging.Sequence, "@SYS77038",
packageImportStaging.PackageName, "@SYS35672"));
var unzippedStream = zipArchiveEntry.Open();
FileUploadTemporaryStorageResult result2 = File::SendFileToTempStore_GetResult(unzippedStream, zipArchiveEntry.FullName);
batchImporter = DMFPackageImporter1::construct();
batchImporter.parmDMFDefinitionGroupName(packageImportStaging.PackageName);
batchImporter.parmDMFSourceName("Package");
batchImporter.parmFileUpload(result2);
batchHeader.addTask(batchImporter);
}
batchHeader.save();
}
}
}
it never reaches info("line 94"); line code in the DMFPackageImporter1.run() method.
so as far as i understand the issue happens on the line
var packageFilePath = result.getFileId();
in the DMFPackageImporter1.run()
The parameters I have passed don't come to the instance of the DMFPackageImporter1. That's why I get this error. Why this can happen?
Thank you.