From 512d3a5dd2fa760a11412bb9beddce84503259dc Mon Sep 17 00:00:00 2001 From: Christoph Oesterheld Date: Fri, 29 Nov 2024 09:53:36 +0100 Subject: [PATCH] refactor: define the conditional tenant configuration more explicit --- .../io/vanillabp/camunda8/wiring/Camunda8TaskWiring.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spring-boot/src/main/java/io/vanillabp/camunda8/wiring/Camunda8TaskWiring.java b/spring-boot/src/main/java/io/vanillabp/camunda8/wiring/Camunda8TaskWiring.java index 855f4bc..f50d8db 100644 --- a/spring-boot/src/main/java/io/vanillabp/camunda8/wiring/Camunda8TaskWiring.java +++ b/spring-boot/src/main/java/io/vanillabp/camunda8/wiring/Camunda8TaskWiring.java @@ -114,9 +114,14 @@ public void openWorkers() { .handler(userTaskHandler) .timeout(Integer.MAX_VALUE) // user-tasks are not fetched more than once .name(workerId); + + if (tenantId != null) { + userTaskWorker.tenantId(tenantId); + } + final var workerProperties = camunda8Properties.getUserTaskWorkerProperties(workflowModuleId); workerProperties.applyToUserTaskWorker(userTaskWorker); - return tenantId != null ? userTaskWorker.tenantId(tenantId) : userTaskWorker; + return userTaskWorker; }) .forEach(workers::add);