Description
When a data source has multiple transform maps, during an import when records are loaded and transform begins, the import set state is set to "Processed" as soon as the first transform completes but the second transform map is still running.
Steps to Reproduce
- Create a data source and load large data so the issue can be seen.
- Create two transform maps for that data source and specify different order for both.
- Load all records.
- Click Run transform, select both transform maps and click Transform.
- Duplicate tab and navigate to System Import Sets > Advanced > Import sets.
- Open the ISET record created.
- Observe the state of the import set and the state of transform maps below.
- Keep reloading the page to see the state change from Loaded to Processed and observe that second transform is still running.
Workaround
Update the script in the business rule "Update Import Set Complete" on sys_import_set_run table with the script provided below:
setImportSetProcessed();
function setImportSetProcessed() {
var isrgr = new GlideRecord("sys_import_set_run");
isrgr.addQuery("set", current.set);
isrgr.query();
while (isrgr.next()) {
if(isrgr.state != "complete" && isrgr.state != "complete_with_errors")
return;
}
var isgr = new GlideRecord("sys_import_set");
isgr.addQuery("sys_id", current.set);
isgr.query();
if (isgr.next()) {
if (isgr.mode != "synchronous") {
isgr.state = "processed";
isgr.update();
}
}
}
Related Problem: PRB1155279