org.enhydra.shark.api.client.wfmodel
Interface WfRequester

All Superinterfaces:
BaseBusinessObject, java.io.Serializable
All Known Subinterfaces:
WfActivity

public interface WfRequester
extends BaseBusinessObject, java.io.Serializable

OMG definition: WfRequester is the interface that has a direct concern with the execution and results of a workflow process - it represents the request for some work to be done. Its performer, a WfProcess, is expected to handle its request and communicate significant status changes; in particular to inform the requester when it has completed performing the requested work. A single requester can have many processes associated with it.

Often WfRequester will also be the interface to the object that starts the process. As a process starter some of the control actions on the process include setting up the context, starting the process, and getting results and status. There are two usage scenarios for the association of a WfProcess with a WfRequester:

1. Nesting of workflow processes - a WfActivity can be refined into a WfRequester and may therefore request that a WfProcess be its performer (i.e., implementation). In this case, the WfActivity would be registered as the requester with the implementing sub-process when the WfProcess is created and would receive notifications of status changes of that sub-process; upon completion of the subprocess, the WfActivity would enter completed state.

2. Linking a workflow process to another (initiating or controlling) application. When used as a linked process the requester should be a WfRequester, which is not the linking WfActivity. Requesters that are not activities are roles or adapters for external clients.

We extended OMG's interface by duplicating methods, and adding additional parameter that represents transaction. If you use methods without SharkTransaction parameter, the transaction will be implicitly created, and if you use it with SharkTransaction parameter you must obey to some rules explained in HowTo documentation.

Also, we require that WfRequester implement Serializable interface.


Method Summary
 WfProcessIterator get_iterator_performer()
          Zero or more WfProcesses can be associated with a WfRequester.
 WfProcess[] get_sequence_performer(int max_number)
          Zero or more WfProcesses can be associated with a WfRequester.
 int how_many_performer()
          Zero or more WfProcesses can be associated with a WfRequester.
 boolean is_member_of_performer(WfProcess member)
          Zero or more WfProcesses can be associated with a WfRequester.
 void receive_event(WfEventAudit event)
          The following operation is used by WfProcess to notify its requester of workflow events.
 

Method Detail

how_many_performer

int how_many_performer()
                       throws java.lang.Exception
Zero or more WfProcesses can be associated with a WfRequester. A requester is associated with a WfProcess when the process is created.

The following operation provide the information about the number of WfProcess items currently associated with a WfRequester.

Throws:
java.lang.Exception

get_iterator_performer

WfProcessIterator get_iterator_performer()
                                         throws java.lang.Exception
Zero or more WfProcesses can be associated with a WfRequester. A requester is associated with a WfProcess when the process is created.

The following operation returns iterator for qurying associated processes based on some criteria.

Throws:
java.lang.Exception

get_sequence_performer

WfProcess[] get_sequence_performer(int max_number)
                                   throws java.lang.Exception
Zero or more WfProcesses can be associated with a WfRequester. A requester is associated with a WfProcess when the process is created.

The following operation returns max_number of WfProcess objects associated with an WfRequester. If max_number is less or eaqual to zero, or it is greater than the number of existing processes, all associated WfProcess objects will be returned.

Throws:
java.lang.Exception

is_member_of_performer

boolean is_member_of_performer(WfProcess member)
                               throws java.lang.Exception
Zero or more WfProcesses can be associated with a WfRequester. A requester is associated with a WfProcess when the process is created.

The following operation returns true if given process is associated with WfRequester.

Throws:
java.lang.Exception

receive_event

void receive_event(WfEventAudit event)
                   throws java.lang.Exception,
                          InvalidPerformer
The following operation is used by WfProcess to notify its requester of workflow events. In particular the WfProcess must notify the requester of complete, terminate, or abort events or the transition to a closed state.

The workflow event contains the source of the event; an InvalidPerformer exception is raised if the source of the event is not a performer associated with the WfRequester.

Throws:
java.lang.Exception
InvalidPerformer