adamsaghy commented on code in PR #2625:
URL: https://github.com/apache/fineract/pull/2625#discussion_r984315705


##########
fineract-provider/src/main/java/org/apache/fineract/cob/service/ConfigJobParameterServiceImpl.java:
##########
@@ -59,15 +60,22 @@ public JobBusinessStepConfigData 
getBusinessStepConfigByJobName(String jobName)
     public CommandProcessingResult updateStepConfigByJobName(JsonCommand 
command, String jobName)
             throws BusinessStepNotBelongsToJobException {
         List<BusinessStep> businessSteps = dataParser.parseUpdate(command);
-        List<BatchBusinessStep> batchBusinessSteps = 
batchBusinessStepRepository.findAllByJobName(jobName);
-        businessSteps.forEach(newBusinessStepConfig -> {
-            BatchBusinessStep batchBusinessStep = batchBusinessSteps.stream()
-                    .filter(oldBusinessStepConfig -> 
oldBusinessStepConfig.getStepName().equals(newBusinessStepConfig.getStepName()))
-                    
.findFirst().orElseThrow(BusinessStepNotBelongsToJobException::new);
-            batchBusinessStep.setStepName(newBusinessStepConfig.getStepName());
-            batchBusinessStep.setStepOrder(newBusinessStepConfig.getOrder());
-            batchBusinessStepRepository.save(batchBusinessStep);
-        });
+        List<String> availableBusinessStepNames = 
getAvailableBusinessStepsByJobName(BusinessStepCategory.LOAN.name())

Review Comment:
   Performance improvement: You make this class to implement InitializingBean. 
In the afterPropertiesSet method can call the 
"getAvailableBusinessStepsByJobName" method and save the response at class 
level. The (application wise) available business step implementation will not 
be changed during runtime.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to