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 org.imixs.workflow.exceptions.PluginException;
31  
32  
33  /** 
34   * A Plugin defines the interface between the WorkflowKernel and the underlying softwaresystem in which the plugin runns.
35   * Every Plugin have to be registerd to the workflowkernel by the workflowmanager. In this way the WorkflowManager can control
36   * the functionallity of a single workflowactivity by defining the used plugin-moduls.
37   * 
38   * @author Ralph Soika
39   * @version 1.0 
40   * @see    org.imixs.workflow.WorkflowKernel 
41   */ 
42  
43  
44  public interface Plugin {
45  	
46  	public final int PLUGIN_ERROR = 2;
47  	public final int PLUGIN_WARNING = 1;
48  	public final int PLUGIN_OK = 0;
49  
50  	
51  	/**
52  	 * The init Methode is usesd to initialize the plugin.
53  	 * 
54  	 * @param actx defines the context in which the plugin runs
55  	 * a Plugin can use this context to get information about the enviroment
56  	 *
57  	 */
58  	public void init(WorkflowContext actx) throws PluginException;
59  
60  	/**
61  	 * @param documentContext defines the document to be processed
62  	 * @param documentActivity defines the activity document which contains the workflowprocessing instructions
63  	 * @return the current status for this plugin
64  	 */
65  	public int run(ItemCollection documentContext, ItemCollection documentActivity) throws PluginException;
66  
67  
68  	/**
69  	 * This CallBack method is used to give the plugin the chance to close plugin specific data
70  	 * @param status gives the plugin information about the current status. this parameter is delivered by the workflowKernel.  
71  	 */
72  	public void close(int status) throws PluginException;
73  }