01: package org.enhydra.shark.api.client.wfmodel;
02:
03: import org.enhydra.shark.api.client.wfbase.BaseBusinessObject;
04:
05: /**
06: * OMG definition: WfResource is an abstraction that represents a person or thing that
07: * will potentially accept an assignment to an activity. Potential and/or accepted
08: * WfAssignments are links between the requesting WfActivities and WfResource objects. It
09: * is expected that this interface will be used to implement adapters for objects
10: * representing people and things implemented in user, organization, and resource models.
11: * These models are outside the scope of this specification.
12: * <p>
13: * We extended OMG's interface by duplicating methods, and adding additional parameter
14: * that represents transaction. If you use methods without SharkTransaction parameter, the
15: * transaction will be implicitly created, and if you use it with SharkTransaction
16: * parameter you must obey to some rules explained in HowTo documentation.
17: */
18: public interface WfResource extends BaseBusinessObject {// , PersistenceInterface
19:
20: /**
21: * Zero or more WfAssignments are associated with a resource. The association is
22: * established when the assignment is created as part of the resource selection process
23: * for an activity; the assignment can be reassigned to another resource at a later
24: * point in time.
25: * <p>
26: * The following operation returns the number of WfAssignments associated with a
27: * resource.
28: */
29: int how_many_work_item() throws Exception;
30:
31: /**
32: * Zero or more WfAssignments are associated with a resource. The association is
33: * established when the assignment is created as part of the resource selection process
34: * for an activity; the assignment can be reassigned to another resource at a later
35: * point in time.
36: * <p>
37: * The following operation returns iterator for qurying associated assignments based on
38: * some criteria.
39: */
40: WfAssignmentIterator get_iterator_work_item() throws Exception;
41:
42: /**
43: * Zero or more WfAssignments are associated with a resource. The association is
44: * established when the assignment is created as part of the resource selection process
45: * for an activity; the assignment can be reassigned to another resource at a later
46: * point in time.
47: * <p>
48: * The following operation returns max_number of WfAssignment objects associated with a
49: * resource. If max_number is less or eaqual to zero, or it is greater than the number
50: * of existing assignments, all associated WfAssignments objects will be returned.
51: */
52: WfAssignment[] get_sequence_work_item(int max_number)
53: throws Exception;
54:
55: /**
56: * Zero or more WfAssignments are associated with a resource. The association is
57: * established when the assignment is created as part of the resource selection process
58: * for an activity; the assignment can be reassigned to another resource at a later
59: * point in time.
60: * <p>
61: * The following operation returns true if given assignment is associated with
62: * resource.
63: */
64: boolean is_member_of_work_items(WfAssignment member)
65: throws Exception;
66:
67: /**
68: * Returns the resource key that identifies a resource within a given business domain.
69: * It is assumed that resources are defined in the same business domain as the workflow
70: * processes they are associated with.
71: * <p>
72: * The key is set when the object is initialized; modification of the key can be done
73: * in the context of a resource management facility.
74: */
75: String resource_key() throws Exception;
76:
77: /** Returns a human readable, descriptive name of the resource. */
78: String resource_name() throws Exception;
79:
80: /**
81: * The release operation is used to signal that the resource is no longer needed for a
82: * specific assignment. It takes the assignment that is no longer associated with the
83: * resource and a string that specifies additional information on the reason for
84: * realizing the resource as input. A NotAssigned exception is raised when the
85: * WfAssignment specified as input is not assigned to the WfResource. It is assumed
86: * that this operation is invoked when an assignment is deleted or when an assignment
87: * is reassigned to another resource.
88: */
89: void release(WfAssignment from_assigment, String release_info)
90: throws Exception, NotAssigned;
91:
92: } // interface WfResource
|