Skip to content

Commit

Permalink
[Fix apache/incubator-kie-issues#987] Add onError listener
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Apr 5, 2024
1 parent b5ed416 commit a511faa
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
33 changes: 33 additions & 0 deletions kie-api/src/main/java/org/kie/api/event/process/ErrorEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* 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.api.event.process;

import org.kie.api.runtime.process.NodeInstance;

/**
* An event when a error is thrown
*/
public interface ErrorEvent extends ProcessNodeEvent {
/**
* Error associated to the event
*
* @return exception
*/
Exception getException();
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,10 @@ default void onSignal(SignalEvent event) {}
* @param event
*/
default void onMessage(MessageEvent event) {}

/**
* This listener method is invoked when an error is captured
* @param event
*/
default void onError (ErrorEvent event) {}
}

0 comments on commit a511faa

Please sign in to comment.