From c6eda2fc124ee0cab905c01fc288f27b3b9d703e Mon Sep 17 00:00:00 2001 From: Tiago Dolphine Date: Tue, 14 Nov 2023 08:55:24 -0300 Subject: [PATCH] adding uniqueId and type for node definition --- .../org/kie/kogito/internal/process/runtime/KogitoNode.java | 2 ++ .../services/registry/ProcessDefinitionEventRegistry.java | 4 ++-- .../org/kie/kogito/events/spring/KafkaEventPublisher.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/kogito-api/src/main/java/org/kie/kogito/internal/process/runtime/KogitoNode.java b/api/kogito-api/src/main/java/org/kie/kogito/internal/process/runtime/KogitoNode.java index 67926f5d9fb..f15769da3de 100644 --- a/api/kogito-api/src/main/java/org/kie/kogito/internal/process/runtime/KogitoNode.java +++ b/api/kogito-api/src/main/java/org/kie/kogito/internal/process/runtime/KogitoNode.java @@ -24,4 +24,6 @@ public interface KogitoNode extends Node { NodeContainer getParentContainer(); + + String getUniqueId(); } diff --git a/api/kogito-services/src/main/java/org/kie/kogito/services/registry/ProcessDefinitionEventRegistry.java b/api/kogito-services/src/main/java/org/kie/kogito/services/registry/ProcessDefinitionEventRegistry.java index e42a0c85ab1..768cccb7441 100644 --- a/api/kogito-services/src/main/java/org/kie/kogito/services/registry/ProcessDefinitionEventRegistry.java +++ b/api/kogito-services/src/main/java/org/kie/kogito/services/registry/ProcessDefinitionEventRegistry.java @@ -105,8 +105,8 @@ private List getNodesDefinitions(Process p) { .map(node -> NodeDefinition.builder() .setId(String.valueOf(node.getId())) .setName(node.getName()) - .setType(node.getNodeType().name()) - .setUniqueId(node.getNodeUniqueId()) + .setType(node.getClass().getSimpleName()) + .setUniqueId(node.getUniqueId()) .setMetadata(node.getMetaData()) .build()) .collect(Collectors.toList()); diff --git a/springboot/addons/events/kafka/src/main/java/org/kie/kogito/events/spring/KafkaEventPublisher.java b/springboot/addons/events/kafka/src/main/java/org/kie/kogito/events/spring/KafkaEventPublisher.java index 93b9779259a..d11aa00b702 100644 --- a/springboot/addons/events/kafka/src/main/java/org/kie/kogito/events/spring/KafkaEventPublisher.java +++ b/springboot/addons/events/kafka/src/main/java/org/kie/kogito/events/spring/KafkaEventPublisher.java @@ -20,7 +20,6 @@ import java.util.Collection; -import com.fasterxml.jackson.databind.ObjectMapper; import org.kie.kogito.event.DataEvent; import org.kie.kogito.event.EventPublisher; import org.slf4j.Logger; @@ -31,6 +30,8 @@ import org.springframework.kafka.core.KafkaTemplate; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; + @Component public class KafkaEventPublisher implements EventPublisher {