/*
 * $Id: WorklistManager.java,v 1.3 2004/10/08 14:01:26 koppy Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 * 
 * Created on 13.07.2004
 *
 * $Log: WorklistManager.java,v $
 * Revision 1.3  2004/10/08 14:01:26  koppy
 * bugfixes
 *
 * 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 java.util.Locale;
import java.util.Map;

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

import vkc.workflow.WorkflowException;
import vkc.workflow.service.WfMConnection;

/**
 * This interface defines methods
 * for the worklist handling.
 * 
 * @author Andreas Koop
 */
public interface WorklistManager {

    /**
     * Completes the activity with the given id.
     * 
     * @param conn workflow connection
     * @param activityId activity instance id
     * @throws BaseException
     */
    public void completeActivity(WfMConnection conn, String activityId)
            throws BaseException;

    /**
     * Accepts the activity with the given id.
     * 
     * @param conn workflow connection associated with some VKC user.
     * @param activityId activity instance id
     * @throws WorkflowException
     */
    public void acceptActivity(WfMConnection conn, String activityId)
            throws WorkflowException;

    /**
     * Updates the variables of some activity context.
     * 
     * @param conn workflow connection
     * @param activityId the activity id
     * @param vars map of new variable values (key:variable id, value: new value)
     * @throws WorkflowException
     */
    public void updateVariables(WfMConnection conn, String activityId, Map vars )
    	throws BaseException;
    
    /**
     * Return list (elements of type WorkItemInfo)
     * of accepted workitems.
     * 
     * @param sConn workflow connection associated with some VKC user.
     * @return list of accepted workitems
     * @throws BaseException
     */
    public List getAcceptedWorkItems(WfMConnection sConn) throws BaseException;

   
    /**
     * Return list (elements of type WorkItemInfo)
     * of OPEN workitems.
     * 
     * @param sConn workflow connection associated with some VKC user.
     * @return list of OPEN workitems
     * @throws BaseException
     */
    public List getOpenWorkItems(WfMConnection sConn) throws BaseException;
    
    /**
     * Returns a list (of type VariableInfo)
     * associated with some activity.
     * 
     * @param sConn workflow connection
     * @param locale locale object for localisation
     * @param activityId activity id
     * @return list (elements of type VariableInfo)
     * @throws BaseException
     */
    public List getContextVariables(WfMConnection sConn, Locale locale, String activityId)
    	throws WorkflowException;

    /**
     * Reassign a workitem to another VKC user.
     * 
     * @param conn workflow connection
     * @param activityId activity id
     * @param newAssigneeName name of the new assignee.
     */
    public void reassign(WfMConnection conn, String activityId, String newAssigneeName)
    	throws WorkflowException;
}