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

import java.rmi.RemoteException;

import org.huihoo.workflow.WorkflowException;
import org.huihoo.workflow.WorkflowTransaction;
import org.huihoo.workflow.server.WorkflowCase;
import org.huihoo.workflow.server.WorkflowPrimaryKey;
import org.huihoo.workflow.server.WorkflowWork;
import org.huihoo.workflow.usermodel.WorkflowParticipant;
import org.huihoo.workflow.xpdl.WorkflowProcess;

public interface CaseDatabase extends RemoteDatabase
{
	//------------------------------------------------------------------------------------
	// WorkflowImplementation  utilities   
	//------------------------------------------------------------------------------------                                        
	public WorkflowImplementation getWorkflowImplementation() throws RemoteException;

	//------------------------------------------------------------------------------------
	// WorkflowTransaction utilities
	//------------------------------------------------------------------------------------ 
	public WorkflowTransaction getWorkflowTransaction() throws WorkflowException,RemoteException;

	//------------------------------------------------------------------------------------
	// WorkflowCase utilities   
	//------------------------------------------------------------------------------------                                        
	public String createCase(
		WorkflowProcess workflowProcess,
		WorkflowParticipant creator,
		java.util.Date creationTime,
		String primaryKey)
		throws WorkflowException,RemoteException;

	public String createCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowParticipant creator,
		java.util.Date creationTime,
		String primaryKey)
		throws WorkflowException,RemoteException;

	public String createCase(
		WorkflowProcess workflowProcess,
		WorkflowParticipant creator,
		java.util.Date creationTime,
		String primaryKey,
		String name,
		String description)
		throws WorkflowException,RemoteException;

	public String createCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowParticipant creator,
		java.util.Date creationTime,
		String primaryKey,
		String name,
		String description)
		throws WorkflowException,RemoteException;

	public WorkflowCase findCase(WorkflowProcess workflowProcess, String caseId) throws WorkflowException,RemoteException;

	public WorkflowCase findCase(WorkflowTransaction userTransaction, WorkflowProcess workflowProcess, String caseId)
		throws WorkflowException,RemoteException;

	public WorkflowCase findCase(WorkflowProcess workflowProcess, WorkflowPrimaryKey primaryKey) throws WorkflowException,RemoteException;

	public WorkflowCase findCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowPrimaryKey primaryKey)
		throws WorkflowException,RemoteException;

	public void updateCase(WorkflowProcess workflowProcess, WorkflowCase workflowCase) throws WorkflowException,RemoteException;

	public void updateCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException,RemoteException;

	public void deleteCase(WorkflowProcess workflowProcess, WorkflowCase workflowCase) throws WorkflowException,RemoteException;

	public void deleteCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException,RemoteException;

	public void cancelCase(WorkflowProcess workflowProcess, WorkflowCase workflowCase) throws WorkflowException,RemoteException;

	public void cancelCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException,RemoteException;

	public void completeCase(WorkflowProcess workflowProcess, WorkflowCase workflowCase) throws WorkflowException,RemoteException;

	public void completeCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException,RemoteException;

	public void confirmCase(WorkflowProcess workflowProcess, WorkflowCase workflowCase) throws WorkflowException,RemoteException;

	public void confirmCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException,RemoteException;

	public void suspendCase(WorkflowProcess workflowProcess, WorkflowCase workflowCase) throws WorkflowException,RemoteException;

	public void suspendCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException,RemoteException;

	public void resumeCase(WorkflowProcess workflowProcess, WorkflowCase workflowCase) throws WorkflowException,RemoteException;

	public void resumeCase(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException,RemoteException;

	//------------------------------------------------------------------------------------
	// WorkflowWork utilities   
	//------------------------------------------------------------------------------------                                        
	public WorkflowWork findWork(WorkflowProcess workflowProcess, WorkflowCase workflowCase, String workId)
		throws WorkflowException,RemoteException;

	public WorkflowWork findWork(
		WorkflowTransaction userTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		String workId)
		throws WorkflowException,RemoteException;
}
