01: package org.enhydra.shark.api.client.wfmodel;
02:
03: import java.io.Serializable;
04:
05: import org.enhydra.shark.api.client.wfbase.BaseBusinessObject;
06:
07: /**
08: * OMG definition: WfRequester is the interface that has a direct concern with the
09: * execution and results of a workflow process - it represents the request for some work
10: * to be done. Its performer, a WfProcess, is expected to handle its request and
11: * communicate significant status changes; in particular to inform the requester when it
12: * has completed performing the requested work. A single requester can have many processes
13: * associated with it.
14: * <p>
15: * Often WfRequester will also be the interface to the object that starts the process. As
16: * a process starter some of the control actions on the process include setting up the
17: * context, starting the process, and getting results and status. There are two usage
18: * scenarios for the association of a WfProcess with a WfRequester:
19: * <p>
20: * 1. Nesting of workflow processes - a WfActivity can be refined into a WfRequester and
21: * may therefore request that a WfProcess be its performer (i.e., implementation). In this
22: * case, the WfActivity would be registered as the requester with the implementing
23: * sub-process when the WfProcess is created and would receive notifications of status
24: * changes of that sub-process; upon completion of the subprocess, the WfActivity would
25: * enter completed state.
26: * <p>
27: * 2. Linking a workflow process to another (initiating or controlling) application. When
28: * used as a linked process the requester should be a WfRequester, which is not the
29: * linking WfActivity. Requesters that are not activities are roles or adapters for
30: * external clients.
31: * <p>
32: * We extended OMG's interface by duplicating methods, and adding additional parameter
33: * that represents transaction. If you use methods without SharkTransaction parameter, the
34: * transaction will be implicitly created, and if you use it with SharkTransaction
35: * parameter you must obey to some rules explained in HowTo documentation.
36: * <p>
37: * Also, we require that WfRequester implement Serializable interface.
38: */
39: public interface WfRequester extends BaseBusinessObject, Serializable {
40:
41: /**
42: * Zero or more WfProcesses can be associated with a WfRequester. A requester is
43: * associated with a WfProcess when the process is created.
44: * <p>
45: * The following operation provide the information about the number of WfProcess items
46: * currently associated with a WfRequester.
47: */
48: int how_many_performer() throws Exception;
49:
50: /**
51: * Zero or more WfProcesses can be associated with a WfRequester. A requester is
52: * associated with a WfProcess when the process is created.
53: * <p>
54: * The following operation returns iterator for qurying associated processes based on
55: * some criteria.
56: */
57: WfProcessIterator get_iterator_performer() throws Exception;
58:
59: /**
60: * Zero or more WfProcesses can be associated with a WfRequester. A requester is
61: * associated with a WfProcess when the process is created.
62: * <p>
63: * The following operation returns max_number of WfProcess objects associated with an
64: * WfRequester. If max_number is less or eaqual to zero, or it is greater than the
65: * number of existing processes, all associated WfProcess objects will be returned.
66: */
67: WfProcess[] get_sequence_performer(int max_number) throws Exception;
68:
69: /**
70: * Zero or more WfProcesses can be associated with a WfRequester. A requester is
71: * associated with a WfProcess when the process is created.
72: * <p>
73: * The following operation returns true if given process is associated with
74: * WfRequester.
75: */
76: boolean is_member_of_performer(WfProcess member) throws Exception;
77:
78: /**
79: * The following operation is used by WfProcess to notify its requester of workflow
80: * events. In particular the WfProcess must notify the requester of complete,
81: * terminate, or abort events or the transition to a closed state.
82: * <p>
83: * The workflow event contains the source of the event; an InvalidPerformer exception
84: * is raised if the source of the event is not a performer associated with the
85: * WfRequester.
86: */
87: void receive_event(WfEventAudit event) throws Exception,
88: InvalidPerformer;
89:
90: } // interface WfRequester
|