001: package org.enhydra.shark.api.client.wfservice;
002:
003: import org.enhydra.shark.api.client.wfmc.audit.WMAAuditEntryIterator;
004: import org.enhydra.shark.api.client.wfmc.wapi.WMActivityInstance;
005: import org.enhydra.shark.api.client.wfmc.wapi.WMAttribute;
006: import org.enhydra.shark.api.client.wfmc.wapi.WMAttributeIterator;
007: import org.enhydra.shark.api.client.wfmc.wapi.WMFilter;
008: import org.enhydra.shark.api.client.wfmc.wapi.WMSessionHandle;
009: import org.enhydra.shark.api.common.DeadlineInfo;
010:
011: /**
012: * Interface used to perform some administrative operations.
013: *
014: * @author Sasa Bojanic
015: * @author Vladimir Puskas
016: */
017: public interface AdminMisc {
018:
019: /**
020: * Returns string representing the XPDL definition Id of activity instance that has the
021: * given Id.
022: *
023: * @param procId activity's process Id.
024: * @param actId Id of activity instance.
025: * @return XPDL activity definition Id for the given activity instance.
026: * @throws Exception If something unexpected happens.
027: */
028: WMEntity getActivityDefinitionInfo(WMSessionHandle shandle,
029: String procId, String actId) throws Exception;
030:
031: /**
032: * Returns string representing the XPDL definition Id of process instance that has the
033: * given Id.
034: *
035: * @param procId Id of process instance.
036: * @return XPDL process definition Id for the given process instance.
037: * @throws Exception If something unexpected happens.
038: */
039: WMEntity getProcessDefinitionInfo(WMSessionHandle shandle,
040: String procId) throws Exception;
041:
042: /**
043: * Returns string representing the XPDL definition Id of process instance that has the
044: * given Id.
045: *
046: * @param shandle
047: * @return XPDL process definition Id for the given process instance.
048: * @throws Exception If something unexpected happens.
049: */
050: WMEntity getProcessDefinitionInfoByUniqueProcessDefinitionName(
051: WMSessionHandle shandle, String procDefUniqueName)
052: throws Exception;
053:
054: /**
055: * Returns string representing the XPDL definition Id of process instance that has the
056: * given Id.
057: *
058: * @param shandle
059: * @param procId Id of process instance.
060: * @return XPDL process definition Id for the given process instance.
061: * @throws Exception If something unexpected happens.
062: */
063: WMEntity getVariableDefinitionInfo(WMSessionHandle shandle,
064: String procId, String variableId) throws Exception;
065:
066: /**
067: * Returns string representing the XPDL definition Id of process instance that has the
068: * given Id.
069: *
070: * @param shandle
071: * @return XPDL process definition Id for the given process instance.
072: * @throws Exception If something unexpected happens.
073: */
074: WMEntity getVariableDefinitionInfoByUniqueProcessDefinitionName(
075: WMSessionHandle shandle, String procDefUniqueName,
076: String variableId) throws Exception;
077:
078: /**
079: * Returns string representing the class name of the instance of variable that can be
080: * determined by the given parameters. If there is no such variable, Exception will be
081: * thrown.
082: *
083: * @param procId Id of process instance.
084: * @param variableId Id of XPDL variable definition.
085: * @return Java class name of variable instance.
086: * @throws Exception If something unexpected happens.
087: */
088: String getVariableJavaClassName(WMSessionHandle shandle,
089: String procId, String variableId) throws Exception;
090:
091: /**
092: * Returns string representing the class name of the instance of variable that can be
093: * determined by the given parameters. If there is no such variable, Exception will be
094: * thrown.
095: *
096: * @param shandle
097: * @param variableId Id of XPDL variable definition.
098: * @return Java class name of variable instance.
099: * @throws Exception If something unexpected happens.
100: */
101: String getVariableJavaClassNameByUniqueProcessDefinitionName(
102: WMSessionHandle shandle, String procDefUniqueName,
103: String variableId) throws Exception;
104:
105: /**
106: * Returns the name of the resource that requested (created) the proces. If the process
107: * was requested by subflow activity, it returns the name of the resource that created
108: * the process that this activity is belonging to, and if this process is also created
109: * by another activity, it searches for the one created by resource.
110: *
111: * @param procId The id of the process instance.
112: * @return String representing resource name which is unique in the system.
113: * @throws Exception If something unexpected happens.
114: */
115: String getProcessRequesterUsername(WMSessionHandle shandle,
116: String procId) throws Exception;
117:
118: /**
119: * If process with given id is a subflow, it returns the subflow activity instance
120: * which instantiated this process. Otherwise, it returns null.
121: *
122: * @param procId The id of the process instance.
123: * @return WMActivityInstance representing activity that instantiated process or null
124: * if process is not subflow.
125: * @throws Exception If something unexpected happens.
126: */
127: WMActivityInstance getProcessActivityRequester(
128: WMSessionHandle shandle, String procId) throws Exception;
129:
130: /**
131: * Returns the name of the resource that accepted/completed activity. If there is no
132: * such (i.e. activity is still not accepted by any resource, or this is an "automatic"
133: * activity executed by shark itself), it returns null.
134: *
135: * @param procId activity's process Id.
136: * @param actId Id of activity instance for which we search for the resource's username
137: * @return String representing resource name which is unique in the system.
138: * @throws Exception If something unexpected happens.
139: */
140: String getActivityResourceUsername(WMSessionHandle shandle,
141: String procId, String actId) throws Exception;
142:
143: /**
144: * Returns string representing the Id of block activity instance of activity instance
145: * that has the given Id.
146: *
147: * @param procId activity's process Id.
148: * @param actId Id of activity instance that we search block activity instance Id for.
149: * @return block activity instance Id if there is one for the given activity instance,
150: * or null if given activity does not belong to the block.
151: * @throws Exception If something unexpected happens.
152: */
153: String getBlockActivityId(WMSessionHandle shandle, String procId,
154: String actId) throws Exception;
155:
156: /**
157: * Returns string representing the activity Id of activity instance that relates to the
158: * assignment determined by given parameters.
159: *
160: * @param procId assignment's process Id.
161: * @param assId Id of assignment instance.
162: * @return activity instance Id for the given assignment.
163: * @throws Exception If something unexpected happens.
164: */
165: String getAssignmentActivityId(WMSessionHandle shandle,
166: String procId, String assId) throws Exception;
167:
168: /**
169: * Returns string representing username of resource instance that relates to assignment
170: * determined by given parameters.
171: *
172: * @param procId assignment's process Id.
173: * @param assId Id of assignment instance.
174: * @return resource username for the given assignment.
175: * @throws Exception If something unexpected happens.
176: */
177: String getAssignmentResourceUsername(WMSessionHandle shandle,
178: String procId, String assId) throws Exception;
179:
180: /**
181: * /** Returns the time when process is created in number of milliseconds that have
182: * passed since January 1, 1970 00:00:00.000 GMT.
183: *
184: * @param procId Id of process instance
185: * @throws Exception If process does not exist, it is locked too long or if something
186: * unexpected happens.
187: */
188: long getProcessCreatedTime(WMSessionHandle shandle, String procId)
189: throws Exception;
190:
191: /**
192: * Returns the time when process is started in number of milliseconds that have passed
193: * since January 1, 1970 00:00:00.000 GMT. If process is not started returns
194: * Long.MAX_VALUE/2.
195: *
196: * @param procId Id of process instance
197: * @throws Exception If process does not exist, it is locked too long or if something
198: * unexpected happens.
199: */
200: long getProcessStartedTime(WMSessionHandle shandle, String procId)
201: throws Exception;
202:
203: /**
204: * Returns the time when process is finished in number of milliseconds that have passed
205: * since January 1, 1970 00:00:00.000 GMT. If process is not finished returns
206: * Long.MAX_VALUE/2.
207: *
208: * @param procId Id of process instance
209: * @throws Exception If process does not exist, it is locked too long or if something
210: * unexpected happens.
211: */
212: long getProcessFinishTime(WMSessionHandle shandle, String procId)
213: throws Exception;
214:
215: /**
216: * Returns the time when activity is created in number of milliseconds that have passed
217: * since January 1, 1970 00:00:00.000 GMT.
218: *
219: * @param procId Id of process instance
220: * @throws Exception If activity does not exist, its process is locked too long or if
221: * something unexpected happens.
222: */
223: long getActivityCreatedTime(WMSessionHandle shandle, String procId,
224: String actId) throws Exception;
225:
226: /**
227: * Returns the time when activity is last time accepted in number of milliseconds that
228: * have passed since January 1, 1970 00:00:00.000 GMT. If activity is not accepted (it
229: * is not in open.running state) returns Long.MAX_VALUE/2.
230: *
231: * @param procId Id of process instance
232: * @throws Exception If activity does not exist, its process is locked too long or if
233: * something unexpected happens.
234: */
235: long getActivityStartedTime(WMSessionHandle shandle, String procId,
236: String actId) throws Exception;
237:
238: /**
239: * Returns the time when activity is finished in number of milliseconds that have
240: * passed since January 1, 1970 00:00:00.000 GMT. If activity is not finished returns
241: * Long.MAX_VALUE/2.
242: *
243: * @param procId Id of process instance
244: * @throws Exception If activity does not exist, its process is locked too long or if
245: * something unexpected happens.
246: */
247: long getActivityFinishTime(WMSessionHandle shandle, String procId,
248: String actId) throws Exception;
249:
250: /**
251: * Returns a list of all shark usernames.
252: *
253: * @param shandle
254: * @return the list of all users represented as WfResources in Shark
255: * @throws Exception
256: */
257: String[] getAllUsers(WMSessionHandle shandle) throws Exception;
258:
259: /**
260: * Opens a list of activity instance attributes which will be updated into the process
261: * context after activity finishes. The items in the attribute list can be retrieved
262: * sequentially in a typesafe way by calling the iterator's <code>tsNext()</code>
263: * method.
264: *
265: * @param procInstId The process instance id.
266: * @param actInstId The activity instance id.
267: * @param filter The filter or null.
268: * @param countFlag True to return count value.
269: * @return An iterator to access the {@link WMAttribute} objects.
270: * @throws Exception Workflow client exception.
271: */
272: WMAttributeIterator listActivityInstanceResultAttributes(
273: WMSessionHandle shandle, String procInstId,
274: String actInstId, WMFilter filter, boolean countFlag)
275: throws Exception;
276:
277: // /////////////////////// EA
278:
279: /**
280: * Returns input signature for the XPDL process definition defined by package Id,
281: * package version and definition Id. The input signature is meta information that
282: * defines how to set the context of of a process instance.
283: * <p>
284: * The entry identifies the name and the data type (represented by its string name) of
285: * the data item. Map contains an entry for only those variables which are in XPDL
286: * represented as FormalParameters with IN or INOUT type.
287: */
288: String[][] getProcessDefinitionInputSignature(
289: WMSessionHandle shandle, WMEntity procDef) throws Exception;
290:
291: // ///////////////////////
292:
293: // /////////////////////// CACHEADMIN
294:
295: /** Returns process cache size. */
296: int getProcessCacheSize(WMSessionHandle sessionHandle)
297: throws Exception;
298:
299: /** Returns the number of currently cached process objects. */
300: int howManyCachedProcesses(WMSessionHandle sessionHandle)
301: throws Exception;
302:
303: /** Returns resource cache size. */
304: int getResourceCacheSize(WMSessionHandle sessionHandle)
305: throws Exception;
306:
307: /** Returns the number of currently cached resource objects. */
308: int howManyCachedResources(WMSessionHandle sessionHandle)
309: throws Exception;
310:
311: // ///////////////////////
312:
313: // /////////////////////// DEADLINE
314:
315: /**
316: * Returns information on all deadlines of a given process's active activities.
317: *
318: * @param procId Id of process instance
319: */
320: DeadlineInfo[] getDeadlineInfoForProcess(WMSessionHandle session,
321: String procId) throws Exception;
322:
323: /**
324: * Returns information on all deadlines of a given activity.
325: *
326: * @param procId Id of process instance
327: * @param actId Id of activity instance
328: */
329: DeadlineInfo[] getDeadlineInfoForActivity(WMSessionHandle session,
330: String procId, String actId) throws Exception;
331:
332: // ///////////////////////
333:
334: String[][] getToolAgentsInfo(WMSessionHandle shandle)
335: throws Exception;
336:
337: // EVENT AUDITs
338: WMAAuditEntryIterator listProcessAuditEntries(
339: WMSessionHandle shandle, String procId) throws Exception;
340:
341: WMAAuditEntryIterator listActivityAuditEntries(
342: WMSessionHandle shandle, String procId, String actId)
343: throws Exception;
344:
345: }
|