mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
CE-1955 Handle back better; put suggested mapping profile into process value under a dedicated key
This commit is contained in:
@ -38,6 +38,7 @@ import com.kingsrook.qqq.backend.core.processes.implementations.bulk.insert.mapp
|
||||
import com.kingsrook.qqq.backend.core.processes.implementations.bulk.insert.model.BulkLoadFileRow;
|
||||
import com.kingsrook.qqq.backend.core.processes.implementations.bulk.insert.model.BulkLoadProfile;
|
||||
import com.kingsrook.qqq.backend.core.processes.implementations.bulk.insert.model.BulkLoadTableStructure;
|
||||
import com.kingsrook.qqq.backend.core.processes.implementations.etl.streamedwithfrontend.StreamedETLWithFrontendProcess;
|
||||
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
|
||||
|
||||
|
||||
@ -59,10 +60,21 @@ public class BulkInsertPrepareFileMappingStep implements BackendStep
|
||||
BulkLoadTableStructure tableStructure = BulkLoadTableStructureBuilder.buildTableStructure(tableName);
|
||||
runBackendStepOutput.addValue("tableStructure", tableStructure);
|
||||
|
||||
boolean needSuggestedMapping = true;
|
||||
if(runBackendStepOutput.getProcessState().getIsStepBack())
|
||||
{
|
||||
needSuggestedMapping = false;
|
||||
|
||||
StreamedETLWithFrontendProcess.resetValidationFields(runBackendStepInput);
|
||||
}
|
||||
|
||||
if(needSuggestedMapping)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> headerValues = (List<String>) runBackendStepOutput.getValue("headerValues");
|
||||
buildSuggestedMapping(headerValues, tableStructure, runBackendStepOutput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -74,6 +86,7 @@ public class BulkInsertPrepareFileMappingStep implements BackendStep
|
||||
BulkLoadMappingSuggester bulkLoadMappingSuggester = new BulkLoadMappingSuggester();
|
||||
BulkLoadProfile bulkLoadProfile = bulkLoadMappingSuggester.suggestBulkLoadMappingProfile(tableStructure, headerValues);
|
||||
runBackendStepOutput.addValue("bulkLoadProfile", bulkLoadProfile);
|
||||
runBackendStepOutput.addValue("suggestedBulkLoadProfile", bulkLoadProfile);
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,6 +53,7 @@ import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
||||
import com.kingsrook.qqq.backend.core.processes.implementations.bulk.insert.filehandling.FileToRowsInterface;
|
||||
import com.kingsrook.qqq.backend.core.processes.implementations.bulk.insert.model.BulkInsertMapping;
|
||||
import com.kingsrook.qqq.backend.core.processes.implementations.bulk.insert.model.BulkLoadFileRow;
|
||||
import com.kingsrook.qqq.backend.core.processes.implementations.etl.streamedwithfrontend.StreamedETLWithFrontendProcess;
|
||||
import com.kingsrook.qqq.backend.core.utils.CollectionUtils;
|
||||
import com.kingsrook.qqq.backend.core.utils.StringUtils;
|
||||
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
|
||||
@ -75,6 +76,11 @@ public class BulkInsertPrepareValueMappingStep implements BackendStep
|
||||
{
|
||||
try
|
||||
{
|
||||
if(runBackendStepOutput.getProcessState().getIsStepBack())
|
||||
{
|
||||
StreamedETLWithFrontendProcess.resetValidationFields(runBackendStepInput);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// prep the frontend for what field we're going to map now //
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user