From 39a787ab74dfba879baa5f7ed9a315d0d6bc15bf Mon Sep 17 00:00:00 2001 From: saba_zedginidze Date: Mon, 30 Dec 2024 14:35:38 +0400 Subject: [PATCH] [MODEXPS-273] Improve step execution conditions --- .../edifact/jobs/EdifactExportJobConfig.java | 27 ++++----- .../edifact/jobs/ExportHistoryTasklet.java | 16 ++++-- .../edifact/jobs/FilterableTasklet.java | 56 +++++++++++++++++++ .../jobs/MapToEdifactClaimsTasklet.java | 15 +---- .../jobs/MapToEdifactOrdersTasklet.java | 17 +----- .../edifact/jobs/MapToEdifactTasklet.java | 15 +++-- .../jobs/SaveToFileStorageTasklet.java | 31 +++++----- .../edifact/jobs/SaveToMinioTasklet.java | 22 ++------ 8 files changed, 114 insertions(+), 85 deletions(-) create mode 100644 src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/FilterableTasklet.java diff --git a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/EdifactExportJobConfig.java b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/EdifactExportJobConfig.java index 1edad4a8..406491b3 100644 --- a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/EdifactExportJobConfig.java +++ b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/EdifactExportJobConfig.java @@ -4,7 +4,6 @@ import lombok.extern.log4j.Log4j2; import org.folio.dew.domain.dto.ExportType; import org.springframework.batch.core.Job; -import org.springframework.batch.core.JobExecutionListener; import org.springframework.batch.core.Step; import org.springframework.batch.core.job.builder.JobBuilder; import org.springframework.batch.core.launch.support.RunIdIncrementer; @@ -22,16 +21,18 @@ public class EdifactExportJobConfig { public static final String POL_MEM_KEY = "poLineIds"; private Job constructEdifactExportJob(JobBuilder jobBuilder, - JobExecutionListener listener, - Step... steps) { - var builder = jobBuilder - .incrementer(new RunIdIncrementer()) - .listener(listener) - .start(steps[0]); - for (int i = 1; i < steps.length; i++) { - builder = builder.next(steps[i]); - } - return builder.build(); + EdiExportJobCompletionListener ediExportJobCompletionListener, + Step mapToFileStep, + Step saveToMinIOStep, + Step saveToFTPStep, + Step createExportHistoryRecordsStep) { + return jobBuilder.incrementer(new RunIdIncrementer()) + .listener(ediExportJobCompletionListener) + .start(mapToFileStep) + .next(saveToMinIOStep) + .next(saveToFTPStep) + .next(createExportHistoryRecordsStep) + .build(); } @Bean @@ -43,9 +44,9 @@ public Job edifactOrdersExportJob(EdiExportJobCompletionListener ediExportJobCom @Bean public Job edifactClaimsExportJob(EdiExportJobCompletionListener ediExportJobCompletionListener, JobRepository jobRepository, - Step mapToEdifactClaimsStep, Step saveToFTPStep, Step saveToMinIOStep) { + Step mapToEdifactClaimsStep, Step saveToFTPStep, Step saveToMinIOStep, Step createExportHistoryRecordsStep) { return constructEdifactExportJob(new JobBuilder(ExportType.CLAIMS.getValue(), jobRepository), - ediExportJobCompletionListener, mapToEdifactClaimsStep, saveToFTPStep, saveToMinIOStep); + ediExportJobCompletionListener, mapToEdifactClaimsStep, saveToFTPStep, saveToMinIOStep, createExportHistoryRecordsStep); } @Bean diff --git a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/ExportHistoryTasklet.java b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/ExportHistoryTasklet.java index 6f9b01c9..33f6a35f 100644 --- a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/ExportHistoryTasklet.java +++ b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/ExportHistoryTasklet.java @@ -3,6 +3,7 @@ import static org.folio.dew.batch.acquisitions.edifact.jobs.EdifactExportJobConfig.POL_MEM_KEY; import static org.folio.dew.domain.dto.JobParameterNames.ACQ_EXPORT_FILE_NAME; import static org.folio.dew.domain.dto.JobParameterNames.EDIFACT_ORDERS_EXPORT; +import static org.folio.dew.domain.dto.VendorEdiOrdersExportConfig.IntegrationTypeEnum.ORDERING; import java.util.Collections; import java.util.Date; @@ -22,19 +23,18 @@ import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.configuration.annotation.StepScope; import org.springframework.batch.core.scope.context.ChunkContext; -import org.springframework.batch.core.step.tasklet.Tasklet; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import lombok.RequiredArgsConstructor; +import lombok.experimental.SuperBuilder; import lombok.extern.log4j.Log4j2; -@RequiredArgsConstructor +@SuperBuilder @Component @StepScope @Log4j2 -public class ExportHistoryTasklet implements Tasklet { +public class ExportHistoryTasklet extends FilterableTasklet { private final KafkaService kafkaService; private final ObjectMapper ediObjectMapper; @@ -43,7 +43,7 @@ public class ExportHistoryTasklet implements Tasklet { @Value("#{jobParameters['jobId']}") private String jobId; @Override - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { + public RepeatStatus execute(VendorEdiOrdersExportConfig exportConfig, StepContribution contribution, ChunkContext chunkContext) { var exportHistory = buildExportHistory(chunkContext); kafkaService.send(KafkaService.Topic.EXPORT_HISTORY_CREATE, null, exportHistory); @@ -83,4 +83,10 @@ List getPoLineIdsFromExecutionContext(StepExecution stepExecutionContext return Collections.emptyList(); } } + + @Override + protected boolean shouldExecute(VendorEdiOrdersExportConfig exportConfig) { + return exportConfig.getIntegrationType() == ORDERING; + } + } diff --git a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/FilterableTasklet.java b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/FilterableTasklet.java new file mode 100644 index 00000000..7f4b69a4 --- /dev/null +++ b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/FilterableTasklet.java @@ -0,0 +1,56 @@ +package org.folio.dew.batch.acquisitions.edifact.jobs; + +import static org.folio.dew.domain.dto.JobParameterNames.EDIFACT_ORDERS_EXPORT; + +import org.folio.dew.domain.dto.VendorEdiOrdersExportConfig; +import org.springframework.batch.core.StepContribution; +import org.springframework.batch.core.scope.context.ChunkContext; +import org.springframework.batch.core.step.tasklet.Tasklet; +import org.springframework.batch.repeat.RepeatStatus; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import lombok.RequiredArgsConstructor; +import lombok.experimental.SuperBuilder; +import lombok.extern.log4j.Log4j2; + +@RequiredArgsConstructor +@Log4j2 +@SuperBuilder +public abstract class FilterableTasklet implements Tasklet { + + private final ObjectMapper objectMapper; + + @Override + public final RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { + var ediExportConfig = objectMapper.readValue((String) chunkContext.getStepContext().getJobParameters().get(EDIFACT_ORDERS_EXPORT), VendorEdiOrdersExportConfig.class); + if (shouldExecute(ediExportConfig)) { + return execute(ediExportConfig, contribution, chunkContext); + } + return RepeatStatus.FINISHED; + } + + /** + * Check if the tasklet should be executed, by default always returns true. + * Override this method to provide custom logic. + * + * @param exportConfig the export configuration + * @return true if the tasklet should be executed + */ + protected boolean shouldExecute(VendorEdiOrdersExportConfig exportConfig) { + return true; + } + + + /** + * This method should be overridden to provide the tasklet logic with predefined filtering. + * + * @param exportConfig the export configuration + * @param contribution the step contribution + * @param chunkContext the chunk context + * @return the repeat status + * @throws Exception if an error occurs + */ + protected abstract RepeatStatus execute(VendorEdiOrdersExportConfig exportConfig, StepContribution contribution, ChunkContext chunkContext) throws Exception; + +} diff --git a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactClaimsTasklet.java b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactClaimsTasklet.java index 6189b985..ff445b53 100644 --- a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactClaimsTasklet.java +++ b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactClaimsTasklet.java @@ -14,18 +14,16 @@ import org.apache.commons.collections4.CollectionUtils; import org.folio.dew.batch.acquisitions.edifact.mapper.ExportResourceMapper; -import org.folio.dew.batch.acquisitions.edifact.services.OrdersService; -import org.folio.dew.batch.acquisitions.edifact.services.OrganizationsService; import org.folio.dew.domain.dto.Piece; import org.folio.dew.domain.dto.VendorEdiOrdersExportConfig; import org.folio.dew.domain.dto.acquisitions.edifact.ExportHolder; import org.folio.dew.error.NotFoundException; import org.springframework.batch.core.configuration.annotation.StepScope; -import org.springframework.batch.core.scope.context.ChunkContext; import org.springframework.stereotype.Component; -import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.experimental.SuperBuilder; +@SuperBuilder @Component @StepScope public class MapToEdifactClaimsTasklet extends MapToEdifactTasklet { @@ -33,13 +31,6 @@ public class MapToEdifactClaimsTasklet extends MapToEdifactTasklet { private final ExportResourceMapper edifactMapper; private final ExportResourceMapper csvMapper; - public MapToEdifactClaimsTasklet(ObjectMapper ediObjectMapper, OrganizationsService organizationsService, OrdersService ordersService, - ExportResourceMapper edifactMapper, ExportResourceMapper csvMapper) { - super(ediObjectMapper, organizationsService, ordersService); - this.edifactMapper = edifactMapper; - this.csvMapper = csvMapper; - } - @Override protected ExportResourceMapper getExportResourceMapper(VendorEdiOrdersExportConfig ediOrdersExportConfig) { return switch (ediOrdersExportConfig.getFileFormat()) { @@ -62,7 +53,7 @@ protected List getExportConfigMissingFields(VendorEdiOrdersExportConfig } @Override - protected ExportHolder buildEdifactExportHolder(ChunkContext chunkContext, VendorEdiOrdersExportConfig ediExportConfig, Map jobParameters) { + protected ExportHolder buildEdifactExportHolder(VendorEdiOrdersExportConfig ediExportConfig, Map jobParameters) { var pieces = ordersService.getPiecesByIdsAndReceivingStatus(ediExportConfig.getClaimPieceIds(), Piece.ReceivingStatusEnum.CLAIM_SENT); if (pieces.isEmpty()) { throw new NotFoundException(Piece.class); diff --git a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactOrdersTasklet.java b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactOrdersTasklet.java index ac0d54c2..24f905be 100644 --- a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactOrdersTasklet.java +++ b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactOrdersTasklet.java @@ -21,21 +21,18 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.folio.dew.batch.acquisitions.edifact.mapper.ExportResourceMapper; -import org.folio.dew.batch.acquisitions.edifact.services.OrdersService; -import org.folio.dew.batch.acquisitions.edifact.services.OrganizationsService; import org.folio.dew.client.DataExportSpringClient; import org.folio.dew.domain.dto.ExportConfigCollection; import org.folio.dew.domain.dto.ExportType; import org.folio.dew.domain.dto.VendorEdiOrdersExportConfig; import org.folio.dew.domain.dto.acquisitions.edifact.ExportHolder; import org.springframework.batch.core.configuration.annotation.StepScope; -import org.springframework.batch.core.scope.context.ChunkContext; import org.springframework.stereotype.Component; -import com.fasterxml.jackson.databind.ObjectMapper; - +import lombok.experimental.SuperBuilder; import lombok.extern.log4j.Log4j2; +@SuperBuilder @Component @StepScope @Log4j2 @@ -44,14 +41,6 @@ public class MapToEdifactOrdersTasklet extends MapToEdifactTasklet { private final DataExportSpringClient dataExportSpringClient; private final ExportResourceMapper edifactMapper; - public MapToEdifactOrdersTasklet(ObjectMapper ediObjectMapper, OrganizationsService organizationsService, OrdersService ordersService, - DataExportSpringClient dataExportSpringClient, - ExportResourceMapper edifactMapper) { - super(ediObjectMapper, organizationsService, ordersService); - this.edifactMapper = edifactMapper; - this.dataExportSpringClient = dataExportSpringClient; - } - @Override protected List getExportConfigMissingFields(VendorEdiOrdersExportConfig ediOrdersExportConfig) { List missingFields = new ArrayList<>(); @@ -64,7 +53,7 @@ protected List getExportConfigMissingFields(VendorEdiOrdersExportConfig } @Override - protected ExportHolder buildEdifactExportHolder(ChunkContext chunkContext, VendorEdiOrdersExportConfig ediExportConfig, Map jobParameters) { + protected ExportHolder buildEdifactExportHolder(VendorEdiOrdersExportConfig ediExportConfig, Map jobParameters) { var poLineQuery = getPoLineQuery(ediExportConfig); var compOrders = getCompositeOrders(poLineQuery); return new ExportHolder(compOrders, List.of()); diff --git a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactTasklet.java b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactTasklet.java index 84447b39..1a831ec4 100644 --- a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactTasklet.java +++ b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/MapToEdifactTasklet.java @@ -36,32 +36,31 @@ import org.folio.dew.error.NotFoundException; import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.scope.context.ChunkContext; -import org.springframework.batch.core.step.tasklet.Tasklet; import org.springframework.batch.repeat.RepeatStatus; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.xlate.edi.stream.EDIStreamException; -import lombok.RequiredArgsConstructor; +import lombok.experimental.SuperBuilder; import lombok.extern.log4j.Log4j2; -@RequiredArgsConstructor +@SuperBuilder @Log4j2 -public abstract class MapToEdifactTasklet implements Tasklet { +public abstract class MapToEdifactTasklet extends FilterableTasklet { private final ObjectMapper ediObjectMapper; private final OrganizationsService organizationsService; protected final OrdersService ordersService; @Override - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { + public RepeatStatus execute(VendorEdiOrdersExportConfig exportConfig, StepContribution contribution, ChunkContext chunkContext) throws Exception { log.info("execute:: Executing MapToEdifactTasklet with job: {}", chunkContext.getStepContext().getJobName()); var jobParameters = chunkContext.getStepContext().getJobParameters(); var ediExportConfig = ediObjectMapper.readValue((String) jobParameters.get(EDIFACT_ORDERS_EXPORT), VendorEdiOrdersExportConfig.class); validateEdiExportConfig(ediExportConfig); - var holder = buildEdifactExportHolder(chunkContext, ediExportConfig, jobParameters); + var holder = buildEdifactExportHolder(ediExportConfig, jobParameters); persistPoLineIds(chunkContext, holder.orders()); String jobName = jobParameters.get(JobParameterNames.JOB_NAME).toString(); @@ -144,7 +143,7 @@ private T convertTo(Object value, Class c) { protected abstract List getExportConfigMissingFields(VendorEdiOrdersExportConfig ediOrdersExportConfig); - protected abstract ExportHolder buildEdifactExportHolder(ChunkContext chunkContext, VendorEdiOrdersExportConfig ediExportConfig, - Map jobParameters) throws JsonProcessingException, EDIStreamException; + protected abstract ExportHolder buildEdifactExportHolder(VendorEdiOrdersExportConfig ediExportConfig, Map jobParameters) + throws JsonProcessingException, EDIStreamException; } diff --git a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/SaveToFileStorageTasklet.java b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/SaveToFileStorageTasklet.java index dee39586..bce1c767 100644 --- a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/SaveToFileStorageTasklet.java +++ b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/SaveToFileStorageTasklet.java @@ -2,7 +2,6 @@ import static org.folio.dew.domain.dto.JobParameterNames.ACQ_EXPORT_FILE; import static org.folio.dew.domain.dto.JobParameterNames.ACQ_EXPORT_FILE_NAME; -import static org.folio.dew.domain.dto.JobParameterNames.EDIFACT_ORDERS_EXPORT; import static org.folio.dew.domain.dto.VendorEdiOrdersExportConfig.IntegrationTypeEnum.ORDERING; import static org.folio.dew.domain.dto.VendorEdiOrdersExportConfig.TransmissionMethodEnum.FTP; @@ -15,21 +14,20 @@ import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.configuration.annotation.StepScope; import org.springframework.batch.core.scope.context.ChunkContext; -import org.springframework.batch.core.step.tasklet.Tasklet; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.stereotype.Component; import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; +import lombok.experimental.SuperBuilder; import lombok.extern.log4j.Log4j2; -@RequiredArgsConstructor +@SuperBuilder @Component @StepScope @Log4j2 -public class SaveToFileStorageTasklet implements Tasklet { +public class SaveToFileStorageTasklet extends FilterableTasklet { private static final String SFTP_PROTOCOL = "sftp://"; @@ -38,15 +36,8 @@ public class SaveToFileStorageTasklet implements Tasklet { @Override @SneakyThrows - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { - var jobParameters = chunkContext.getStepContext().getJobParameters(); - var ediExportConfig = ediObjectMapper.readValue((String) jobParameters.get(EDIFACT_ORDERS_EXPORT), VendorEdiOrdersExportConfig.class); - if (ediExportConfig.getIntegrationType() != ORDERING && ediExportConfig.getTransmissionMethod() != FTP) { - log.info("execute:: Transmission method is not FTP, skipping the step"); - return RepeatStatus.FINISHED; - } - - String host = ediExportConfig.getEdiFtp().getServerAddress().replace(SFTP_PROTOCOL, ""); + public RepeatStatus execute(VendorEdiOrdersExportConfig exportConfig, StepContribution contribution, ChunkContext chunkContext) { + String host = exportConfig.getEdiFtp().getServerAddress().replace(SFTP_PROTOCOL, ""); // skip ftp upload if address not specified if (StringUtils.isEmpty(host)) { return RepeatStatus.FINISHED; @@ -55,9 +46,19 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon var stepExecution = chunkContext.getStepContext().getStepExecution(); var fileName = (String) ExecutionContextUtils.getExecutionVariable(stepExecution, ACQ_EXPORT_FILE_NAME); var edifactOrderAsString = (String) ExecutionContextUtils.getExecutionVariable(stepExecution, ACQ_EXPORT_FILE); - ftpStorageService.uploadToFtp(ediExportConfig, edifactOrderAsString.getBytes(StandardCharsets.UTF_8), fileName); + ftpStorageService.uploadToFtp(exportConfig, edifactOrderAsString.getBytes(StandardCharsets.UTF_8), fileName); return RepeatStatus.FINISHED; } + @Override + protected boolean shouldExecute(VendorEdiOrdersExportConfig exportConfig) { + // Always execute if the integration type is not ORDERING, or execute for other integration types if the transmission method is FTP + if (exportConfig.getIntegrationType() == ORDERING || exportConfig.getTransmissionMethod() == FTP) { + return true; + } + log.info("execute:: Transmission method is not FTP, skipping the step"); + return false; + } + } diff --git a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/SaveToMinioTasklet.java b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/SaveToMinioTasklet.java index 93ec4d2e..6bf34ba5 100644 --- a/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/SaveToMinioTasklet.java +++ b/src/main/java/org/folio/dew/batch/acquisitions/edifact/jobs/SaveToMinioTasklet.java @@ -2,10 +2,7 @@ import static org.folio.dew.domain.dto.JobParameterNames.ACQ_EXPORT_FILE; import static org.folio.dew.domain.dto.JobParameterNames.ACQ_EXPORT_FILE_NAME; -import static org.folio.dew.domain.dto.JobParameterNames.EDIFACT_ORDERS_EXPORT; import static org.folio.dew.domain.dto.JobParameterNames.OUTPUT_FILES_IN_STORAGE; -import static org.folio.dew.domain.dto.VendorEdiOrdersExportConfig.IntegrationTypeEnum.ORDERING; -import static org.folio.dew.domain.dto.VendorEdiOrdersExportConfig.TransmissionMethodEnum.FILE_DOWNLOAD; import static org.folio.dew.utils.Constants.EDIFACT_EXPORT_DIR_NAME; import static org.folio.dew.utils.Constants.getWorkingDirectory; @@ -20,44 +17,33 @@ import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.configuration.annotation.StepScope; import org.springframework.batch.core.scope.context.ChunkContext; -import org.springframework.batch.core.step.tasklet.Tasklet; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import com.fasterxml.jackson.databind.ObjectMapper; - -import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; +import lombok.experimental.SuperBuilder; import lombok.extern.log4j.Log4j2; -@RequiredArgsConstructor +@SuperBuilder @Component @StepScope @Log4j2 -public class SaveToMinioTasklet implements Tasklet { +public class SaveToMinioTasklet extends FilterableTasklet { private static final String REMOTE_STORAGE_ERROR_MESSAGE = "Failed to save edifact file to remote storage"; private static final String UPLOADED_PATH_TEMPLATE = "%s%s/%s"; private final RemoteFilesStorage remoteFilesStorage; private final FolioExecutionContext folioExecutionContext; - private final ObjectMapper ediObjectMapper; @Value("${spring.application.name}") protected String springApplicationName; @Override @SneakyThrows - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { + public RepeatStatus execute(VendorEdiOrdersExportConfig exportConfig, StepContribution contribution, ChunkContext chunkContext) { // retrieve parameters from job context - var jobParameters = chunkContext.getStepContext().getJobParameters(); - var ediExportConfig = ediObjectMapper.readValue((String) jobParameters.get(EDIFACT_ORDERS_EXPORT), VendorEdiOrdersExportConfig.class); - if (ediExportConfig.getIntegrationType() != ORDERING && ediExportConfig.getTransmissionMethod() != FILE_DOWNLOAD) { - log.info("execute:: Transmission method is not File Download, skipping the step"); - return RepeatStatus.FINISHED; - } - var stepExecution = chunkContext.getStepContext().getStepExecution(); var edifactOrderAsString = (String) ExecutionContextUtils.getExecutionVariable(stepExecution, ACQ_EXPORT_FILE); var fullFilePath = buildFullFilePath(stepExecution);