KickJava   Java API By Example, From Geeks To Geeks.

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


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.io.Serializable JavaDoc;
8
9 /**
10  OMG definition: WfRequester is the interface that has a direct concern with the execution and results
11  of a workflow process - it represents the request for some work to be done. Its
12  performer, a WfProcess, is expected to handle its request and communicate significant
13  status changes; in particular to inform the requester when it has completed performing
14  the requested work. A single requester can have many processes associated with it.
15  <p>Often WfRequester will also be the interface to the object that starts the process. As a
16  process starter some of the control actions on the process include setting up the
17  context, starting the process, and getting results and status.
18  There are two usage scenarios for the association of a WfProcess with a WfRequester:
19  <p>1. Nesting of workflow processes - a WfActivity can be refined into a WfRequester
20  and may therefore request that a WfProcess be its performer (i.e., implementation).
21  In this case, the WfActivity would be registered as the requester with the
22  implementing sub-process when the WfProcess is created and would receive
23  notifications of status changes of that sub-process; upon completion of the subprocess,
24  the WfActivity would enter completed state.
25  <p>2. Linking a workflow process to another (initiating or controlling) application. When
26  used as a linked process the requester should be a WfRequester, which is not the
27  linking WfActivity. Requesters that are not activities are roles or adapters for
28  external clients.
29  <p>We extended OMG's interface by duplicating methods, and adding additional
30  parameter that represents transaction. If you use methods without SharkTransaction
31  parameter, the transaction will be implicitly created, and if you use it with
32  SharkTransaction parameter you must obey to some rules explained in HowTo documentation.
33  <p> Also, we require that WfRequester implement Serializable interface.
34  */

35 public interface WfRequester extends BaseBusinessObject, Serializable JavaDoc {
36
37    /**
38     Zero or more WfProcesses can be associated with a WfRequester. A requester is
39     associated with a WfProcess when the process is created.
40     <p>The following operation provide the information about the number of
41     WfProcess items currently associated with a WfRequester.
42     */

43    int how_many_performer () throws BaseException;
44    /**
45     Zero or more WfProcesses can be associated with a WfRequester. A requester is
46     associated with a WfProcess when the process is created.
47     <p>The following operation provide the information about the number of
48     WfProcess items currently associated with a WfRequester.
49     */

50    int how_many_performer (SharkTransaction t) throws BaseException;
51
52    /**
53     Zero or more WfProcesses can be associated with a WfRequester. A requester is
54     associated with a WfProcess when the process is created.
55     <p>The following operation returns iterator for qurying associated processes
56     based on some criteria.
57     */

58    WfProcessIterator get_iterator_performer () throws BaseException;
59
60    /**
61     Zero or more WfProcesses can be associated with a WfRequester. A requester is
62     associated with a WfProcess when the process is created.
63     <p>The following operation returns iterator for qurying associated processes
64     based on some criteria.
65     */

66    WfProcessIterator get_iterator_performer (SharkTransaction t) throws BaseException;
67
68    /**
69     Zero or more WfProcesses can be associated with a WfRequester. A requester is
70     associated with a WfProcess when the process is created.
71     <p>The following operation returns max_number of WfProcess objects associated
72     with an WfRequester. If max_number is less or eaqual to zero, or it is greater
73     than the number of existing processes, all associated WfProcess objects will
74     be returned.
75     */

76    WfProcess[] get_sequence_performer (int max_number) throws BaseException;
77
78    /**
79     Zero or more WfProcesses can be associated with a WfRequester. A requester is
80     associated with a WfProcess when the process is created.
81     <p>The following operation returns max_number of WfProcess objects associated
82     with an WfRequester. If max_number is less or eaqual to zero, or it is greater
83     than the number of existing processes, all associated WfProcess objects will
84     be returned.
85     */

86    WfProcess[] get_sequence_performer (SharkTransaction t,int max_number) throws BaseException;
87
88    /**
89     Zero or more WfProcesses can be associated with a WfRequester. A requester is
90     associated with a WfProcess when the process is created.
91     <p>The following operation returns true if given process is associated with WfRequester.
92     */

93    boolean is_member_of_performer (WfProcess member) throws BaseException;
94
95    /**
96     Zero or more WfProcesses can be associated with a WfRequester. A requester is
97     associated with a WfProcess when the process is created.
98     <p>The following operation returns true if given process is associated with WfRequester.
99     */

100    boolean is_member_of_performer (SharkTransaction t,WfProcess member) throws BaseException;
101
102    /**
103     The following operation is used by WfProcess to notify its requester of workflow
104     events. In particular the WfProcess must notify the requester of complete, terminate, or
105     abort events or the transition to a closed state.
106     <p>The workflow event contains the source of the event; an InvalidPerformer exception
107     is raised if the source of the event is not a performer associated with the WfRequester.
108     */

109    void receive_event (WfEventAudit event) throws BaseException, InvalidPerformer;
110
111    /**
112     The following operation is used by WfProcess to notify its requester of workflow
113     events. In particular the WfProcess must notify the requester of complete, terminate, or
114     abort events or the transition to a closed state.
115     <p>The workflow event contains the source of the event; an InvalidPerformer exception
116     is raised if the source of the event is not a performer associated with the WfRequester.
117     */

118    void receive_event (SharkTransaction t,WfEventAudit event) throws BaseException, InvalidPerformer;
119 } // interface WfRequester
120
Popular Tags