001: package org.enhydra.shark.api.client.wfmodel;
002:
003: import java.util.Map;
004:
005: import org.enhydra.shark.api.client.wfbase.BaseBusinessObject;
006:
007: /**
008: * OMG definition: A WfProcessMgr represents a template for a specific workflow process;
009: * it is used to create instances of a workflow process. Logically it is the factory and
010: * locator for WfProcess instances. It provides access to the meta information about the
011: * context a process requires and the result a process produces. A process manager is
012: * identified by its name which is unique within a given business domain. It could
013: * located, for example, via name using the OMG Naming Service, via name and other
014: * attributes (e.g., category) via the OMG Trader Service, or other infrastructure
015: * mechanisms.
016: * <p>
017: * We extended OMG's interface by duplicating methods, and adding additional parameter
018: * that represents transaction. If you use methods without SharkTransaction parameter, the
019: * transaction will be implicitly created, and if you use it with SharkTransaction
020: * parameter you must obey to some rules explained in HowTo documentation.
021: */
022: public interface WfProcessMgr extends BaseBusinessObject {// , PersistenceInterface
023:
024: /**
025: * Zero or more WfProcesses are associated with the WfProcessMgr that was used to
026: * create them. The association is established when a WfProcess is created.
027: * <p>
028: * The following operation provide the information about the number of WfProcess items
029: * associated with a WfProcessMgr.
030: */
031: int how_many_process() throws Exception;
032:
033: /**
034: * Zero or more WfProcesses are associated with the WfProcessMgr that was used to
035: * create them. The association is established when a WfProcess is created.
036: * <p>
037: * The following operation returns iterator for qurying associated processes based on
038: * some criteria.
039: */
040: WfProcessIterator get_iterator_process() throws Exception;
041:
042: /**
043: * Zero or more WfProcesses are associated with the WfProcessMgr that was used to
044: * create them. The association is established when a WfProcess is created.
045: * <p>
046: * The following operation returns max_number of WfProcess objects associated with an
047: * WfProcessMgr. If max_number is less or eaqual to zero, or it is greater than the
048: * number of existing processes, all associated WfProcess objects will be returned.
049: */
050: WfProcess[] get_sequence_process(int max_number) throws Exception;
051:
052: /**
053: * Zero or more WfProcesses are associated with the WfProcessMgr that was used to
054: * create them. The association is established when a WfProcess is created.
055: * <p>
056: * The following operation returns true if given process is associated with
057: * WfProcessMgr.
058: */
059: boolean is_member_of_process(WfProcess member) throws Exception;
060:
061: /**
062: * A WfProcessMgr can be enabled or disabled. This method returns its current state.
063: */
064: process_mgr_stateType process_mgr_state() throws Exception;
065:
066: /**
067: * A WfProcessMgr can be enabled or disabled. This method sets its state.
068: */
069: void set_process_mgr_state(process_mgr_stateType new_state)
070: throws Exception, TransitionNotAllowed;
071:
072: /**
073: * Returns the name of the process manager. The name uniquely identifies the process
074: * manager in a business domain. It is set when the process manager is initialized and
075: * cannot be modified.
076: */
077: String name() throws Exception;
078:
079: /**
080: * Returns description of the process manager. It is set when the process manager is
081: * initialized and cannot be modified.
082: */
083: String description() throws Exception;
084:
085: /**
086: * The category of a process manager is used for classification of process types. It is
087: * set when the process manager is initialized and cannot be modified.
088: */
089: String category() throws Exception;
090:
091: /**
092: * The version attribute of a process manager is used to distinguish between different
093: * versions of a process model. Note that this is a means to distinguish between
094: * different process managers that have the same name; it is left to the implementation
095: * to define the format of the version attribute. It is set when the process manager is
096: * initialized and cannot be modified.
097: */
098: String version() throws Exception;
099:
100: /**
101: * Meta information that defines how to set the context of an instance of this
102: * interface is returned by this operation.
103: * <p>
104: * The Map entry identifies the name and the data type (represented by its string name)
105: * of the data item. Map contains an entry for each data item in the set of context.
106: */
107: Map context_signature() throws Exception;
108:
109: /**
110: * Meta information that defines how to return the result of an instance of this
111: * interface is returned by this operation.
112: * <p>
113: * The Map entry identifies the name and the data type (represented by its string name)
114: * of the data item. Map contains an entry for each data item in the set of result data
115: * for the WfProcess.
116: */
117: Map result_signature() throws Exception;
118:
119: /**
120: * This operation is used to create instances of a process model and link its
121: * requester. When the process is created it enters state not_running.not_started.
122: * <p>
123: * It is up to the implementation of the WfM Facility to decide which WfRequester
124: * objects to accept or not. When a WfRequester is rejected, the invoking application
125: * might decide not to register a WfRequester with the WfProcess.
126: *
127: * @param requester a WfRequester
128: * @return a WfProcess
129: * @throws Exception
130: * @throws NotEnabled raised when the process manager is disabled.
131: * @throws InvalidRequester raised when a WfRequester is being identified that cannot
132: * be a 'parent' of instances of the process model.
133: * @throws RequesterRequired raised when the process definition requires a WfRequester
134: * and an invalid WfRequester is supplied in the parameter.
135: */
136: WfProcess create_process(WfRequester requester) throws Exception,
137: NotEnabled, InvalidRequester, RequesterRequired;
138:
139: } // interface WfProcessMgr
|