wmedvede commented on code in PR #4094:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4094#discussion_r2571007632
##########
kogito-bom/pom.xml:
##########
@@ -2702,6 +2702,38 @@
<artifactId>sonataflow-quarkus-deployment</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.kie.sonataflow</groupId>
+ <artifactId>sonataflow-quarkus-jdbc-token-persistence</artifactId>
Review Comment:
This looks like a new extension not related nor refered by the OTEL support
introduced by this PR.
I am correcrt?
##########
api/kogito-services/src/main/java/org/kie/kogito/services/uow/UnitOfWorkExecutor.java:
##########
@@ -54,4 +55,60 @@ public static <T> T executeInUnitOfWork(UnitOfWorkManager
uowManager, Supplier<T
}
}
+
+ /**
+ * Executes the given supplier within a process-instance-aware unit of
work.
+ * This method ensures that the process instance context is properly
managed
+ * throughout the unit of work lifecycle.
+ *
+ * @param uowManager the unit of work manager
+ * @param processInstanceId the process instance ID to use for context
+ * @param supplier the supplier to execute
+ * @param <T> the return type
+ * @return the result of the supplier
+ */
+ public static <T> T executeInUnitOfWork(UnitOfWorkManager uowManager,
String processInstanceId, Supplier<T> supplier) {
+ T result = null;
+ UnitOfWork baseUow = uowManager.newUnitOfWork();
+ UnitOfWork uow = new ProcessInstanceAwareUnitOfWork(baseUow,
processInstanceId);
+
+ try {
+ uow.start();
+
+ result = supplier.get();
+ uow.end();
+
+ return result;
+ } catch (ProcessInstanceExecutionException e) {
+ uow.end();
+ throw e;
+ } catch (Exception e) {
+ uow.abort();
+ if (e instanceof RuntimeException) {
+ throw (RuntimeException) e;
+ } else {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ /**
+ * Executes the given supplier within a unit of work with automatic
process instance context detection.
+ * If a process instance context is already set, it will be used for the
unit of work.
+ * Otherwise, a standard unit of work will be created.
+ *
+ * @param uowManager the unit of work manager
+ * @param supplier the supplier to execute
+ * @param <T> the return type
+ * @return the result of the supplier
+ */
+ public static <T> T executeInProcessAwareUnitOfWork(UnitOfWorkManager
uowManager, Supplier<T> supplier) {
Review Comment:
Doesn't look to be used.
A left over maybe?
##########
api/kogito-services/src/main/java/org/kie/kogito/services/context/ProcessInstanceContext.java:
##########
@@ -0,0 +1,343 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.services.context;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Supplier;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+
+/**
+ * Utility class for managing process instance context in logging operations.
+ * This class uses SLF4J's Mapped Diagnostic Context (MDC) to ensure process
instance IDs
+ * are automatically included in log messages.
+ *
+ * When no process instance is available, an empty string is used as the
default value
+ * to provide cleaner formatting and easier searching in log aggregation
systems.
+ *
+ * Thread Safety: This class is thread-safe and properly manages context
isolation
+ * between different threads using MDC's inherent ThreadLocal-based storage.
+ *
+ * Extension Support: Extensions can register via {@link
#registerContextExtension(String, ContextExtension)}
+ * to participate in context preservation during async operations.
+ */
+public final class ProcessInstanceContext {
+
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ProcessInstanceContext.class);
+
+ private static final Map<String, ContextExtension> EXTENSIONS = new
ConcurrentHashMap<>();
+
+ /**
+ * MDC key used to store the process instance ID.
+ * This key should be referenced in logging configurations.
+ */
+ public static final String MDC_PROCESS_INSTANCE_KEY = "processInstanceId";
+
+ /**
+ * MDC key for trace ID (for distributed tracing correlation).
+ */
+ public static final String MDC_TRACE_ID_KEY = "traceId";
+
+ /**
+ * MDC key for span ID (for distributed tracing correlation).
+ */
+ public static final String MDC_SPAN_ID_KEY = "spanId";
+
+ /**
+ * Span attribute key for process instance ID (OpenTelemetry).
+ */
+ public static final String SPAN_ATTRIBUTE_PROCESS_INSTANCE_ID =
"kogito.process.instance.id";
+
+ /**
+ * Default value used when no process instance ID is available.
+ * Empty string for cleaner log formatting and easier searching.
+ */
+ public static final String GENERAL_CONTEXT = "";
+
+ // Private constructor to prevent instantiation
+ private ProcessInstanceContext() {
+ // Utility class
+ }
+
+ /**
+ * Sets the process instance ID for the current thread context.
+ * This method updates SLF4J MDC and only performs the update if the value
changes.
+ *
+ * @param processInstanceId the process instance ID to set, or null to use
general context
+ */
+ public static void setProcessInstanceId(String processInstanceId) {
+ String effectiveId = processInstanceId != null ? processInstanceId :
GENERAL_CONTEXT;
+
+ // Only update MDC if the value is changing (optimization)
+ String currentId = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ if (!effectiveId.equals(currentId)) {
+ MDC.put(MDC_PROCESS_INSTANCE_KEY, effectiveId);
+ }
+ }
+
+ /**
+ * Gets the current process instance ID from MDC.
+ *
+ * @return the current process instance ID, or empty string if no context
is set
+ */
+ public static String getProcessInstanceId() {
+ String id = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ return id != null ? id : GENERAL_CONTEXT;
+ }
+
+ /**
+ * Clears the process instance context for the current thread.
+ * This resets the MDC to the general context (empty string).
+ */
+ public static void clear() {
+ MDC.put(MDC_PROCESS_INSTANCE_KEY, GENERAL_CONTEXT);
+ }
+
+ /**
+ * Checks if a process instance context is currently set.
+ *
+ * @return true if a process instance context is set, false otherwise
+ */
+ public static boolean hasContext() {
+ String id = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ return id != null && !GENERAL_CONTEXT.equals(id);
+ }
+
+ /**
+ * Executes the given operation within the specified process instance
context.
+ * This method ensures proper context setup and cleanup even if exceptions
occur.
+ *
+ * @param processInstanceId the process instance ID to set for the
operation
+ * @param operation the operation to execute
+ * @param <T> the return type of the operation
+ * @return the result of the operation
+ */
+ public static <T> T withProcessInstanceContext(String processInstanceId,
Supplier<T> operation) {
+ setProcessInstanceId(processInstanceId);
+ try {
+ return operation.get();
+ } finally {
+ clear();
+ }
+ }
+
+ /**
+ * Executes the given runnable within the specified process instance
context.
+ * This method ensures proper context setup and cleanup even if exceptions
occur.
+ *
+ * @param processInstanceId the process instance ID to set for the
operation
+ * @param operation the operation to execute
+ */
+ public static void withProcessInstanceContext(String processInstanceId,
Runnable operation) {
Review Comment:
Is this method being used?
##########
api/kogito-services/src/main/java/org/kie/kogito/services/uow/ProcessInstanceAwareUnitOfWork.java:
##########
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.services.uow;
+
+import java.util.Map;
+
+import org.kie.kogito.services.context.ProcessInstanceContext;
+import org.kie.kogito.uow.UnitOfWork;
+import org.kie.kogito.uow.WorkUnit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A UnitOfWork wrapper that manages process instance context throughout the
unit of work lifecycle.
+ * This implementation ensures proper context cleanup even in the face of
exceptions, preventing
+ * context leaks and ensuring thread safety.
+ * <p>
+ * Key features:
+ * - Automatic context setup and cleanup
+ * - Support for nested UnitOfWork with context preservation
+ * - Exception-safe cleanup using try-finally blocks
+ * - ThreadLocal leak prevention
+ * - Integration with distributed tracing systems
+ * <p>
+ * Thread Safety: This class is thread-safe and properly manages ThreadLocal
cleanup to prevent
+ * memory leaks in long-running applications.
+ */
+public record ProcessInstanceAwareUnitOfWork(UnitOfWork delegate, String
processInstanceId) implements UnitOfWork {
Review Comment:
This class looks to not being used.
Is this a left over?
##########
api/kogito-services/src/main/java/org/kie/kogito/services/uow/UnitOfWorkExecutor.java:
##########
@@ -54,4 +55,60 @@ public static <T> T executeInUnitOfWork(UnitOfWorkManager
uowManager, Supplier<T
}
}
+
+ /**
+ * Executes the given supplier within a process-instance-aware unit of
work.
+ * This method ensures that the process instance context is properly
managed
+ * throughout the unit of work lifecycle.
+ *
+ * @param uowManager the unit of work manager
+ * @param processInstanceId the process instance ID to use for context
+ * @param supplier the supplier to execute
+ * @param <T> the return type
+ * @return the result of the supplier
+ */
+ public static <T> T executeInUnitOfWork(UnitOfWorkManager uowManager,
String processInstanceId, Supplier<T> supplier) {
Review Comment:
Doesn't look to be used.
A left over maybe?
##########
api/kogito-services/src/main/java/org/kie/kogito/services/context/ProcessInstanceContext.java:
##########
@@ -0,0 +1,343 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.services.context;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Supplier;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+
+/**
+ * Utility class for managing process instance context in logging operations.
+ * This class uses SLF4J's Mapped Diagnostic Context (MDC) to ensure process
instance IDs
+ * are automatically included in log messages.
+ *
+ * When no process instance is available, an empty string is used as the
default value
+ * to provide cleaner formatting and easier searching in log aggregation
systems.
+ *
+ * Thread Safety: This class is thread-safe and properly manages context
isolation
+ * between different threads using MDC's inherent ThreadLocal-based storage.
+ *
+ * Extension Support: Extensions can register via {@link
#registerContextExtension(String, ContextExtension)}
+ * to participate in context preservation during async operations.
+ */
+public final class ProcessInstanceContext {
+
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ProcessInstanceContext.class);
+
+ private static final Map<String, ContextExtension> EXTENSIONS = new
ConcurrentHashMap<>();
+
+ /**
+ * MDC key used to store the process instance ID.
+ * This key should be referenced in logging configurations.
+ */
+ public static final String MDC_PROCESS_INSTANCE_KEY = "processInstanceId";
+
+ /**
+ * MDC key for trace ID (for distributed tracing correlation).
+ */
+ public static final String MDC_TRACE_ID_KEY = "traceId";
+
+ /**
+ * MDC key for span ID (for distributed tracing correlation).
+ */
+ public static final String MDC_SPAN_ID_KEY = "spanId";
+
+ /**
+ * Span attribute key for process instance ID (OpenTelemetry).
+ */
+ public static final String SPAN_ATTRIBUTE_PROCESS_INSTANCE_ID =
"kogito.process.instance.id";
+
+ /**
+ * Default value used when no process instance ID is available.
+ * Empty string for cleaner log formatting and easier searching.
+ */
+ public static final String GENERAL_CONTEXT = "";
+
+ // Private constructor to prevent instantiation
+ private ProcessInstanceContext() {
+ // Utility class
+ }
+
+ /**
+ * Sets the process instance ID for the current thread context.
+ * This method updates SLF4J MDC and only performs the update if the value
changes.
+ *
+ * @param processInstanceId the process instance ID to set, or null to use
general context
+ */
+ public static void setProcessInstanceId(String processInstanceId) {
+ String effectiveId = processInstanceId != null ? processInstanceId :
GENERAL_CONTEXT;
+
+ // Only update MDC if the value is changing (optimization)
+ String currentId = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ if (!effectiveId.equals(currentId)) {
+ MDC.put(MDC_PROCESS_INSTANCE_KEY, effectiveId);
+ }
+ }
+
+ /**
+ * Gets the current process instance ID from MDC.
+ *
+ * @return the current process instance ID, or empty string if no context
is set
+ */
+ public static String getProcessInstanceId() {
+ String id = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ return id != null ? id : GENERAL_CONTEXT;
+ }
+
+ /**
+ * Clears the process instance context for the current thread.
+ * This resets the MDC to the general context (empty string).
+ */
+ public static void clear() {
+ MDC.put(MDC_PROCESS_INSTANCE_KEY, GENERAL_CONTEXT);
+ }
+
+ /**
+ * Checks if a process instance context is currently set.
+ *
+ * @return true if a process instance context is set, false otherwise
+ */
+ public static boolean hasContext() {
+ String id = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ return id != null && !GENERAL_CONTEXT.equals(id);
+ }
+
+ /**
+ * Executes the given operation within the specified process instance
context.
+ * This method ensures proper context setup and cleanup even if exceptions
occur.
+ *
+ * @param processInstanceId the process instance ID to set for the
operation
+ * @param operation the operation to execute
+ * @param <T> the return type of the operation
+ * @return the result of the operation
+ */
+ public static <T> T withProcessInstanceContext(String processInstanceId,
Supplier<T> operation) {
+ setProcessInstanceId(processInstanceId);
+ try {
+ return operation.get();
+ } finally {
+ clear();
+ }
+ }
+
+ /**
+ * Executes the given runnable within the specified process instance
context.
+ * This method ensures proper context setup and cleanup even if exceptions
occur.
+ *
+ * @param processInstanceId the process instance ID to set for the
operation
+ * @param operation the operation to execute
+ */
+ public static void withProcessInstanceContext(String processInstanceId,
Runnable operation) {
+ setProcessInstanceId(processInstanceId);
+ try {
+ operation.run();
+ } finally {
+ clear();
+ }
+ }
+
+ /**
+ * Registers a context extension that will participate in context
preservation.
+ * Extensions with the same ID will replace previously registered
extensions.
+ *
+ * @param extensionId the unique identifier for the extension
+ * @param extension the extension to register
+ * @throws IllegalArgumentException if extensionId is null or empty, or if
extension is null
+ */
+ public static void registerContextExtension(String extensionId,
ContextExtension extension) {
+ if (extensionId == null || extensionId.isEmpty()) {
+ throw new IllegalArgumentException("Extension ID must not be null
or empty");
+ }
+ if (extension == null) {
+ throw new IllegalArgumentException("Extension must not be null");
+ }
+ EXTENSIONS.put(extensionId, extension);
+ LOGGER.debug("Registered context extension: {}", extensionId);
+ }
+
+ /**
+ * Registers a context extension using its own extension ID.
+ * Extensions with the same ID will replace previously registered
extensions.
+ *
+ * @param extension the extension to register
+ * @throws IllegalArgumentException if extension is null or its ID is
null/empty
+ */
+ public static void registerContextExtension(ContextExtension extension) {
+ if (extension == null) {
+ throw new IllegalArgumentException("Extension must not be null");
+ }
+ registerContextExtension(extension.getExtensionId(), extension);
+ }
+
+ /**
+ * Retrieves a registered context extension by its ID.
+ *
+ * @param extensionId the extension ID to retrieve
+ * @return the registered extension, or null if not found
+ */
+ public static ContextExtension getExtension(String extensionId) {
+ return EXTENSIONS.get(extensionId);
+ }
+
+ /**
+ * Clears all registered extensions.
+ * This is primarily for testing purposes to ensure test isolation.
+ */
+ static void clearUserExtensions() {
Review Comment:
If the extesions are auto-registerd when the application starts, I'm not
sure at which point this clear will happen
##########
api/kogito-services/src/main/java/org/kie/kogito/services/context/ProcessInstanceContext.java:
##########
@@ -0,0 +1,343 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.services.context;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Supplier;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+
+/**
+ * Utility class for managing process instance context in logging operations.
+ * This class uses SLF4J's Mapped Diagnostic Context (MDC) to ensure process
instance IDs
+ * are automatically included in log messages.
+ *
+ * When no process instance is available, an empty string is used as the
default value
+ * to provide cleaner formatting and easier searching in log aggregation
systems.
+ *
+ * Thread Safety: This class is thread-safe and properly manages context
isolation
+ * between different threads using MDC's inherent ThreadLocal-based storage.
+ *
+ * Extension Support: Extensions can register via {@link
#registerContextExtension(String, ContextExtension)}
+ * to participate in context preservation during async operations.
+ */
+public final class ProcessInstanceContext {
+
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ProcessInstanceContext.class);
+
+ private static final Map<String, ContextExtension> EXTENSIONS = new
ConcurrentHashMap<>();
+
+ /**
+ * MDC key used to store the process instance ID.
+ * This key should be referenced in logging configurations.
+ */
+ public static final String MDC_PROCESS_INSTANCE_KEY = "processInstanceId";
+
+ /**
+ * MDC key for trace ID (for distributed tracing correlation).
+ */
+ public static final String MDC_TRACE_ID_KEY = "traceId";
+
+ /**
+ * MDC key for span ID (for distributed tracing correlation).
+ */
+ public static final String MDC_SPAN_ID_KEY = "spanId";
+
+ /**
+ * Span attribute key for process instance ID (OpenTelemetry).
+ */
+ public static final String SPAN_ATTRIBUTE_PROCESS_INSTANCE_ID =
"kogito.process.instance.id";
+
+ /**
+ * Default value used when no process instance ID is available.
+ * Empty string for cleaner log formatting and easier searching.
+ */
+ public static final String GENERAL_CONTEXT = "";
+
+ // Private constructor to prevent instantiation
+ private ProcessInstanceContext() {
+ // Utility class
+ }
+
+ /**
+ * Sets the process instance ID for the current thread context.
+ * This method updates SLF4J MDC and only performs the update if the value
changes.
+ *
+ * @param processInstanceId the process instance ID to set, or null to use
general context
+ */
+ public static void setProcessInstanceId(String processInstanceId) {
+ String effectiveId = processInstanceId != null ? processInstanceId :
GENERAL_CONTEXT;
+
+ // Only update MDC if the value is changing (optimization)
+ String currentId = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ if (!effectiveId.equals(currentId)) {
+ MDC.put(MDC_PROCESS_INSTANCE_KEY, effectiveId);
+ }
+ }
+
+ /**
+ * Gets the current process instance ID from MDC.
+ *
+ * @return the current process instance ID, or empty string if no context
is set
+ */
+ public static String getProcessInstanceId() {
+ String id = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ return id != null ? id : GENERAL_CONTEXT;
+ }
+
+ /**
+ * Clears the process instance context for the current thread.
+ * This resets the MDC to the general context (empty string).
+ */
+ public static void clear() {
+ MDC.put(MDC_PROCESS_INSTANCE_KEY, GENERAL_CONTEXT);
+ }
+
+ /**
+ * Checks if a process instance context is currently set.
+ *
+ * @return true if a process instance context is set, false otherwise
+ */
+ public static boolean hasContext() {
+ String id = MDC.get(MDC_PROCESS_INSTANCE_KEY);
+ return id != null && !GENERAL_CONTEXT.equals(id);
+ }
+
+ /**
+ * Executes the given operation within the specified process instance
context.
+ * This method ensures proper context setup and cleanup even if exceptions
occur.
+ *
+ * @param processInstanceId the process instance ID to set for the
operation
+ * @param operation the operation to execute
+ * @param <T> the return type of the operation
+ * @return the result of the operation
+ */
+ public static <T> T withProcessInstanceContext(String processInstanceId,
Supplier<T> operation) {
Review Comment:
Is this method being used?
##########
api/kogito-services/src/main/java/org/kie/kogito/services/context/ProcessInstanceAwareWorkItemHandler.java:
##########
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.services.context;
+
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+import java.util.function.Supplier;
+
+import org.kie.kogito.internal.process.workitem.KogitoWorkItem;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Utility class for propagating process instance context to async work item
executions.
+ * This class provides helper methods for work item handlers to ensure proper
MDC context
+ * propagation in async operations.
+ */
+public final class ProcessInstanceAwareWorkItemHandler {
Review Comment:
Looks like this class is not being used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]