From e4cc1be0eda3a9a91234bf6bb57ece016eea7a0d Mon Sep 17 00:00:00 2001 From: Nico Koprowski Date: Fri, 5 Jul 2024 13:51:12 +0800 Subject: [PATCH] fix(gate): sharing states sometimes taking the wrong task id from the orchestrator - now made sure sharing states are associated with the tasks in the order of the task create requests --- CHANGELOG.md | 1 + .../eclipse/tractusx/bpdm/gate/service/TaskCreationService.kt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4f19a923..a07e635c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ For changes to the BPDM Helm charts please consult the [changelog](charts/bpdm/C ### Changed: - BPDM Gate: Fix sending business partner data to the golden record service even when they have no changes +- BPDM Gate: Fix sharing states sometimes taking the wrong task id from the orchestrator ## [6.0.2] - [2024-07-03] diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/TaskCreationService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/TaskCreationService.kt index 0317fdea0..4efa1cbc0 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/TaskCreationService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/TaskCreationService.kt @@ -58,8 +58,8 @@ class TaskCreationService( val orchestratorBusinessPartnersDto = foundPartners.map { orchestratorMappings.toOrchestratorDto(it) } val createdTasks = createGoldenRecordTasks(TaskMode.UpdateFromSharingMember, orchestratorBusinessPartnersDto) - foundStates.zip(createdTasks).forEach { (state, task) -> - sharingStateService.setPending(state, task.taskId) + foundPartners.zip(createdTasks).forEach { (partner, task) -> + sharingStateService.setPending(partner.sharingState, task.taskId) } logger.info { "Created ${createdTasks.size} new golden record tasks from ready business partners" }