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

jadex.bdibpmn.handler.EventIntermediateTimerActivityHandler Maven / Gradle / Ivy

Go to download

The Jadex BDI-BPMN kernel allows to use BPMN workflow descriptions as alternative description for BDI agent plans.

There is a newer version: 2.4
Show newest version
package jadex.bdibpmn.handler;

import jadex.bdibpmn.BpmnPlanBodyInstance;
import jadex.bpmn.model.MActivity;
import jadex.bpmn.runtime.BpmnInterpreter;
import jadex.bpmn.runtime.ProcessThread;
import jadex.bpmn.runtime.handler.AbstractEventIntermediateTimerActivityHandler;

/**
 *  Simple platform specific timer implementation.
 *  Uses java.util.Timer for testing purposes.
 */
public class EventIntermediateTimerActivityHandler extends	AbstractEventIntermediateTimerActivityHandler
{
	/**
	 *  Template method to be implemented by platform-specific subclasses.
	 *  @param activity	The timing event activity.
	 *  @param instance	The process instance.
	 *  @param thread	The process thread.
	 *  @param duration	The duration to wait.
	 */
	public void	doWait(final MActivity activity, final BpmnInterpreter instance, final ProcessThread thread, long duration)
	{
		((BpmnPlanBodyInstance)instance).addTimer(thread, duration);
	}
	
	/**
	 *  Execute an activity.
	 *  @param activity	The activity to execute.
	 *  @param instance	The process instance.
	 *  @param thread The process thread.
	 *  @param info The info object.
	 */
	public void cancel(MActivity activity, BpmnInterpreter instance, ProcessThread thread)
	{
		((BpmnPlanBodyInstance)instance).removeTimer(thread);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy