//----------------------------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 org.huihoo.workflow.server.WorkflowPath;
import org.huihoo.workflow.server.WorkflowWork;

public class WorkflowPathImpl extends WorkflowPath
{
	protected WorkflowWork fromWork;
	protected WorkflowWork toWork;

	protected String batchNo;
	protected int eventType;

	public WorkflowPathImpl()
	{
	}

	public WorkflowPathImpl(String uuid, String name, String description, WorkflowWork fromWork_, WorkflowWork toWork_)
	{
		super(uuid, name, description);

		this.fromWork = fromWork_;
		this.toWork = toWork_;
	}

	public WorkflowWork getFromWork()
	{
		return fromWork;
	}

	public void setFromWork(WorkflowWork fromWork_)
	{
		this.fromWork = fromWork_;
	}
	public WorkflowWork getToWork()
	{
		return toWork;
	}

	public void setToWork(WorkflowWork toWork_)
	{
		this.toWork = toWork_;
	}

	public String getBacthNo()
	{
		return this.batchNo;
	}
	public void setBacthNo(String batchNo_)
	{
		this.batchNo = batchNo_;
	}

	public int getEventType()
	{
		return eventType;
	}

	public void setEventType(int eventType_)
	{
		this.eventType = eventType_;
	}

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

		sb.append("[");
		sb.append(getTagName()+":");
		sb.append("[uuid=");
		sb.append(uuid == null ? "?" : uuid);
		sb.append("],");
		sb.append("[from=");
		sb.append(fromWork == null ? "?" : fromWork.toString());
		sb.append("]");
		sb.append("],");
		sb.append("[to=");
		sb.append(toWork == null ? "?" : toWork.toString());
		sb.append("]");
		sb.append("]");
		sb.append("]");

		return sb.toString();
	}
}
