//----------------------------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.willow.desktop;

import java.rmi.RemoteException;

import org.huihoo.workflow.desktop.CaseDatabase;
import org.huihoo.workflow.desktop.UserDatabase;
import org.huihoo.workflow.desktop.WorkflowDesktop;
import org.huihoo.workflow.desktop.WorkflowImplementation;
import org.huihoo.workflow.server.WorkflowDispatcher;
import org.huihoo.workflow.server.WorkflowXPDL;
import org.huihoo.workflow.xpdl.WorkflowPackage;

public class WorkflowRealization implements WorkflowImplementation
{
	protected WorkflowDesktop desktop;
	
	protected WorkflowPackage workflowpackage;
	
	protected CaseDatabase caseDatabase;
	protected UserDatabase userDatabase;
	protected WorkflowDispatcher dispatcher;
	
	public WorkflowRealization(WorkflowDesktop desktop,WorkflowXPDL workflowTemplate)
	throws RemoteException
	{
		this.desktop = desktop;
		
		this.workflowpackage = workflowTemplate.getWorkflowPackage();
		
		this.caseDatabase = new CaseDatabaseImpl(this,workflowTemplate);
		this.userDatabase = new UserDatabaseImpl(this,workflowTemplate);
		this.dispatcher = new WorkflowDispatcherImpl(this,workflowTemplate);		
	}
	
	public WorkflowDesktop getDesktop()
	{
		return desktop;
	}
	
	public String getUUID()
	{
		return workflowpackage.getUUID();
	}
	
	public WorkflowPackage getWorkflowPackage()
	{
		return workflowpackage;
	}
	
	public CaseDatabase getCaseDatabase()
	{
		return caseDatabase;
	}
	
	public UserDatabase getUserDatabase()
	{
		return userDatabase;
	}
	
	public WorkflowDispatcher getWorkflowDispatcher()
	{
		return dispatcher;
	}
}