From f6706fe910bd0a40ce4dab0212b1a3fc2c54a341 Mon Sep 17 00:00:00 2001 From: Volodymyr_Rohach Date: Thu, 25 Jan 2024 18:56:27 +0200 Subject: [PATCH 1/3] MODSOURMAN-1122: Additional check added. --- NEWS.md | 1 + .../java/org/folio/services/RecordsPublishingServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 72734c007..d159fb9ce 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,6 +13,7 @@ * [MODSOURMAN-1108](https://issues.folio.org/browse/MODSOURMAN-1108) MARC authority record is not created when use Job profile with match profile and action only on no-match branch * [MODSOURMAN-1106](https://issues.folio.org/browse/MODSOURMAN-1106) The status of Instance is '-' in the Import log after uploading file. The numbers of updated SRS and Instance are not displayed in the Summary table. * [MODSOURMAN-1063](https://issues.folio.org/browse/MODSOURMAN-1063) Update RecordProcessingLogDto to contain incoming record id +* [MODSOURMAN-1122](https://issues.folio.org/browse/MODSOURMAN-1122) Add additional check for the childSnapshotWrappers ## 2023-10-13 v3.7.0 * [MODSOURMAN-1045](https://issues.folio.org/browse/MODSOURMAN-1045) Allow create action with non-matches for instance without match profile diff --git a/mod-source-record-manager-server/src/main/java/org/folio/services/RecordsPublishingServiceImpl.java b/mod-source-record-manager-server/src/main/java/org/folio/services/RecordsPublishingServiceImpl.java index 052f497c9..3749f39b8 100644 --- a/mod-source-record-manager-server/src/main/java/org/folio/services/RecordsPublishingServiceImpl.java +++ b/mod-source-record-manager-server/src/main/java/org/folio/services/RecordsPublishingServiceImpl.java @@ -146,7 +146,7 @@ private DataImportEventPayload prepareEventPayload(Record record, ProfileSnapsho return new DataImportEventPayload() .withEventType(eventType) - .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) + .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().isEmpty() ? new ProfileSnapshotWrapper() : profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) .withJobExecutionId(record.getSnapshotId()) .withContext(context) .withOkapiUrl(params.getOkapiUrl()) From 7e8623dd66ab6685bf8cea1f3b34aaacf4b03aab Mon Sep 17 00:00:00 2001 From: Volodymyr_Rohach Date: Thu, 1 Feb 2024 16:47:36 +0200 Subject: [PATCH 2/3] MODSOURMAN-1122: FAT fixed. --- .../src/main/java/org/folio/dao/JournalRecordDaoImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod-source-record-manager-server/src/main/java/org/folio/dao/JournalRecordDaoImpl.java b/mod-source-record-manager-server/src/main/java/org/folio/dao/JournalRecordDaoImpl.java index 929df5715..cac083df7 100644 --- a/mod-source-record-manager-server/src/main/java/org/folio/dao/JournalRecordDaoImpl.java +++ b/mod-source-record-manager-server/src/main/java/org/folio/dao/JournalRecordDaoImpl.java @@ -6,6 +6,7 @@ import io.vertx.sqlclient.RowSet; import io.vertx.sqlclient.SqlResult; import io.vertx.sqlclient.Tuple; +import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.folio.dao.util.JournalRecordsColumns; @@ -292,13 +293,15 @@ private List mapResultSetToJournalRecordsList(RowSet resultS } private JournalRecord mapRowToJournalRecord(Row row) { + String entityType = row.getString(ENTITY_TYPE); + EntityType resultedEntityType = StringUtils.isNotBlank(entityType) ? EntityType.valueOf(entityType) : null; return new JournalRecord() .withId(row.getValue(ID).toString()) .withJobExecutionId(row.getValue(JOB_EXECUTION_ID).toString()) .withSourceId(row.getValue(SOURCE_ID).toString()) .withSourceRecordOrder(row.getInteger(SOURCE_RECORD_ORDER)) .withTitle(row.getString(TITLE)) - .withEntityType(EntityType.valueOf(row.getString(ENTITY_TYPE))) + .withEntityType(resultedEntityType) .withEntityId(row.getString(ENTITY_ID)) .withInstanceId(row.getString(INSTANCE_ID)) .withHoldingsId(row.getString(HOLDINGS_ID)) From 8446b2cde072bc6705aeeaf4886f50422dba0963 Mon Sep 17 00:00:00 2001 From: Volodymyr_Rohach Date: Thu, 1 Feb 2024 16:49:36 +0200 Subject: [PATCH 3/3] MODSOURMAN-1122: Extra check removed. --- .../java/org/folio/services/RecordsPublishingServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod-source-record-manager-server/src/main/java/org/folio/services/RecordsPublishingServiceImpl.java b/mod-source-record-manager-server/src/main/java/org/folio/services/RecordsPublishingServiceImpl.java index 3749f39b8..052f497c9 100644 --- a/mod-source-record-manager-server/src/main/java/org/folio/services/RecordsPublishingServiceImpl.java +++ b/mod-source-record-manager-server/src/main/java/org/folio/services/RecordsPublishingServiceImpl.java @@ -146,7 +146,7 @@ private DataImportEventPayload prepareEventPayload(Record record, ProfileSnapsho return new DataImportEventPayload() .withEventType(eventType) - .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().isEmpty() ? new ProfileSnapshotWrapper() : profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) + .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) .withJobExecutionId(record.getSnapshotId()) .withContext(context) .withOkapiUrl(params.getOkapiUrl())