This is an automated email from the ASF dual-hosted git repository.
martinweiler pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-runtimes.git
The following commit(s) were added to refs/heads/main by this push:
new c49af98c43 [incubator-kie-issues#2294] Workflow: Use constants instead
of Strings for the notification handling (#4275)
c49af98c43 is described below
commit c49af98c436efdcecf3e828ba29ec01c9eb27b6e
Author: abhijithumbe <[email protected]>
AuthorDate: Fri May 22 01:54:34 2026 +0530
[incubator-kie-issues#2294] Workflow: Use constants instead of Strings for
the notification handling (#4275)
Co-authored-by: abhijithumbe <[email protected]>
---
quarkus/addons/task-notification/runtime/pom.xml | 4 ++++
.../kogito/task/notification/quarkus/NotificationEventPublisher.java | 3 ++-
springboot/addons/task-notification/pom.xml | 5 +++++
.../task/notification/spring/SpringNotificationEventPublisher.java | 3 ++-
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/quarkus/addons/task-notification/runtime/pom.xml
b/quarkus/addons/task-notification/runtime/pom.xml
index 4c5a8d41a9..de3bc9e398 100644
--- a/quarkus/addons/task-notification/runtime/pom.xml
+++ b/quarkus/addons/task-notification/runtime/pom.xml
@@ -57,6 +57,10 @@
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-events-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.kie.kogito</groupId>
+ <artifactId>kogito-events-core</artifactId>
+ </dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
diff --git
a/quarkus/addons/task-notification/runtime/src/main/java/org/kie/kogito/task/notification/quarkus/NotificationEventPublisher.java
b/quarkus/addons/task-notification/runtime/src/main/java/org/kie/kogito/task/notification/quarkus/NotificationEventPublisher.java
index 5d256101fa..0bec202526 100644
---
a/quarkus/addons/task-notification/runtime/src/main/java/org/kie/kogito/task/notification/quarkus/NotificationEventPublisher.java
+++
b/quarkus/addons/task-notification/runtime/src/main/java/org/kie/kogito/task/notification/quarkus/NotificationEventPublisher.java
@@ -24,6 +24,7 @@ import org.eclipse.microprofile.reactive.messaging.Channel;
import org.eclipse.microprofile.reactive.messaging.Emitter;
import org.kie.kogito.event.DataEvent;
import org.kie.kogito.event.EventPublisher;
+import org.kie.kogito.event.usertask.UserTaskInstanceDeadlineDataEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,7 +43,7 @@ public class NotificationEventPublisher implements
EventPublisher {
@Override
public void publish(DataEvent<?> event) {
- if (event.getType().startsWith("UserTaskInstanceDeadline")) {
+ if (event instanceof UserTaskInstanceDeadlineDataEvent) {
logger.debug("About to publish event {} to topic {}", event,
CHANNEL_NAME);
try {
emitter.send(event);
diff --git a/springboot/addons/task-notification/pom.xml
b/springboot/addons/task-notification/pom.xml
index 88118cc305..f8130860d9 100644
--- a/springboot/addons/task-notification/pom.xml
+++ b/springboot/addons/task-notification/pom.xml
@@ -51,6 +51,11 @@
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-events-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.kie.kogito</groupId>
+ <artifactId>kogito-events-core</artifactId>
+ </dependency>
+
<!-- test dependencies -->
<dependency>
diff --git
a/springboot/addons/task-notification/src/main/java/org/kie/kogito/task/notification/spring/SpringNotificationEventPublisher.java
b/springboot/addons/task-notification/src/main/java/org/kie/kogito/task/notification/spring/SpringNotificationEventPublisher.java
index 2aa756ebd8..46c0e4b71d 100644
---
a/springboot/addons/task-notification/src/main/java/org/kie/kogito/task/notification/spring/SpringNotificationEventPublisher.java
+++
b/springboot/addons/task-notification/src/main/java/org/kie/kogito/task/notification/spring/SpringNotificationEventPublisher.java
@@ -22,6 +22,7 @@ import java.util.Collection;
import org.kie.kogito.event.DataEvent;
import org.kie.kogito.event.EventPublisher;
+import org.kie.kogito.event.usertask.UserTaskInstanceDeadlineDataEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,7 +43,7 @@ public class SpringNotificationEventPublisher implements
EventPublisher {
@Override
public void publish(DataEvent<?> event) {
- if (event.getType().startsWith("UserTaskInstanceDeadline")) {
+ if (event instanceof UserTaskInstanceDeadlineDataEvent) {
logger.debug("About to publish event {} to Kafka topic {}", event,
topic);
try {
emitter.send(topic, event);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]