jadex.bpmn.runtime.handler.EventIntermediateErrorActivityHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-kernel-bpmn Show documentation
Show all versions of jadex-kernel-bpmn Show documentation
The Jadex BPMN kernel provides a workflow kernel
for the standardized business process modeling
notation. The kernel relies on annotated BPMN
diagrams, which include detailed execution
information.
package jadex.bpmn.runtime.handler;
import jadex.bpmn.model.MActivity;
import jadex.bpmn.runtime.BpmnInterpreter;
import jadex.bpmn.runtime.ProcessThread;
/**
* On error end propagate an exception.
*/
public class EventIntermediateErrorActivityHandler extends DefaultActivityHandler
{
/**
* Execute the activity.
*/
protected void doExecute(MActivity activity, BpmnInterpreter instance, ProcessThread thread)
{
// Do catch exception when the activity is an event handler.
if(activity.isEventHandler())
{
super.doExecute(activity, instance, thread);
}
// Otherwise throw an exception.
else
{
Exception ex = (Exception)thread.getPropertyValue("exception", activity);
if(ex==null)
ex = new EventIntermediateErrorException(activity.getDescription());
thread.setException(ex);
}
}
/**
* Runtime exception representing explicit process failure.
*/
public static class EventIntermediateErrorException extends RuntimeException
{
/**
* Create an empty end error.
*/
public EventIntermediateErrorException()
{
}
/**
* Create an end error with an error message.
*/
public EventIntermediateErrorException(String message)
{
super(message);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy