View Javadoc

1   /*******************************************************************************
2    *  Imixs Workflow 
3    *  Copyright (C) 2001, 2011 Imixs Software Solutions GmbH,  
4    *  http://www.imixs.com
5    *  
6    *  This program is free software; you can redistribute it and/or 
7    *  modify it under the terms of the GNU General Public License 
8    *  as published by the Free Software Foundation; either version 2 
9    *  of the License, or (at your option) any later version.
10   *  
11   *  This program is distributed in the hope that it will be useful, 
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
14   *  General Public License for more details.
15   *  
16   *  You can receive a copy of the GNU General Public
17   *  License at http://www.gnu.org/licenses/gpl.html
18   *  
19   *  Project: 
20   *  	http://www.imixs.org
21   *  	http://java.net/projects/imixs-workflow
22   *  
23   *  Contributors:  
24   *  	Imixs Software Solutions GmbH - initial API and implementation
25   *  	Ralph Soika - Software Developer
26   *******************************************************************************/
27  
28  package org.imixs.workflow;
29  
30  import java.util.Collection;
31  
32  import org.imixs.workflow.exceptions.AccessDeniedException;
33  import org.imixs.workflow.exceptions.ProcessingErrorException;
34  
35  /**
36   * The WorkflowManager is the general interface for a concrete implementation of
37   * a workflow management system. The Interface defines the basic methods for
38   * processing and encountering a workitem. The Workflowmanger instantiate a
39   * WorkflowKernel, an supports the platform dependet enviroment for concrete
40   * Workitems and Workfmodels.
41   * 
42   * @author Ralph Soika
43   * @version 1.0
44   * @see org.imixs.workflow.WorkflowKernel
45   */
46  
47  public interface WorkflowManager {
48  
49  	/**
50  	 * This Method process a Workitem. The workitem provided by the method
51  	 * caller needs at least containing the valid attributes $ProcessID and
52  	 * $ActivityID (integer) to identify the current processEntity the worktiem
53  	 * belongs to and the concrete activtyEntity which should be processed by
54  	 * the wokflowManager implementation. If the workitem is new the method
55  	 * should create a new instance.
56  	 * 
57  	 * The method is responsible to persist the worktiem after successfull
58  	 * processing. The method returns the workitem with additional workflow
59  	 * informations defined by the workfowManager Implementation.
60  	 * 
61  	 * The Method throws an InvalidWorkitemException if the provided Workitem is
62  	 * invalid or the provided attributes $ProcessID and $ActivityID (integer)
63  	 * did not match an valid modelEntity the workitem can be processed to.
64  	 * 
65  	 * @param workitem
66  	 *            a workitem instance which should be processed
67  	 * @return the Workitem instance after successful processing
68  	 * @throws ProcessingErrorException
69  	 */
70  	public ItemCollection processWorkItem(ItemCollection workitem)
71  			throws AccessDeniedException,ProcessingErrorException;
72  
73  	/**
74  	 * The method removes the provide Workitem form the persistence unit managed
75  	 * by the WorkflowManager implementation.
76  	 * 
77  	 * The Method throws an InvalidWorkitemException if the provided Workitem is
78  	 * invalid.
79  	 * 
80  	 * @param uniqueid
81  	 *            of the WorkItem to be removed
82  	 * @throws AccessDeniedException
83  	 */
84  	public void removeWorkItem(ItemCollection workitem)
85  			throws AccessDeniedException;
86  
87  	/**
88  	 * Finds a Workitem by a defined uniuqeID ($uniqueID)
89  	 * 
90  	 * @param uniqueid
91  	 * @return WorkItem
92  	 * 
93  	 */
94  	public ItemCollection getWorkItem(String uniqueid);
95  
96  	/**
97  	 * The method returns all workitems assigned to a specified username or role
98  	 * 
99  	 * @param name
100 	 *            of user or group
101 	 * @return List of workitems
102      *
103 	 */
104 	public Collection<ItemCollection> getWorkList(String name);
105 
106 	/**
107 	 * This method returns all workitems assigned to another workitem by the
108 	 * Attribute $uniqueidRef. A Worktitem which holds a reference to another
109 	 * workitem is a called subprocess or childprocess to the process it
110 	 * references to. This process which is referenced is called a
111 	 * parentProcess. By defining references process instances can be structured
112 	 * in hierarchy.
113 	 * 
114 	 * @param aref
115 	 *            A unique reference to another workitem inside a database
116 	 * @return List of workitems
117 	 * 
118 	 */
119 	public Collection<ItemCollection> getWorkListByRef(String aref);
120 
121 }