//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010 huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/willow
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : willow@lists.sourceforge.net 
 */
//----------------------------END  LICENSE-----------------------------
package org.huihoo.workflow.store;

import java.util.Map;

import org.huihoo.workflow.*;
import org.huihoo.workflow.WorkflowComponent;
import org.huihoo.workflow.WorkflowException;
import org.huihoo.workflow.server.WorkflowSession;
import org.huihoo.workflow.server.WorkflowWork;
import org.huihoo.workflow.xpdl.WorkflowProcess;

public interface WorkflowDispatcher extends WorkflowComponent
{
	//---------------------------------------------------------------------------
	//
	//---------------------------------------------------------------------------
	public WorkflowTemplate getWorkflowTemplate();
	public void setWorkflowTemplate(WorkflowTemplate workflowTemplate);

	//------------------------------------------------------------------------------------
	// WorkflowDispatcher core utilities   
	//------------------------------------------------------------------------------------                                        
	public boolean accept(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork)
		throws WorkflowException;

	public boolean submit(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork,
		Map userObject)
		throws WorkflowException;

	public boolean resubmit(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork)
		throws WorkflowException;

	public boolean fetch(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork)
		throws WorkflowException;

	public boolean backtrack(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork)
		throws WorkflowException;

	public boolean reverse(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork)
		throws WorkflowException;
}
