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

import org.huihoo.workflow.WorkflowComplexComponent;
import org.huihoo.workflow.usermodel.WorkflowParticipant;
import org.huihoo.workflow.xpdl.WorkflowProcess;

public abstract class WorkflowCase extends WorkflowComplexComponent
{
	/**
	 * The first number in the range of ids used for case stats.
	 */
	public static final int CASE_FIRST		= 100;

	/**
	 * The last number in the range of ids used for case stats.
	 */
	public static final int CASE_LAST		        = 106;
	
	public static final int CREATED = CASE_FIRST;
	
	public static final int RUNNING = 1 + CASE_FIRST;	

	public static final int SUSPENDED = 2 + CASE_FIRST;

	public static final int RESUMED = 3 + CASE_FIRST;
	
	public static final int CANCELLED = 4 + CASE_FIRST;

	public static final int COMPLETED = 5 + CASE_FIRST;

	public static final int ARCHIVED = 6 + CASE_FIRST;

	/** 
	 * Construct a new WorkflowComponenet.
	 */
	protected WorkflowCase()
	{
		this(null, null);
	}
	
	/** 
	 * Construct a new WorkflowComponenet.
	 *
	 * @param uuid_ The element ID
	 * @param name The element name
	 */
	protected WorkflowCase(String uuid, String name)
	{
		this(uuid, name, null);
	}
	
	/** 
	 * Construct a new WorkflowComponenet.
	 *
	 * @param uuid_       The element ID
	 * @param name        The element name
	 * @param description The element description
	 */
	protected WorkflowCase(String uuid_, String name, String description)
	{
		super(uuid_, name, description);
	}
	
	//-------------------------------------------------------- 
	public abstract WorkflowProcess getWorkflowProcess();
	public abstract void setWorkflowProcess(WorkflowProcess workflowProcess);

	public abstract WorkflowCaseContext getCaseContext();
	public abstract void setCaseContext(WorkflowCaseContext context);

	//--------------------------------------------------------     
	public abstract WorkflowPrimaryKey getPrimaryKey();
	public abstract void setPrimaryKey(WorkflowPrimaryKey primaryKey);

	public abstract int getState();
	public abstract void setState(int state);

	public abstract Date getCreationTime();
	public abstract void setCreationTime(Date creationTime);

	public abstract WorkflowParticipant getCreator();
	public abstract void setCreator(WorkflowParticipant creator);

	public abstract String getMagicUUID();
	public abstract void setMagicUUID(String magic_id);

}
