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

jadex.bpmn.runtime.handler.EventIntermediateMultipleActivityHandler 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: 4.0.267
Show newest version
package jadex.bpmn.runtime.handler;

import java.util.List;

import jadex.bpmn.model.MActivity;
import jadex.bpmn.model.MSequenceEdge;
import jadex.bpmn.runtime.ProcessThread;
import jadex.bridge.IInternalAccess;
import jadex.commons.IFilter;

/**
 *  Event intermediate multi handler.
 */
public class EventIntermediateMultipleActivityHandler extends DefaultActivityHandler
{
	/**
	 *  Execute an activity.
	 *  @param activity	The activity to execute.
	 *  @param instance	The process instance.
	 *  @param thread	The process thread.
	 */
	public void execute(final MActivity activity, final IInternalAccess instance, final ProcessThread thread)
	{
//		System.out.println("Executed: "+activity+", "+instance);
		
		// Call all connected intermediate event handlers.
		final List outgoing = activity.getOutgoingSequenceEdges();
		if(outgoing==null)
			throw new UnsupportedOperationException("Activity must have connected activities: "+activity);
		
		// Execute all connected activities.
		final IFilter[] filters = new IFilter[outgoing.size()];
		final ICancelable[] waitinfos = new ICancelable[outgoing.size()];
		
		for(int i=0; i outgoing = activity.getOutgoingSequenceEdges();
//		Object[] waitinfos = (Object[])thread.getWaitInfo();
//		
////		if(waitinfos==null)
////			System.out.println("here");
//	
//		for(int i=0; i
{
	//-------- attributes ---------
	
	/** The filters. */
	protected IFilter[] filters;
	
	//-------- constructors --------
	
	/**
	 *  Create a new or filter.
	 */
	public OrFilter(IFilter[] filters) 
	{
		this.filters = filters;
	}
	
	//-------- methods --------
	
	/**
	 *  Test if an object passes the filter.
	 *  @return True, if passes the filter.
	 */
	public boolean filter(Object obj)
	{
		boolean ret = false;
		for(int i=0; !ret && i[] getFilters()
	{
		return filters;
	}
}