提交 e3619c2a 编写于 作者: J jbarrez

Added throws exception to execute of BpmnJavaDelegation. Thanks Falko!

上级 cb7aa52e
......@@ -43,10 +43,10 @@ public abstract class BpmnJavaDelegation extends BpmnActivityBehavior implements
performDefaultOutgoingBehavior(execution);
}
public void notify(EventListenerExecution execution) {
public void notify(EventListenerExecution execution) throws Exception {
execute((DelegateExecution) execution);
}
public abstract void execute(DelegateExecution execution);
public abstract void execute(DelegateExecution execution) throws Exception;
}
......@@ -22,5 +22,5 @@ public interface EventListener {
String EVENTNAME_END = "end";
String EVENTNAME_TAKE = "take";
void notify(EventListenerExecution execution);
void notify(EventListenerExecution execution) throws Exception;
}
......@@ -15,6 +15,7 @@ package org.activiti.pvm.impl.runtime;
import java.util.List;
import org.activiti.pvm.PvmException;
import org.activiti.pvm.event.EventListener;
import org.activiti.pvm.impl.process.ScopeImpl;
......@@ -33,7 +34,13 @@ public abstract class AbstractEventAtomicOperation implements AtomicOperation {
execution.setEventName(getEventName());
execution.setEventSource(scope);
EventListener listener = eventListeners.get(eventListenerIndex);
listener.notify(execution);
try {
listener.notify(execution);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new PvmException("couldn't execute event listener : "+e.getMessage(), e);
}
execution.setEventListenerIndex(eventListenerIndex+1);
execution.performOperation(this);
......
......@@ -15,6 +15,7 @@ package org.activiti.pvm.impl.runtime;
import java.util.List;
import java.util.logging.Logger;
import org.activiti.pvm.PvmException;
import org.activiti.pvm.event.EventListener;
import org.activiti.pvm.impl.process.ActivityImpl;
import org.activiti.pvm.impl.process.ScopeImpl;
......@@ -38,7 +39,13 @@ public class AtomicOperationTransitionNotifyListenerTake implements AtomicOperat
execution.setEventName(EventListener.EVENTNAME_TAKE);
execution.setEventSource(transition);
EventListener listener = eventListeners.get(eventListenerIndex);
listener.notify(execution);
try {
listener.notify(execution);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new PvmException("couldn't execute event listener : "+e.getMessage(), e);
}
execution.setEventListenerIndex(eventListenerIndex+1);
execution.performOperation(this);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册