com.ebasetech.ufs.workflow.resource
Interface AssignmentHandler

All Known Implementing Classes:
AssignmentHandlerImpl, DefaultAssignmentHandler, EbaseAssignmentHandler, EbaseDynamicAssignmentHandler, LdapAssignmentHandler

public interface AssignmentHandler

Each installation of the Workflow Management System must be provided with a particular implementation of this interface, which is responsible for managing the issues related to which particular resource is allowed to take on the interactive task enactments that are part of the enactment of a process that is represented by a Job.

An implementation of this interface works hand in hand with the various implementations of the Assignable interface. These provide implementations of this interface with the specific pieces of information that are needed.

Various standard aspects of assignment are performed by a standard implementation of this interface: DefaultAssignmentHandler. It is intended that users implementing their own assignment mechanisms should if possible provide that implementation by sub-classing that implementation class. However, if this is not feasible or sensible, it is possible to directly implement this interface.

See Also:
Job, WorkflowProcess, InteractiveTaskEnactment, Assignable, DefaultAssignmentHandler

Method Summary
 boolean assign(Assignable assignable, Context context, java.lang.String reason, java.lang.String caller)
          Methods that implement this operation are called at runtime as each Assignable object is created.
 AssignmentExpressionComponent getAssignmentExpressionComponentActorIdOnly()
          Implementations of this operation are called by the process designer to provide the GUI component to provide the assignment expression.
 AssignmentExpressionComponent getAssignmentExpressionComponentSupportsPools()
          Implementations of this operation are called by the process designer to provide the GUI component to provide the assignment expression.
 java.util.Collection getCandidateActors(Assignable assignable)
          Answer a collection of strings, each of which is a candidate actor assignment for the supplied assignable.
 boolean isAssignableToActor(Assignable assignable, java.lang.String actorId, boolean forced)
          Answer true if it is feasible that the given actor may be assigned to the assignable.
 boolean isAssignableToRole(Assignable assignable, java.lang.String roleName)
          Answer true if it is feasible that the an actor that is a member of the defined groups may be assigned to the supplied assignable.
 

Method Detail

assign

boolean assign(Assignable assignable,
               Context context,
               java.lang.String reason,
               java.lang.String caller)
               throws com.ebasetech.ufs.utility.PersistenceException,
                      com.ebasetech.ufs.utility.ConcurrentUpdateException,
                      com.ebasetech.ufs.workflow.server.enactment.ProcessAttributeException,
                      InvalidAssignmentException,
                      com.ebasetech.ufs.kernel.SetupPropertiesException,
                      com.ebasetech.ufs.workflow.server.enactment.InvalidStateTransitionException,
                      ResourceManagementException,
                      com.ebasetech.ufs.workflow.server.enactment.ProcessStructureException
Methods that implement this operation are called at runtime as each Assignable object is created. The implementation should set one of the assignment methods (setActorId or setPooledActors) available on Assignable, in such a way that when the assignable comes up for enactment the system has the information needed to perform any detailed assignment needed.

In some cases, such as for an EscalatorEnactment, the assignable does not support actor pools. In such a case this method must use the setActorId method.

Parameters:
assignable - The assignable object that is being assigned.
context - The context object that represents the Job context of the assignable object.
reason - The string reason for this operation, passed into the external API when the method that ultimately caused this operation to be invoked was called.
caller - The string id of the caller of the external API method that invoked the implementation of this operation
Returns:
true if the assignment was completed
Throws:
com.ebasetech.ufs.utility.PersistenceException - If there is some issue with the underlying persistence mechanism
com.ebasetech.ufs.utility.ConcurrentUpdateException - If another thread in another processor in a cluster attempts to simultaneously modify the database
com.ebasetech.ufs.workflow.server.enactment.ProcessAttributeException - If this method attempts to incorrectly access some attribute of the Context
InvalidAssignmentException - If this method assigns the Assignable in some incorrect manner
com.ebasetech.ufs.kernel.SetupPropertiesException
com.ebasetech.ufs.workflow.server.enactment.InvalidStateTransitionException - If this method causes some invalid state transition to be attempted for the Assignable object
ResourceManagementException - If some other error occurs with management of resources
com.ebasetech.ufs.workflow.server.enactment.ProcessStructureException - if the assignment exposes some fault in the structure of the enacted process
See Also:
Assignable.setActorId(String, boolean, String, String), Assignable.setPooledActors(java.util.List, String, String), Assignable.supportsActorPools(), EscalatorEnactment, Context

getAssignmentExpressionComponentSupportsPools

AssignmentExpressionComponent getAssignmentExpressionComponentSupportsPools()
Implementations of this operation are called by the process designer to provide the GUI component to provide the assignment expression.

The component returned should allow the user to configure an assignment expression which may resolve to either a single resource or a resource pool.


getAssignmentExpressionComponentActorIdOnly

AssignmentExpressionComponent getAssignmentExpressionComponentActorIdOnly()
Implementations of this operation are called by the process designer to provide the GUI component to provide the assignment expression.

The component returned should ONLY allow the user to configure an assignment expression which resolves to a single resource (that is, an actorId).


isAssignableToActor

boolean isAssignableToActor(Assignable assignable,
                            java.lang.String actorId,
                            boolean forced)
                            throws com.ebasetech.ufs.utility.PersistenceException,
                                   ResourceManagementException
Answer true if it is feasible that the given actor may be assigned to the assignable.

Parameters:
forced - true if the supplied actor is being provided and the user is _insisting_ that it be used. Typically, the assignment handler will check that the given person exists (eg in the HR system) but will avoid checking that he/she is specically allowed by the assignment expression and assignment mode
Returns:
true if the assignment is acceptable, false otherwise.
Throws:
ResourceManagementException - if there is some problem with the assignment requested
com.ebasetech.ufs.utility.PersistenceException - is there is an issue with the underlying database system

getCandidateActors

java.util.Collection getCandidateActors(Assignable assignable)
                                        throws com.ebasetech.ufs.utility.PersistenceException,
                                               ResourceManagementException
Answer a collection of strings, each of which is a candidate actor assignment for the supplied assignable.

Throws:
ResourceManagementException - if there is some problem with the assignment requested
com.ebasetech.ufs.utility.PersistenceException - is there is an issue with the underlying database system

isAssignableToRole

boolean isAssignableToRole(Assignable assignable,
                           java.lang.String roleName)
                           throws com.ebasetech.ufs.utility.PersistenceException,
                                  ResourceManagementException
Answer true if it is feasible that the an actor that is a member of the defined groups may be assigned to the supplied assignable.

Throws:
ResourceManagementException - if there is some problem with the assignment requested
com.ebasetech.ufs.utility.PersistenceException - is there is an issue with the underlying database system