KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > util > workflow > InfoGlueBasicWorkflow


1 /* ===============================================================================
2 *
3 * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4 *
5 * ===============================================================================
6 *
7 * Copyright (C)
8 *
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License version 2, as published by the
11 * Free Software Foundation. See the file LICENSE.html for more information.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19 * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20 *
21 * ===============================================================================
22 */

23
24 package org.infoglue.cms.util.workflow;
25
26 import java.util.Map JavaDoc;
27
28 import org.infoglue.deliver.util.CacheController;
29
30 import com.opensymphony.workflow.AbstractWorkflow;
31 import com.opensymphony.workflow.WorkflowException;
32 import com.opensymphony.workflow.basic.BasicWorkflow;
33 import com.opensymphony.workflow.basic.BasicWorkflowContext;
34
35
36 /**
37  * A basic workflow implementation which does not read in
38  * the current user from any context, but allows one to be
39  * specified via the constructor. Also does not support rollbacks.
40  */

41 public class InfoGlueBasicWorkflow extends BasicWorkflow
42 {
43     public InfoGlueBasicWorkflow(String JavaDoc caller)
44     {
45         super(caller);
46     }
47     
48     public void changeEntryState(long id, int newState) throws WorkflowException
49     {
50         super.changeEntryState(id, newState);
51         //System.out.println("Change state - clear cache");
52
CacheController.clearCache("myActiveWorkflows");
53     }
54
55     public void doAction(long id, int actionId, Map JavaDoc inputs) throws WorkflowException
56     {
57         super.doAction(id, actionId, inputs);
58         //System.out.println("Did action - clear cache");
59
CacheController.clearCache("myActiveWorkflows");
60     }
61
62     public long initialize(String JavaDoc workflowName, int initialState, Map JavaDoc inputs) throws WorkflowException
63     {
64         long id = super.initialize(workflowName, initialState, inputs);
65         //System.out.println("Change state - clear cache");
66
CacheController.clearCache("myActiveWorkflows");
67         return id;
68     }
69
70 }
71
Popular Tags