org.enhydra.shark.api.client.wfmodel
Interface WfResource

All Superinterfaces:
BaseBusinessObject, java.io.Serializable

public interface WfResource
extends BaseBusinessObject

OMG definition: WfResource is an abstraction that represents a person or thing that will potentially accept an assignment to an activity. Potential and/or accepted WfAssignments are links between the requesting WfActivities and WfResource objects. It is expected that this interface will be used to implement adapters for objects representing people and things implemented in user, organization, and resource models. These models are outside the scope of this specification.

We extended OMG's interface by duplicating methods, and adding additional parameter that represents transaction. If you use methods without SharkTransaction parameter, the transaction will be implicitly created, and if you use it with SharkTransaction parameter you must obey to some rules explained in HowTo documentation.


Method Summary
 WfAssignmentIterator get_iterator_work_item()
          Zero or more WfAssignments are associated with a resource.
 WfAssignment[] get_sequence_work_item(int max_number)
          Zero or more WfAssignments are associated with a resource.
 int how_many_work_item()
          Zero or more WfAssignments are associated with a resource.
 boolean is_member_of_work_items(WfAssignment member)
          Zero or more WfAssignments are associated with a resource.
 void release(WfAssignment from_assigment, java.lang.String release_info)
          The release operation is used to signal that the resource is no longer needed for a specific assignment.
 java.lang.String resource_key()
          Returns the resource key that identifies a resource within a given business domain.
 java.lang.String resource_name()
          Returns a human readable, descriptive name of the resource.
 

Method Detail

how_many_work_item

public int how_many_work_item()
                       throws java.lang.Exception
Zero or more WfAssignments are associated with a resource. The association is established when the assignment is created as part of the resource selection process for an activity; the assignment can be reassigned to another resource at a later point in time.

The following operation returns the number of WfAssignments associated with a resource.

Throws:
java.lang.Exception

get_iterator_work_item

public WfAssignmentIterator get_iterator_work_item()
                                            throws java.lang.Exception
Zero or more WfAssignments are associated with a resource. The association is established when the assignment is created as part of the resource selection process for an activity; the assignment can be reassigned to another resource at a later point in time.

The following operation returns iterator for qurying associated assignments based on some criteria.

Throws:
java.lang.Exception

get_sequence_work_item

public WfAssignment[] get_sequence_work_item(int max_number)
                                      throws java.lang.Exception
Zero or more WfAssignments are associated with a resource. The association is established when the assignment is created as part of the resource selection process for an activity; the assignment can be reassigned to another resource at a later point in time.

The following operation returns max_number of WfAssignment objects associated with a resource. If max_number is less or eaqual to zero, or it is greater than the number of existing assignments, all associated WfAssignments objects will be returned.

Throws:
java.lang.Exception

is_member_of_work_items

public boolean is_member_of_work_items(WfAssignment member)
                                throws java.lang.Exception
Zero or more WfAssignments are associated with a resource. The association is established when the assignment is created as part of the resource selection process for an activity; the assignment can be reassigned to another resource at a later point in time.

The following operation returns true if given assignment is associated with resource.

Throws:
java.lang.Exception

resource_key

public java.lang.String resource_key()
                              throws java.lang.Exception
Returns the resource key that identifies a resource within a given business domain. It is assumed that resources are defined in the same business domain as the workflow processes they are associated with.

The key is set when the object is initialized; modification of the key can be done in the context of a resource management facility.

Throws:
java.lang.Exception

resource_name

public java.lang.String resource_name()
                               throws java.lang.Exception
Returns a human readable, descriptive name of the resource.

Throws:
java.lang.Exception

release

public void release(WfAssignment from_assigment,
                    java.lang.String release_info)
             throws java.lang.Exception,
                    NotAssigned
The release operation is used to signal that the resource is no longer needed for a specific assignment. It takes the assignment that is no longer associated with the resource and a string that specifies additional information on the reason for realizing the resource as input. A NotAssigned exception is raised when the WfAssignment specified as input is not assigned to the WfResource. It is assumed that this operation is invoked when an assignment is deleted or when an assignment is reassigned to another resource.

Throws:
java.lang.Exception
NotAssigned