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

import java.util.Date;

import org.huihoo.workflow.server.PhantomCase;
import org.huihoo.workflow.server.WorkflowCaseContext;
import org.huihoo.workflow.server.WorkflowPrimaryKey;
import org.huihoo.workflow.usermodel.WorkflowParticipant;
import org.huihoo.workflow.xpdl.WorkflowProcess;


public class PhantomCaseImpl extends PhantomCase
{
	protected WorkflowProcess workflowProcess;

	protected WorkflowPrimaryKey primaryKey;
	protected Date creationTime;
	protected WorkflowParticipant creator;

	protected int case_state;
	protected String magic_id;

	private WorkflowCaseContext caseContext;

	public PhantomCaseImpl()
	{
	}

	public PhantomCaseImpl(
		String uuid,
		String name,
		String description,
		WorkflowProcess workflowProcess_,
		WorkflowCaseContext caseContext_,
		WorkflowPrimaryKey primaryKey_,
		Date creationTime_,
		WorkflowParticipant creator_)
	{
		super(uuid, name, description);
		this.workflowProcess = workflowProcess_;
		this.caseContext = caseContext_;

		this.primaryKey = primaryKey_;
		this.creationTime = creationTime_;
		this.creator = creator_;
	}

	public WorkflowProcess getWorkflowProcess()
	{
		return workflowProcess;
	}

	public void setWorkflowProcess(WorkflowProcess workflowProcess_)
	{
		this.workflowProcess = workflowProcess_;

	}

	public WorkflowCaseContext getCaseContext()
	{
		return caseContext;
	}
	public void setCaseContext(WorkflowCaseContext caseContext_)
	{
		this.caseContext = caseContext_;

	}
	public WorkflowPrimaryKey getPrimaryKey()
	{
		return primaryKey;
	}
	public void setPrimaryKey(WorkflowPrimaryKey primaryKey_)
	{

		this.primaryKey = primaryKey_;

	}
	public int getState()
	{
		return case_state;
	}
	public void setState(int state)
	{
		case_state = state;
	}

	public String getMagicUUID()
	{
		return magic_id;
	}

	public void setMagicUUID(String magic_id)
	{
		this.magic_id = magic_id;
	}

	public Date getCreationTime()
	{
		return creationTime;
	}
	public void setCreationTime(Date creationTime_)
	{
		this.creationTime = creationTime_;

	}
	public WorkflowParticipant getCreator()
	{
		return creator;
	}

	public void setCreator(WorkflowParticipant creator_)
	{
		this.creator = creator_;
	}

	public String getTagName()
	{
		return "PhantomCase";
	}
	
	public String toString()
	{
		StringBuffer sb = new StringBuffer();

		sb.append("[");
		sb.append(getTagName()+":");
		sb.append("[uuid=");
		sb.append(uuid == null ? "?" : uuid);
		sb.append("],");
		sb.append("[name=");
		sb.append(name == null ? "?" : name);
		sb.append("],");
		sb.append("[primaryKey=");
		sb.append(primaryKey == null ? "?" : primaryKey.toString());
		sb.append("]");
		sb.append("]");

		return sb.toString();
	}
}
