KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > ejb > WorkflowEJB


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.workflow.ejb;
6
7 import com.opensymphony.workflow.*;
8
9 import java.util.Map JavaDoc;
10
11 import javax.ejb.*;
12
13
14 /**
15  * @ejb.bean
16  * type="Stateless"
17  * name="Workflow"
18  * view-type="remote"
19  * transaction-type="Container"
20  *
21  * @ejb.ejb-ref
22  * ejb-name="HistoryStepPrev"
23  * view-type="local"
24  *
25  * @ejb.ejb-ref
26  * ejb-name="CurrentStepPrev"
27  * view-type="local"
28  *
29  * @ejb.ejb-ref
30  * ejb-name="CurrentStep"
31  * view-type="local"
32  *
33  * @ejb.ejb-ref
34  * ejb-name="HistoryStep"
35  * view-type="local"
36  *
37  * @ejb.permission unchecked="true"
38  * @ejb.transaction type="Supports"
39  *
40  * @author <a HREF="mailto:plightbo@hotmail.com">Pat Lightbody</a>
41  * @author <a HREF="mailto:hani@formicary.net">Hani Suleiman</a>
42  * @version $Revision: 1.5 $
43  */

44 public abstract class WorkflowEJB extends AbstractWorkflow implements SessionBean {
45     //~ Methods ////////////////////////////////////////////////////////////////
46

47     public void setSessionContext(SessionContext context) {
48         WorkflowContext workflowContext = (WorkflowContext) loadObject(getPersistenceProperties().getProperty("workflowContext", "com.opensymphony.workflow.ejb.EJBWorkflowContext"));
49
50         if (workflowContext instanceof EJBWorkflowContext) {
51             ((EJBWorkflowContext) workflowContext).setSessionContext(context);
52         }
53
54         super.context = workflowContext;
55     }
56
57     /**
58      * @ejb.interface-method
59      * @ejb.transaction type="Required"
60      */

61     public void changeEntryState(long id, int newState) throws WorkflowException {
62         super.changeEntryState(id, newState);
63     }
64
65     /**
66      * @ejb.interface-method
67      * @ejb.transaction type="Required"
68      */

69     public void doAction(long id, int actionId, Map JavaDoc inputs) throws WorkflowException {
70         super.doAction(id, actionId, inputs);
71     }
72
73     public void ejbCreate() {
74     }
75
76     public void ejbPostCreate() throws CreateException {
77     }
78
79     /**
80      * @ejb.interface-method
81      * @ejb.transaction type="Required"
82      */

83     public void executeTriggerFunction(long id, int triggerId) throws WorkflowException {
84         super.executeTriggerFunction(id, triggerId);
85     }
86
87     /**
88      * @ejb.interface-method
89      * @ejb.transaction type="Required"
90      */

91     public long initialize(String JavaDoc workflowName, int initialAction, Map JavaDoc inputs) throws InvalidRoleException, InvalidInputException, StoreException, WorkflowException {
92         return super.initialize(workflowName, initialAction, inputs);
93     }
94 }
95
Popular Tags