/*
 * Created on 2004-1-24
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package workflow.store.spi;

import java.util.List;

import workflow.WorkflowException;
import workflow.store.persistence.PrimaryKey;
import workflow.store.persistence.UserTransaction;
import workflow.wfmc.pm.Participant;
import workflow.wfmc.rtm.WorkflowCase;
import workflow.wfmc.rtm.WorkflowPath;
import workflow.wfmc.rtm.WorkflowWork;
import workflow.wfmc.xpdl.WorkflowActivity;
import workflow.wfmc.xpdl.WorkflowParameter;
import workflow.wfmc.xpdl.WorkflowProcess;

/**
 * @author reic
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public interface SpiCaseDatabase extends SpiDatabase
{
	//------------------------------------------------------------------------------------
	// SpiCaseIdGenerator utilities
	//------------------------------------------------------------------------------------ 
	public SpiCaseIdGenerator getCaseIdGenerator();
	public void setCaseIdGenerator(SpiCaseIdGenerator caseIdGenerator);
	
	//------------------------------------------------------------------------------------
	// UserTransaction utilities
	//------------------------------------------------------------------------------------ 
	public UserTransaction getUserTransaction() throws WorkflowException;

	//------------------------------------------------------------------------------------
	// WorkflowCase utilities   
	//------------------------------------------------------------------------------------                                        
	public String createWorkflowCase(WorkflowProcess workflowProcess,
		Participant creator,
		java.util.Date creationTime,
		String primaryKey)
		throws WorkflowException;
	public String createWorkflowCase(WorkflowProcess workflowProcess,
		UserTransaction userTransaction,
		Participant creator,
		java.util.Date creationTime,
		String primaryKey)
		throws WorkflowException;

	public String createWorkflowCase(WorkflowProcess workflowProcess,
		Participant creator,
		java.util.Date creationTime,
		String primaryKey,
		String name)
		throws WorkflowException;
	public String createWorkflowCase(WorkflowProcess workflowProcess,
		UserTransaction userTransaction,
		Participant creator,
		java.util.Date creationTime,
		String primaryKey,
		String name)
		throws WorkflowException;

	public String createWorkflowCase(WorkflowProcess workflowProcess,
		Participant creator,
		java.util.Date creationTime,
		String primaryKey,
		String name,
		String description)
		throws WorkflowException;
	public String createWorkflowCase(WorkflowProcess workflowProcess,
		UserTransaction userTransaction,
		Participant creator,
		java.util.Date creationTime,
		String primaryKey,
		String name,
		String description)
		throws WorkflowException;

	public WorkflowCase findWorkflowCase(WorkflowProcess workflowProcess,Participant operator, String caseId)
		throws WorkflowException;
	public WorkflowCase findWorkflowCase(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		String caseId)
		throws WorkflowException;

	public WorkflowCase findWorkflowCase(WorkflowProcess workflowProcess,Participant operator, PrimaryKey primaryKey)
		throws WorkflowException;
	public WorkflowCase findWorkflowCase(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		PrimaryKey primaryKey)
		throws WorkflowException;

	public List getWorkflowCaseList(WorkflowProcess workflowProcess,Participant operator, Participant creator)
		throws WorkflowException;
	public List getWorkflowCaseList(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		Participant creator)
		throws WorkflowException;

	public void updateWorkflowCase(WorkflowProcess workflowProcess,Participant operator, WorkflowCase workflowCase)
		throws WorkflowException;
	public void updateWorkflowCase(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase)
		throws WorkflowException;

	public void deleteWorkflowCase(WorkflowProcess workflowProcess,Participant operator, WorkflowCase workflowCase)
		throws WorkflowException;
	public void deleteWorkflowCase(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase)
		throws WorkflowException;

	public void cancelWorkflowCase(WorkflowProcess workflowProcess,Participant operator, WorkflowCase workflowCase)
		throws WorkflowException;
	public void cancelWorkflowCase(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase)
		throws WorkflowException;

	public void closeWorkflowCase(WorkflowProcess workflowProcess,Participant operator, WorkflowCase workflowCase)
		throws WorkflowException;
	public void closeWorkflowCase(WorkflowProcess workflowProcess,Participant operator,UserTransaction userTransaction, WorkflowCase workflowCase)
		throws WorkflowException;

	public void suspendWorkflowCase(WorkflowProcess workflowProcess,Participant operator, WorkflowCase workflowCase)
		throws WorkflowException;
	public void suspendWorkflowCase(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase)
		throws WorkflowException;

	public void resumeWorkflowCase(WorkflowProcess workflowProcess,Participant operator, WorkflowCase workflowCase)
		throws WorkflowException;
	public void resumeWorkflowCase(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase)
		throws WorkflowException;
	//------------------------------------------------------------------------------------
	// WorkflowWork utilities
	//------------------------------------------------------------------------------------  
	public String createWorkflowWork(WorkflowProcess workflowProcess,
		Participant operator,
		WorkflowCase workflowCase,
		WorkflowActivity activity,
		Participant performer,
		java.util.Date arriveTime)
		throws WorkflowException;
	public String createWorkflowWork(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		WorkflowActivity activity,
		Participant performer,
		java.util.Date arriveTime)
		throws WorkflowException;

	public void updateWorkflowWork(WorkflowProcess workflowProcess,Participant operator, WorkflowWork work) throws WorkflowException;
	public void updateWorkflowWork(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowWork work)
		throws WorkflowException;

	public void deleteWorkflowWork(WorkflowProcess workflowProcess,Participant operator, WorkflowWork work) throws WorkflowException;
	public void deleteWorkflowWork(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowWork work)
		throws WorkflowException;

	public WorkflowWork findWorkflowWork(WorkflowProcess workflowProcess,
		Participant operator,
		WorkflowCase workflowCase,
		String workId)
		throws WorkflowException;
	public WorkflowWork findWorkflowWork(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		String workId)
		throws WorkflowException;

	public List getWorkflowWorkList(WorkflowProcess workflowProcess,Participant operator, Participant performer, int itemStatus)
		throws WorkflowException;
	public List getWorkflowWorkList(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		Participant performer,
		int itemStatus)
		throws WorkflowException;

	public List getWorkflowWorkList(WorkflowProcess workflowProcess,
		Participant operator,
		WorkflowCase workflowCase,
		Participant performer,
		int itemStatus)
		throws WorkflowException;
	public List getWorkflowWorkList(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		Participant performer,
		int itemStatus)
		throws WorkflowException;

	//------------------------------------------------------------------------------------
	// WorkflowWork utilities
	//------------------------------------------------------------------------------------ 
	public String createWorkflowSubWork(WorkflowProcess workflowProcess,
		Participant operator,
		WorkflowCase workflowCase,
		WorkflowActivity activity,
		WorkflowWork parentWork,
		Participant performer,
		java.util.Date arriveTime)
		throws WorkflowException;
	public String createWorkflowSubWork(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		WorkflowActivity activity,
		WorkflowWork parentWork,
		Participant performer,
		java.util.Date arriveTime)
		throws WorkflowException;

	//------------------------------------------------------------------------------------
	// WorkflowPath utilities
	//------------------------------------------------------------------------------------ 
	public String createWorkflowPath(WorkflowProcess workflowProcess,
		Participant operator,
		WorkflowCase workflowCase,
		WorkflowWork fromWork,
		WorkflowWork toWork,
		String batchNo,
		int eventType)
		throws WorkflowException;
	public String createWorkflowPath(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		WorkflowWork fromWork,
		WorkflowWork toWork,
		String batchNo,
		int eventType)
		throws WorkflowException;

	public WorkflowPath findWorkflowPath(WorkflowProcess workflowProcess,
		Participant operator,
		WorkflowCase workflowCase,
		String pathId)
		throws WorkflowException;
	public WorkflowPath findWorkflowPath(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		String pathId)
		throws WorkflowException;

	public List getWorkflowPathList(WorkflowProcess workflowProcess,Participant operator, WorkflowWork wfWork, boolean isInPath)
		throws WorkflowException;
	public List getWorkflowPathList(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowWork wfWork,
		boolean isInPath)
		throws WorkflowException;

	public void deleteWorkflowPath(WorkflowProcess workflowProcess,Participant operator, WorkflowPath wfPath)
		throws WorkflowException;
	public void deleteWorkflowPath(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowPath wfPath)
		throws WorkflowException;

	//------------------------------------------------------------------------------------
	// EventLog utilities
	//------------------------------------------------------------------------------------ 
	public void createWorkflowCaseEvent(WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		Participant operator,
		java.util.Date opTime,
		int eventType)
		throws WorkflowException;
	public void createWorkflowCaseEvent(WorkflowProcess workflowProcess,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		Participant operator,
		java.util.Date opTime,
		int eventType)
		throws WorkflowException;

	public void createWorkflowCaseEvent(WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		Participant operator,
		java.util.Date opTime,
		int eventType,
		String description)
		throws WorkflowException;
	public void createWorkflowCaseEvent(WorkflowProcess workflowProcess,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		Participant operator,
		java.util.Date opTime,
		int eventType,
		String description)
		throws WorkflowException;

	public void createWorkflowWorkEvent(WorkflowProcess workflowProcess,
		WorkflowWork wfWork,
		Participant operator,
		java.util.Date opTime,
		int eventType)
		throws WorkflowException;
	public void createWorkflowWorkEvent(WorkflowProcess workflowProcess,
		UserTransaction userTransaction,
		WorkflowWork wfWork,
		Participant operator,
		java.util.Date opTime,
		int eventType)
		throws WorkflowException;

	public void createWorkflowWorkEvent(WorkflowProcess workflowProcess,
		WorkflowWork wfWork,
		Participant operator,
		java.util.Date opTime,
		int eventType,
		String description)
		throws WorkflowException;
	public void createWorkflowWorkEvent(WorkflowProcess workflowProcess,
		UserTransaction userTransaction,
		WorkflowWork wfWork,
		Participant operator,
		java.util.Date opTime,
		int eventType,
		String description)
		throws WorkflowException;

	//------------------------------------------------------------------------------------
	// Case runtime parameter utilities
	//------------------------------------------------------------------------------------ 
	public void createWorkflowParameter(WorkflowProcess workflowProcess,
		Participant operator,
		WorkflowCase workflowCase,
		WorkflowParameter parameter)
		throws WorkflowException;
	public void createWorkflowParameter(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		WorkflowParameter parameter)
		throws WorkflowException;

	public void updateWorkflowParameter(WorkflowProcess workflowProcess,
		Participant operator,
		WorkflowCase workflowCase,
		WorkflowParameter parameter)
		throws WorkflowException;
	public void updateWorkflowParameter(WorkflowProcess workflowProcess,
		Participant operator,
		UserTransaction userTransaction,
		WorkflowCase workflowCase,
		WorkflowParameter parameter)
		throws WorkflowException;
}
