galovics commented on code in PR #2759:
URL: https://github.com/apache/fineract/pull/2759#discussion_r1032212242
##########
fineract-provider/src/main/java/org/apache/fineract/cob/loan/AbstractLoanItemProcessor.java:
##########
@@ -40,17 +42,25 @@ public abstract class AbstractLoanItemProcessor implements
ItemProcessor<Loan, L
@Setter(AccessLevel.PROTECTED)
private ExecutionContext executionContext;
+ private LocalDate businessDate;
@Override
public Loan process(@NotNull Loan item) throws Exception {
TreeMap<Long, String> businessStepMap = (TreeMap<Long, String>)
executionContext.get(LoanCOBConstant.BUSINESS_STEP_MAP);
- return cobBusinessStepService.run(businessStepMap, item);
+ Loan alreadyProcessedLoan =
cobBusinessStepService.run(businessStepMap, item);
+ alreadyProcessedLoan.setLastClosedBusinessDate(businessDate);
+ return alreadyProcessedLoan;
}
@AfterStep
public ExitStatus afterStep(@NotNull StepExecution stepExecution) {
return ExitStatus.COMPLETED;
}
+ protected void setBusinessDate(StepExecution stepExecution) {
Review Comment:
You sure we need this? We already have the executioncontext within this
class and using it in the process method. Why don't we do it similarly?
##########
fineract-provider/src/main/java/org/apache/fineract/cob/common/AbstractCustomJobParameterResolver.java:
##########
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.cob.common;
+
+import com.google.common.reflect.TypeToken;
+import com.google.gson.Gson;
+import java.util.HashSet;
+import java.util.Set;
+import lombok.RequiredArgsConstructor;
+import org.apache.fineract.cob.exceptions.CustomJobParameterNotFoundException;
+import
org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
+import org.apache.fineract.infrastructure.jobs.data.JobParameterDTO;
+import org.apache.fineract.infrastructure.jobs.domain.CustomJobParameter;
+import
org.apache.fineract.infrastructure.jobs.domain.CustomJobParameterRepository;
+import org.apache.fineract.infrastructure.springbatch.SpringBatchJobConstants;
+import org.springframework.batch.core.scope.context.ChunkContext;
+import org.springframework.beans.factory.InitializingBean;
+
+@RequiredArgsConstructor
+public class AbstractCustomJobParameterResolver implements InitializingBean {
Review Comment:
I more thought of this as either an Abstract Tasklet that ppl can reuse or
just a regular resolver that Tasklets can use.
Now this is something else between the 2. :-)
Maybe just go with a simple resolver, that's the most generic approach.
--
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]