01: package org.enhydra.shark.api.client.wfmodel;
02:
03: import java.util.Map;
04:
05: /**
06: * OMG definition:WfActivity is a step in a process that is associated, as part of an
07: * aggregation, with a single WfProcess. It represents a request for work in the context
08: * of the containing WfProcess. There can be many active WfActivity objects within a
09: * WfProcess at a given point in time. The WfActivity interface specializes
10: * WfExecutionObject with an explicit complete operation to signal completion of the step,
11: * and with an operation to set the result of the WfActivity. It also adds relationships
12: * with WfProcess and WfAssignment.
13: * <p>
14: * We extended OMG's interface by duplicating methods, and adding additional parameter
15: * that represents transaction. If you use methods without SharkTransaction parameter, the
16: * transaction will be implicitly created, and if you use it with SharkTransaction
17: * parameter you must obey to some rules explained in HowTo documentation.
18: */
19: public interface WfActivity extends WfExecutionObject, WfRequester {
20:
21: /**
22: * Zero or more WfAssignments can be associated with a WfActivity. The association is
23: * established when the assignment is created as part of the resource selection process
24: * for the activity.
25: * <p>
26: * The following operation returns the number of WfAssignments associated with an
27: * activity.
28: */
29: int how_many_assignment() throws Exception;
30:
31: /**
32: * Zero or more WfAssignments can be associated with a WfActivity. The association is
33: * established when the assignment is created as part of the resource selection process
34: * for the activity.
35: * <p>
36: * The following operation returns iterator for qurying associated assignments based on
37: * some criteria.
38: */
39: WfAssignmentIterator get_iterator_assignment() throws Exception;
40:
41: /**
42: * Zero or more WfAssignments can be associated with a WfActivity. The association is
43: * established when the assignment is created as part of the resource selection process
44: * for the activity.
45: * <p>
46: * The following operation returns max_number of WfAssignment objects associated with
47: * an activity. If max_number is less or eaqual to zero, or it is greater than the
48: * number of existing assignments, all associated WfAssignments objects will be
49: * returned.
50: */
51: WfAssignment[] get_sequence_assignment(int max_number)
52: throws Exception;
53:
54: /**
55: * Zero or more WfAssignments can be associated with a WfActivity. The association is
56: * established when the assignment is created as part of the resource selection process
57: * for the activity.
58: * <p>
59: * The following operation returns true if given assignment is associated with
60: * activity.
61: */
62: boolean is_member_of_assignment(WfAssignment member)
63: throws Exception;
64:
65: /** This operation returns the WfProcess that this activity is a part of. */
66: WfProcess container() throws Exception;
67:
68: /**
69: * Represents the result produced by the realization of the work request represented by
70: * an activity. An implementation of the WfM Facility may or may not provide access to
71: * the result of an activity. If it does not, or if the result data are not available
72: * yet, a ResultNotAvailable exception is raised by the result access operation.
73: */
74: Map result() throws Exception, ResultNotAvailable;
75:
76: /**
77: * The set_result operation is used to pass process data back to the workflow process.
78: * An InvalidData exception is raised when the data do not match the signature of the
79: * activity or when an invalid attempt is made to update the results of an activity;
80: * lack of access rights might be one of those reasons.
81: */
82: void set_result(Map result) throws Exception, InvalidData;
83:
84: /**
85: * This operation is used by an application to signal completion of the WfActivity. It
86: * will be used together with the set_result operation to pass results of the activity
87: * back to the workflow process. A CannotComplete exception is raised when the activity
88: * cannot be completed yet.
89: */
90: void complete() throws Exception, CannotComplete;
91:
92: }
|