All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bpmn.runtime.handler.EventIntermediateErrorActivityHandler Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 2.4
Show newest version
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