001: package org.enhydra.shark.api.client.wfservice;
002:
003: import org.enhydra.shark.api.client.wfmc.wapi.WMActivityInstance;
004: import org.enhydra.shark.api.client.wfmc.wapi.WMActivityInstanceIterator;
005: import org.enhydra.shark.api.client.wfmc.wapi.WMFilter;
006: import org.enhydra.shark.api.client.wfmc.wapi.WMProcessInstanceIterator;
007: import org.enhydra.shark.api.client.wfmc.wapi.WMSessionHandle;
008:
009: /**
010: * Interface used to perform some administrative operations that concern execution engine
011: * objects.
012: * <p>
013: * The first method to be called by client application is the first method of this
014: * interface - connect(), and only if user authentication is OK, other methods can be used
015: * (otherwise, every method throws NotConnected exception).
016: *
017: * @author Sasa Bojanic
018: * @author Vladimir Puskas
019: */
020: public interface ExecutionAdministration {
021:
022: /**
023: * Provides a way to jump-into the process instance, and manually start activity
024: * specified by XPDL definition.
025: *
026: * @param procId Id of process instance.
027: * @param blockActId instance Id of block activity
028: * @param actDef XPDL activity definition for the activity we want to manually start.
029: * @throws Exception If something unexpected happens.
030: */
031: void startActivity(WMSessionHandle shandle, String procId,
032: String blockActId, WMEntity actDef) throws Exception;
033:
034: /**
035: * Reevaluates assignments for the active, non-accepted activities. Which activity's
036: * assignments will be re-evaluated depends on the provided process or activity filter.
037: */
038: WMActivityInstanceIterator reevaluateAssignmentsWithFiltering(
039: WMSessionHandle shandle, WMFilter procOrActFilter,
040: boolean returnChangedOnly) throws Exception;
041:
042: /**
043: * Reevaluates assignments for all the active, non-accepted activities within the given
044: * process instances.
045: */
046: WMActivityInstanceIterator reevaluateAssignmentsForProcesses(
047: WMSessionHandle shandle, String[] procIds,
048: boolean returnChangedOnly) throws Exception;
049:
050: /**
051: * Reevaluates assignments for the active, non-accepted activities provided as a
052: * parameter.
053: */
054: WMActivityInstanceIterator reevaluateAssignmentsForActivities(
055: WMSessionHandle shandle, WMActivityInstance[] acts,
056: boolean returnChangedOnly) throws Exception;
057:
058: /**
059: * Deletes closed process instances from instance persistence repository. Which
060: * processes will be deleted depends on the filter.
061: */
062: WMProcessInstanceIterator deleteProcessesWithFiltering(
063: WMSessionHandle shandle, WMFilter procFilter)
064: throws Exception;
065:
066: /**
067: * Deletes closed process instances from instance persistence repository.
068: */
069: WMProcessInstanceIterator deleteProcesses(WMSessionHandle shandle,
070: String[] procIds) throws Exception;
071:
072: /**
073: * Provides a way to inject exception to specified activity so process definition can
074: * continue with 'Exception' transition if any.
075: */
076: void injectException(WMSessionHandle shandle, String procId,
077: String actId, Exception ex) throws Exception;
078:
079: /**
080: * Sets the specified process instance property value.
081: *
082: * @param procInstId The process instance id.
083: * @param propName The property name.
084: * @param propValue The property value.
085: * @throws Exception Workflow client exception.
086: */
087: void assignProcessInstanceProperty(WMSessionHandle shandle,
088: String procInstId, String propName, Object propValue)
089: throws Exception;
090:
091: /**
092: * Sets the value of an activity instance property.
093: *
094: * @param procInstId The process instance id.
095: * @param actInstId The activity instance id.
096: * @param propName The property name.
097: * @param propValue The property value.
098: * @throws Exception Workflow client exception.
099: */
100: void assignActivityInstanceProperty(WMSessionHandle shandle,
101: String procInstId, String actInstId, String propName,
102: Object propValue) throws Exception;
103:
104: /**
105: * Sets the value of an activity instance attribute, but only inside activity context.
106: * Corresponds to OMG's WfActiviy.set_process_context() method instead of
107: * WfActiviy.set_result() method for which we have
108: * WAPI.assignActivityInstanceAttribute().
109: *
110: * @param procInstId The process instance id.
111: * @param actInstId The activity instance id.
112: * @param attrName The attribute name.
113: * @param attrValue The attribute value.
114: * @throws Exception Workflow client exception.
115: */
116: void assignActivityInstanceAttributeForLocalContext(
117: WMSessionHandle shandle, String procInstId,
118: String actInstId, String attrName, Object attrValue)
119: throws Exception;
120:
121: // /////////////////////// CACHEADMIN
122:
123: /** Changes the size of process cache. */
124: void setProcessCacheSize(WMSessionHandle shandle, int size)
125: throws Exception;
126:
127: /** Clears process cache. */
128: void clearProcessCache(WMSessionHandle shandle) throws Exception;
129:
130: /** Changes the size of resource cache. */
131: void setResourceCacheSize(WMSessionHandle shandle, int size)
132: throws Exception;
133:
134: /** Clears resource cache. */
135: void clearResourceCache(WMSessionHandle shandle) throws Exception;
136:
137: // /////////////////////// DEADLINE
138:
139: /**
140: * Gets the process Ids of the processes where there is at least one activity which
141: * reached the deadline.
142: */
143: String[] getDeadlineRichedProcessIds(WMSessionHandle shandle)
144: throws Exception;
145:
146: /**
147: * When this operation is called, shark checks for deadlines of all active activities
148: * based on provided filter, and takes appropriate action if deadlines are exceeded.
149: */
150: WMActivityInstanceIterator checkDeadlinesWithFiltering(
151: WMSessionHandle shandle, WMFilter procOrActFilter)
152: throws Exception;
153:
154: /**
155: * When this operation is called, shark checks for deadlines of all active activities
156: * for the process instances with a given Ids, and takes appropriate action if
157: * deadlines are exceeded.
158: */
159: WMActivityInstanceIterator checkDeadlinesForProcesses(
160: WMSessionHandle shandle, String[] procIds) throws Exception;
161:
162: /**
163: * When this operation is called, shark checks for deadlines of activities specified by
164: * given parameters, and takes appropriate action if deadlines are exceeded.
165: */
166: WMActivityInstanceIterator checkDeadlinesForActivities(
167: WMSessionHandle session, WMActivityInstance[] acts)
168: throws Exception;
169:
170: // /////////////////////// LIMIT
171:
172: /**
173: * When this operation is called, shark checks for limits of all active processes, and
174: * if checkActivities parameter is 'true' it also checks for the limits of all of the
175: * activite activities for these processes, and takes appropriate action if limits are
176: * exceeded.
177: */
178: WMProcessInstanceIterator checkLimitsWithProcessFiltering(
179: WMSessionHandle sessionHandle, WMFilter procFilter,
180: boolean checkActivities) throws Exception;
181:
182: /**
183: * When this operation is called, shark checks for limits of the process specified by
184: * given parameter, and if checkActivities parameter is 'true' it also checks for the
185: * limits of all of the active activities for these processes, and takes appropriate
186: * action if limits are exceeded.
187: */
188: WMProcessInstanceIterator checkLimitsForProcesses(
189: WMSessionHandle sessionHandle, String[] procIds,
190: boolean checkActivities) throws Exception;
191:
192: /**
193: * When this operation is called, shark checks for limits of all active activities and
194: * all active processes, and takes appropriate action if limits are exceeded.
195: */
196: WMActivityInstanceIterator checkLimitsWithActivityFiltering(
197: WMSessionHandle sessionHandle, WMFilter actFilter)
198: throws Exception;
199:
200: /**
201: * When this operation is called, shark checks for limit of the activity specified by
202: * given parameters, and takes appropriate action if limit is exceeded.
203: */
204: WMActivityInstanceIterator checkLimitsForActivities(
205: WMSessionHandle sessionHandle, WMActivityInstance[] acts)
206: throws Exception;
207:
208: }
|