//----------------------------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.server;

import java.rmi.RemoteException;
import java.util.Map;

import org.huihoo.workflow.WorkflowException;
import org.huihoo.workflow.WorkflowRemoteComponent;
import org.huihoo.workflow.WorkflowSerializable;
import org.huihoo.workflow.desktop.WorkflowImplementation;
import org.huihoo.workflow.xpdl.WorkflowProcess;

public interface WorkflowDispatcher extends WorkflowRemoteComponent, WorkflowSerializable
{
	//------------------------------------------------------------------------------------
	// WorkflowImplementation  utilities   
	//------------------------------------------------------------------------------------                                        
	public WorkflowImplementation getWorkflowImplementation() throws RemoteException;

	//------------------------------------------------------------------------------------
	// WorkflowDispatcher core plain utilities   
	//------------------------------------------------------------------------------------                                        
	public boolean accept(String workflowProcess, String workflowCase, String workflowWork)
		throws WorkflowException, RemoteException;

	public boolean submit(String workflowProcess, String workflowCase, String workflowWork)
		throws WorkflowException, RemoteException;
	public boolean resubmit(String workflowProcess, String workflowCase, String workflowWork)
		throws WorkflowException, RemoteException;

	public boolean backtrack(String workflowProcess, String workflowCase, String workflowWork)
		throws WorkflowException, RemoteException;
	public boolean reverse(String workflowProcess, String workflowCase, String workflowWork)
		throws WorkflowException, RemoteException;

	public boolean fetch(String workflowProcess, String workflowCase, String workflowWork)
		throws WorkflowException, RemoteException;

	//如果用户显式的提供了分发的后继工作项的处理者的话，要求后继分发转移必须唯一
	//此接口属于高级功能，请遵循约束根据需要调用
	public boolean submit(String workflowProcess, String workflowCase, String workflowWork, Map userObject)
		throws WorkflowException, RemoteException;

	//------------------------------------------------------------------------------------
	// WorkflowDispatcher core utilities   
	//------------------------------------------------------------------------------------                                        
	public boolean accept(WorkflowProcess workflowProcess, WorkflowWork workflowWork)
		throws WorkflowException, RemoteException;

	public boolean submit(WorkflowProcess workflowProcess, WorkflowWork workflowWork)
		throws WorkflowException, RemoteException;
	public boolean resubmit(WorkflowProcess workflowProcess, WorkflowWork workflowWork)
		throws WorkflowException, RemoteException;

	public boolean backtrack(WorkflowProcess workflowProcess, WorkflowWork workflowWork)
		throws WorkflowException, RemoteException;
	public boolean reverse(WorkflowProcess workflowProcess, WorkflowWork workflowWork)
		throws WorkflowException, RemoteException;

	public boolean fetch(WorkflowProcess workflowProcess, WorkflowWork workflowWork)
		throws WorkflowException, RemoteException;

	//如果用户显式的提供了分发的后继工作项的处理者的话，要求后继分发转移必须唯一
	//此接口属于高级功能，请遵循约束根据需要调用
	public boolean submit(WorkflowProcess workflowProcess, WorkflowWork workflowWork, Map userObject)
		throws WorkflowException, RemoteException;

}
