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 org.imixs.workflow.exceptions.ModelException;
31
32 /**
33 * A Model defines the instructions for processing a workitem. The Model is used
34 * by the <code>WorkflowKernel</code> to manage the process flow of a workitem
35 * in the workflow.
36 *
37 * A Model is defined by collections of ProcessEntities which defines a state
38 * for a worktiem inside the model and ActivityEntities which defines the
39 * transition from one state to another.
40 *
41 * The Model interface defines finder functions to get processEntities and
42 * activityEntities. A processEntity contains informations about the
43 * Processinstance inside the workflowmodel e.g. the name or the
44 * statusdescription. On the other point of view a activityentity contains
45 * informations about the processcontroling and processhandling. A ProcessEntity
46 * is defined by its processid. A ActivityEntity defined by its activityid and
47 * unambiguously assigned to a ProcessEntity by its processid. The
48 * Workflowkernel determines by analyzing the workitem the appendant
49 * activityentity and transfers it along with the workitem to the registerd
50 * plugin moduls. After processing the workitem the workflowkernel is able to
51 * analyze the new status of the workitem by the informations stored inside the
52 * appendant processentity. With a Model the Workflowkernel is able to controle
53 * the expiration of a workflowprocess. A Model is always instantiated by a
54 * WorkflowManager and transferd as a Interface to the Workflowkernel.
55 *
56 * @author Ralph Soika
57 * @version 1.0
58 * @see org.imixs.workflow.WorkflowManager
59 * @see org.imixs.workflow.Plugin
60 */
61 public interface Model {
62
63 /**
64 * Finds and returns the ProcessEntity for a processid inside the Model.
65 *
66 * @param processid
67 * @return ItemCollection
68 * @throws Exception
69 */
70 public ItemCollection getProcessEntity(int processid) throws ModelException;
71
72 /**
73 * Finds and returns the ActivityEntity for a processid and a activityid
74 * inside the Model.
75 *
76 * @param processid
77 * @param activityid
78 * @return ItemCollection
79 * @throws Exception
80 */
81 public ItemCollection getActivityEntity(int processid, int activityid)
82 throws ModelException;
83
84 /**
85 * retruns a collection of ProcessEntities
86 *
87 * @return Collection org.imixs.workflow.ItemCollection
88 * @throws Exception
89 */
90 public java.util.Collection<ItemCollection> getProcessEntityList()
91 throws ModelException;
92
93 /**
94 * retruns a collection of ActivityEntities for a specivic ProcessID. If the
95 * process ID did not exists an empty collection should be returned
96 *
97 * @return Collection org.imixs.workflow.ItemCollection
98 * @throws Exception
99 */
100 public java.util.Collection<ItemCollection> getActivityEntityList(
101 int processid) throws ModelException;
102
103 }