/*
 * $Id: VKCWorkflowService.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 06.07.2004
 *
 * $Log: VKCWorkflowService.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;

import java.io.OutputStream;

import org.enhydra.shark.api.client.wfbase.BaseException;
import org.enhydra.shark.api.client.wfservice.ConnectFailed;

import vkc.workflow.service.manager.PackageManager;
import vkc.workflow.service.manager.ProcessManager;
import vkc.workflow.service.manager.RepositoryManager;
import vkc.workflow.service.manager.UserMappingManager;
import vkc.workflow.service.manager.WorklistManager;



/**
 * This interface defines a VKC workflow service.
 * 
 * @author Andreas Koop
 */
public interface VKCWorkflowService {
    
    public static final boolean debug = false;
    
    /**
     * Connect with the given username
     * and password to the workflow engine and
     * return a WfMConnection object.
     * 
     * @param username the username
     * @param pwd the password
     * @return workflow connection
     * @throws BaseException
     * @throws ConnectFailed
     */
    public WfMConnection connect(String username, String pwd) 
		throws BaseException, ConnectFailed;

    /**
     * Return the appropriate package manager
     * @return the package manager
     */
    public PackageManager getPackageManager();
    
    /**
     * Return the appropriate repository manager
     * @return the repository manager
     */
    public RepositoryManager getRepositoryManager();
    
    /**
     * Return the appropriate usermapping manager
     * @return the mapping manager
     */
    public UserMappingManager getUserMappingManager();
    
    /**
     * Return the appropriate worklist manager
     * @return the worklist manager
     */
    public WorklistManager getWorklistManager();
    
    /**
     * Return the appropriate process manager
     * @return the process manager
     */
    public ProcessManager getProcessManager();

    /**
     * Write the process graph (with active activities highlighted)
     * to the given outputstream (used from within a servlet).
     * 
     * @param userName the username to connect the workflow engine
     * @param pwd the password
     * @param procId process id
     * @param out the outputstream to write the JPG stream to
     * @throws BaseException
     */
    public void writeProcessGraph( String userName, String pwd, String procId, OutputStream out )
    	throws BaseException;
    
    /**
     * Write the process graph (with active activities highlighted)
     * to the given outputstream (used from within a servlet).
     * 
     * @param userName the username to connect the workflow engine
     * @param pwd the password
     * @param pkgId the package id
     * @param procDefId process definition id
     * @param out the outputstream to write the JPG stream to
     * @throws BaseException
     */
    public void writeProcessDefGraph( String userName, String pwd, String pkgId,String procDefId, OutputStream out )
		throws BaseException;
}