KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > api > client > wfmodel > WfProcess


1 package org.enhydra.shark.api.client.wfmodel;
2
3
4 import org.enhydra.shark.api.client.wfbase.*;
5 import org.enhydra.shark.api.SharkTransaction;
6
7 import java.util.*;
8
9 /**
10  OMG definition: A WfProcess is the performer of a workflow request. All workflow objects that
11  perform work implement this interface. This interface allows work to proceed
12  asynchronously while being monitored and controlled.
13  The WfProcess interface specializes WfExecutionObject interface by adding an
14  operation to start the execution of the process, an operation to obtain the result
15  produced by the process and relationships with WfRequester and WfActivity.
16  <p>We extended OMG's interface by duplicating methods, and adding additional
17  parameter that represents transaction. If you use methods without SharkTransaction
18  parameter, the transaction will be implicitly created, and if you use it with
19  SharkTransaction parameter you must obey to some rules explained in HowTo documentation.
20  */

21 public interface WfProcess extends WfExecutionObject {
22    /**
23     A WfProcess is created (using a WfProcessMgr) by a user or automated resource and
24     associated with a WfRequester. The WfRequester may be a WfActivity or an adapter for
25     external clients. WfProcess always has one WfRequester; an implementation of the
26     WfM Facility may allow for re-assignment of the WfRequester associated with a
27     WfProcess.
28     <p>A WfProcess will inform its WfRequester about status changes such as modification of
29     its state and its context using the requesters receive_event operation.
30     <p>The following operation returns the requester.
31     */

32    WfRequester requester () throws BaseException;
33
34    /**
35     A WfProcess is created (using a WfProcessMgr) by a user or automated resource and
36     associated with a WfRequester. The WfRequester may be a WfActivity or an adapter for
37     external clients. WfProcess always has one WfRequester; an implementation of the
38     WfM Facility may allow for re-assignment of the WfRequester associated with a
39     WfProcess.
40     <p>A WfProcess will inform its WfRequester about status changes such as modification of
41     its state and its context using the requesters receive_event operation.
42     <p>The following operation returns the requester.
43     */

44    WfRequester requester (SharkTransaction t) throws BaseException;
45
46    /**
47     A WfProcess is created (using a WfProcessMgr) by a user or automated resource and
48     associated with a WfRequester. The WfRequester may be a WfActivity or an adapter for
49     external clients. WfProcess always has one WfRequester; an implementation of the
50     WfM Facility may allow for re-assignment of the WfRequester associated with a
51     WfProcess.
52     <p>A WfProcess will inform its WfRequester about status changes such as modification of
53     its state and its context using the requesters receive_event operation.
54     <p>The following operations changes the process requester.
55     */

56    void set_requester (WfRequester new_value) throws BaseException, CannotChangeRequester;
57
58    /**
59     A WfProcess is created (using a WfProcessMgr) by a user or automated resource and
60     associated with a WfRequester. The WfRequester may be a WfActivity or an adapter for
61     external clients. WfProcess always has one WfRequester; an implementation of the
62     WfM Facility may allow for re-assignment of the WfRequester associated with a
63     WfProcess.
64     <p>A WfProcess will inform its WfRequester about status changes such as modification of
65     its state and its context using the requesters receive_event operation.
66     <p>The following operations changes the process requester.
67     */

68    void set_requester (SharkTransaction t,WfRequester new_value) throws BaseException, CannotChangeRequester;
69
70    /**
71     Zero or more WfActivities are associated with a WfProcess. The association is
72     established when an activity is created as part of the enactment of the WfProcess.
73     <p>The following operation provide the information about the number of active
74     WfActivity items currently associated with a WfProcess.
75     */

76    int how_many_step () throws BaseException;
77
78    /**
79     Zero or more WfActivities are associated with a WfProcess. The association is
80     established when an activity is created as part of the enactment of the WfProcess.
81     <p>The following operation provide the information about the number of active
82     WfActivity items currently associated with a WfProcess.
83     */

84    int how_many_step (SharkTransaction t) throws BaseException;
85
86    /**
87     Zero or more WfActivities are associated with a WfProcess. The association is
88     established when an activity is created as part of the enactment of the WfProcess.
89     <p>The following operation returns iterator for qurying associated activities
90     based on some criteria.
91     */

92    WfActivityIterator get_iterator_step () throws BaseException;
93
94    /**
95     Zero or more WfActivities are associated with a WfProcess. The association is
96     established when an activity is created as part of the enactment of the WfProcess.
97     <p>The following operation returns iterator for qurying associated activities
98     based on some criteria.
99     */

100    WfActivityIterator get_iterator_step (SharkTransaction t) throws BaseException;
101
102    /**
103     Zero or more WfActivities are associated with a WfProcess. The association is
104     established when an activity is created as part of the enactment of the WfProcess.
105     <p>The following operation returns max_number of WfActivity objects associated
106     with an WfProcess (no matter in which state they are). If max_number is less
107     or eaqual to zero, or it is greater than the number of existing activities,
108     all associated WfActivity objects will be returned.
109     */

110    WfActivity[] get_sequence_step (int max_number) throws BaseException;
111
112    /**
113     Zero or more WfActivities are associated with a WfProcess. The association is
114     established when an activity is created as part of the enactment of the WfProcess.
115     <p>The following operation returns max_number of WfActivity objects associated
116     with an WfProcess (no matter in which state they are). If max_number is less
117     or eaqual to zero, or it is greater than the number of existing activities,
118     all associated WfActivity objects will be returned.
119     */

120    WfActivity[] get_sequence_step (SharkTransaction t,int max_number) throws BaseException;
121
122    /**
123     Zero or more WfActivities are associated with a WfProcess. The association is
124     established when an activity is created as part of the enactment of the WfProcess.
125     <p>The following operation returns true if given activity is associated with WfProcess.
126     */

127    boolean is_member_of_step (WfActivity member) throws BaseException;
128
129    /**
130     Zero or more WfActivities are associated with a WfProcess. The association is
131     established when an activity is created as part of the enactment of the WfProcess.
132     <p>The following operation returns true if given activity is associated with WfProcess.
133     */

134    boolean is_member_of_step (SharkTransaction t,WfActivity member) throws BaseException;
135
136    /**
137     A process is associated with one WfProcessMgr; the association is established when
138     the WfProcess is generated and cannot be modified. The following operation returns
139     the WfProcessMgr associated with the WfProcess.
140     */

141    WfProcessMgr manager () throws BaseException;
142
143    /**
144     A process is associated with one WfProcessMgr; the association is established when
145     the WfProcess is generated and cannot be modified. The following operation returns
146     the WfProcessMgr associated with the WfProcess.
147     */

148    WfProcessMgr manager (SharkTransaction t) throws BaseException;
149
150    /**
151     The result produced by the WfProcess. In general the result is undefined until the
152     process completes, but some processes may produce intermediate results.
153     A ResultNotAvailable exception is raised when the result cannot be obtained yet.
154     */

155    Map result () throws BaseException, ResultNotAvailable;
156
157    /**
158     The result produced by the WfProcess. In general the result is undefined until the
159     process completes, but some processes may produce intermediate results.
160     A ResultNotAvailable exception is raised when the result cannot be obtained yet.
161     */

162    Map result (SharkTransaction t) throws BaseException, ResultNotAvailable;
163
164    /**
165     This operation is used to initiate enactment of a WfProcess. The state of the
166     process is changed from open.not_running.not_started to open.running.
167     * @throws CannotStart raised when the process cannot be started (e.g.,
168     because it is not properly initialized).
169     * @throws AlreadyRunning raised when the process has already been started.
170     * @throws BaseException
171     */

172    void start () throws BaseException, CannotStart, AlreadyRunning;
173
174    /**
175     This operation is used to initiate enactment of a WfProcess. The state of the
176     process is changed from open.not_running.not_started to open.running.
177     * @throws CannotStart raised when the process cannot be started (e.g.,
178     because it is not properly initialized).
179     * @throws AlreadyRunning raised when the process has already been started.
180     * @throws BaseException
181     */

182    void start (SharkTransaction t) throws BaseException, CannotStart, AlreadyRunning;
183
184    /**
185     This operation is used to get an iterator over WfActivity objects that are in a certain
186     state. The state is an input parameter. In case an invalid state has been specified, the
187     exception InvalidState is raised.
188     */

189    WfActivityIterator get_activities_in_state (String JavaDoc state) throws BaseException, InvalidState;
190
191    /**
192     This operation is used to get an iterator over WfActivity objects that are in a certain
193     state. The state is an input parameter. In case an invalid state has been specified, the
194     exception InvalidState is raised.
195     */

196    WfActivityIterator get_activities_in_state (SharkTransaction t,String JavaDoc state) throws BaseException, InvalidState;
197
198 } // interface WfProcess
199
Popular Tags