/*
 * $Id: PackageManager.java,v 1.2 2004/09/20 10:26:15 koppy Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 * 
 * Created on 13.07.2004
 *
 * $Log: PackageManager.java,v $
 * Revision 1.2  2004/09/20 10:26:15  koppy
 * +javadoc Dokumentation
 *
 * Revision 1.1  2004/08/30 14:49:59  koppy
 * Initiale Version der Workflow-Komponente
 *
 */
package vkc.workflow.service.manager;

import java.util.List;

import vkc.db.entities.VKCUser;
import vkc.workflow.WorkflowException;
import vkc.workflow.service.WfMConnection;

/**
 * This interface defines methods
 * corresponding to the management of workflow packages.
 * 
 * @author Andreas Koop
 */
public interface PackageManager {

    /**
     * Returns list (of type ProcessDefinitionInfo)
     * from the package with the given pkgId
     * respective to the user rights.
     * 
     * @param user VKC user
     * @param pkgId teh package id
     * @return list (of type ProcessDefinitionInfo)
     */
    public List getProcessesToStart(VKCUser user, String pkgId);
    
    /**
     * Returns a list of type PackageInfo
     * 
     * @param sConn the workflow connection
     * @return a list of type PackageInfo
     * @throws WorkflowException
     */
    public List getOpenPackages( WfMConnection sConn ) throws WorkflowException;
    
    /**
     * Opens a package with the given name
     * and loads it into workflow engine.
     * 
     * @param sConn workflow connection
     * @param xpdlName name of the XPDL file
     * @return the package id
     * @throws WorkflowException
     */
    public String openPackage( WfMConnection sConn, String xpdlName ) throws WorkflowException;
    
    /**
     * Closes a workflow package with the given id.
     * 
     * @param sConn workflow connection
     * @param pkgId the package id of the package to close
     * @throws WorkflowException
     */
    public void closePackage( WfMConnection sConn, String pkgId ) throws WorkflowException;
    
    /**
     * Enables/Disables a process definition.
     * 
     * @param sConn workflow connection
     * @param pDefId process defintition id
     * @param enabled true to enable, false to disable
     * @throws WorkflowException
     */
    public void setProcessDefinitionEnabled( WfMConnection sConn, String pDefId, boolean enabled )
    	throws WorkflowException;
    
    /**
     * Enables/Disables a package definition.
     * 
     * @param sConn workflow connection
     * @param pkgId package id
     * @param enabled true to enable, false to disable
     * @throws WorkflowException
     */
    public void setPackageEnabled( WfMConnection sConn, String pkgId, boolean enabled )
		throws WorkflowException;
    
}
