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

import org.huihoo.workflow.*;
import org.huihoo.workflow.WorkflowException;
import org.huihoo.workflow.server.WorkflowCase;
import org.huihoo.workflow.server.WorkflowPrimaryKey;
import org.huihoo.workflow.server.WorkflowPath;
import org.huihoo.workflow.server.WorkflowSession;
import org.huihoo.workflow.server.WorkflowWork;
import org.huihoo.workflow.usermodel.WorkflowParticipant;
import org.huihoo.workflow.xpdl.WorkflowActivity;
import org.huihoo.workflow.xpdl.WorkflowParameter;
import org.huihoo.workflow.xpdl.WorkflowProcess;

public interface WorkflowCaseDatabase extends WorkflowDatabase
{
//---------------------------------------------------------------------------
//
//---------------------------------------------------------------------------
	public WorkflowTemplate getWorkflowTemplate();
	public void setWorkflowTemplate(WorkflowTemplate workflowTemplate);

//---------------------------------------------------------------------------
//
//---------------------------------------------------------------------------
	public String createCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowParticipant creator,
		Date creationTime,
		String primaryKey,
		String name,
		String description)
		throws WorkflowException;

	public WorkflowCase findCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		String caseId)
		throws WorkflowException;

	public WorkflowCase findCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowPrimaryKey primaryKey)
		throws WorkflowException;

	public void updateCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		String description)
		throws WorkflowException;

	public void deleteCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		String description)
		throws WorkflowException;

	public void cancelCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		String description)
		throws WorkflowException;

	public void completeCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException;

	public void confirmCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase)
		throws WorkflowException;

	public void suspendCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		String description)
		throws WorkflowException;

	public void resumeCase(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		String description)
		throws WorkflowException;

	public String createWork(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		WorkflowActivity activity,
		WorkflowWork parentWork,
		WorkflowParticipant performer,
		java.util.Date arriveTime,
		int eventType,
		int priority)
		throws WorkflowException;

	public void updateWork(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork,
		String description)
		throws WorkflowException;

	public void deleteWork(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork,
		String description)
		throws WorkflowException;

	public WorkflowWork findWork(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		String workId)
		throws WorkflowException;

	public String createPath(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		WorkflowWork fromWork,
		WorkflowWork toWork,
		String batchNo,
		int eventType)
		throws WorkflowException;

	public WorkflowPath findPath(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		String pathId)
		throws WorkflowException;

	public void deletePath(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowPath workflowPath)
		throws WorkflowException;

	public void createCaseEvent(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		Date opTime,
		int eventType,
		String description)
		throws WorkflowException;

	public void createWorkEvent(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowWork workflowWork,
		Date opTime,
		int eventType,
		String description)
		throws WorkflowException;

	public void createParameter(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		WorkflowParameter parameter)
		throws WorkflowException;

	public void updateParameter(
		WorkflowSession workflowSession,
		WorkflowTransaction workflowTransaction,
		WorkflowProcess workflowProcess,
		WorkflowCase workflowCase,
		WorkflowParameter parameter)
		throws WorkflowException;

}
