From 0c32006941a615229caa2cfbaa153553602c28bb Mon Sep 17 00:00:00 2001 From: nmirasch Date: Tue, 27 Feb 2024 19:35:13 +0100 Subject: [PATCH] RHPAM-4779: New event when Process Instance related data changes (cherry picked from commit 3a9897bb5ed698845dc89356cf7ccf72461dacf8) --- .../process/DefaultProcessEventListener.java | 3 +++ .../process/ProcessDataChangedEvent.java | 26 +++++++++++++++++++ .../event/process/ProcessEventListener.java | 7 +++++ 3 files changed, 36 insertions(+) create mode 100644 kie-api/src/main/java/org/kie/api/event/process/ProcessDataChangedEvent.java diff --git a/kie-api/src/main/java/org/kie/api/event/process/DefaultProcessEventListener.java b/kie-api/src/main/java/org/kie/api/event/process/DefaultProcessEventListener.java index 0e92a4490..e3021858a 100644 --- a/kie-api/src/main/java/org/kie/api/event/process/DefaultProcessEventListener.java +++ b/kie-api/src/main/java/org/kie/api/event/process/DefaultProcessEventListener.java @@ -59,5 +59,8 @@ public void beforeProcessStarted(ProcessStartedEvent event) { public void beforeVariableChanged(ProcessVariableChangedEvent event) { // intentionally left blank } + public void onProcessDataChangedEvent(ProcessDataChangedEvent event) { + // intentionally left blank + } } diff --git a/kie-api/src/main/java/org/kie/api/event/process/ProcessDataChangedEvent.java b/kie-api/src/main/java/org/kie/api/event/process/ProcessDataChangedEvent.java new file mode 100644 index 000000000..364630fc1 --- /dev/null +++ b/kie-api/src/main/java/org/kie/api/event/process/ProcessDataChangedEvent.java @@ -0,0 +1,26 @@ +/* + * Copyright 2023 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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.api.event.process; + +/** + * A runtime event that is generated when a ProcessInstance is completed. + */ +public interface ProcessDataChangedEvent + extends + ProcessEvent { + +} diff --git a/kie-api/src/main/java/org/kie/api/event/process/ProcessEventListener.java b/kie-api/src/main/java/org/kie/api/event/process/ProcessEventListener.java index 44a9ff676..16db2812b 100644 --- a/kie-api/src/main/java/org/kie/api/event/process/ProcessEventListener.java +++ b/kie-api/src/main/java/org/kie/api/event/process/ProcessEventListener.java @@ -121,4 +121,11 @@ default void onMessage(MessageEvent event) {} * @param event */ default void onAsyncNodeScheduledEvent(ProcessAsyncNodeScheduledEvent event) {} + + /** + * This listener method is invoked when any process instance's data has been modified. + * @param event + */ + default void onProcessDataChangedEvent(ProcessDataChangedEvent event) {} } +