@@ -500,7 +500,7 @@ public int upgradeLegacyFlows(FlowManager flowManager) {
500500 return upgradeLegacyFlows (flowManager , new ArrayList <>(), new ArrayList <>(), new ArrayList <>(), "data-hub-STAGING" , "data-hub-FINAL" );
501501 }
502502
503- public int upgradeLegacyFlows (FlowManager flowManager , List <String > legacyEntities , List <String > legacyFlowTypes , List <String > legacyFlowNames , String sourceDb , String targetDb ) {
503+ public int upgradeLegacyFlows (FlowManager flowManager , List <String > legacyEntities , List <String > legacyFlowTypes , List <String > legacyFlowNames , String stagingDb , String finalDb ) {
504504 Set <String > legacyEntitiesSet = new HashSet <>(legacyEntities );
505505 Set <String > legacyFlowTypesSet = new HashSet <>(legacyFlowTypes );
506506 Set <String > legacyFlowNamesSet = new HashSet <>(legacyFlowNames );
@@ -579,7 +579,7 @@ public int upgradeLegacyFlows(FlowManager flowManager, List<String> legacyEntiti
579579 JsonNode stepPayLoad = scaffolding .getStepConfig (newStepName , stepType , newStepName , null , acceptSourceModule );
580580 // Save StepDefinition to local file
581581 scaffolding .saveStepDefinition (newStepName , newStepName , stepType , true );
582- updateStepOptionsFor4xFlow (stepName , stepFile , stepPayLoad , mainModulePath , legacyEntityDir .getName (), sourceDb , targetDb );
582+ updateStepOptionsFor4xFlow (stepName , stepFile , stepPayLoad , mainModulePath , legacyEntityDir .getName (), stagingDb , finalDb );
583583 // Save Step to local file
584584 scaffolding .saveLocalStep (stepType , stepPayLoad );
585585 // Add step to local Flow
@@ -598,7 +598,7 @@ public int upgradeLegacyFlows(FlowManager flowManager, List<String> legacyEntiti
598598 return flowsUpdated ;
599599 }
600600
601- private void updateStepOptionsFor4xFlow (String stepName , File stepFile , JsonNode stepPayLoad , String mainModulePath , String entityType , String sourceDb , String finalDb ) {
601+ private void updateStepOptionsFor4xFlow (String stepName , File stepFile , JsonNode stepPayLoad , String mainModulePath , String entityType , String stagingDb , String finalDb ) {
602602 ObjectNode step = (ObjectNode ) stepPayLoad ;
603603 ObjectMapper mapper = new ObjectMapper ();
604604 Properties properties = new Properties ();
@@ -618,7 +618,7 @@ private void updateStepOptionsFor4xFlow(String stepName, File stepFile, JsonNode
618618 optionsNode .put ("mainModuleUri" , mainModulePath .concat ("/" ).concat (properties .getOrDefault ("mainModule" , "main.sjs" ).toString ()));
619619
620620 if (step .get ("stepDefinitionType" ).asText ().equals ("custom" )) {
621- step .put ("sourceDatabase" , sourceDb );
621+ step .put ("sourceDatabase" , stagingDb );
622622 step .put ("targetDatabase" , finalDb );
623623 step .put ("sourceQueryIsModule" , true );
624624 mainModulePath = mainModulePath .concat ("/" ).concat (properties .getOrDefault ("collectorModule" , "collector.sjs" ).toString ());
@@ -628,7 +628,7 @@ private void updateStepOptionsFor4xFlow(String stepName, File stepFile, JsonNode
628628
629629 optionsNode .put ("entity" , entityType );
630630 } else {
631- step .put ("targetDatabase" , sourceDb );
631+ step .put ("targetDatabase" , stagingDb );
632632 step .put ("inputFilePath" , "" );
633633 }
634634 step .putIfAbsent ("options" , optionsNode );
0 commit comments