From 889b2e3a60413c794fe47387068fdeb8d23b7e5a Mon Sep 17 00:00:00 2001 From: Nico Koprowski Date: Tue, 6 Aug 2024 09:46:09 +0800 Subject: [PATCH] fix(Gate): always sending owner BPNL to golden record process if it is an owned Gate Now the Gate will only assign the owner BPNL if it the data is marked as owned company data; even if the Gate has a fixed owner assigned. --- .../bpdm/gate/service/OrchestratorMappings.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/OrchestratorMappings.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/OrchestratorMappings.kt index d30da1851..98d4b6a37 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/OrchestratorMappings.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/OrchestratorMappings.kt @@ -184,15 +184,15 @@ class OrchestratorMappings( } ?: BpnReference.empty private fun getOwnerBpnL(entity: BusinessPartnerDb): String? { - return if (entity.sharingState.tenantBpnl != null) { - entity.sharingState.tenantBpnl - }else if (entity.isOwnCompanyData) { - bpnConfigProperties.ownerBpnL - } - else { - logger.warn { "Owner BPNL property is not configured" } - null - } + //only determine owner BPNL if it is own company data + if(!entity.isOwnCompanyData) return null + + return entity.sharingState.tenantBpnl + ?: bpnConfigProperties.ownerBpnL.takeIf { it.isNotBlank() } + ?: run { + logger.warn { "Owner BPNL can't be determined for owned company data" } + null + } }