public interface IDynamicAssignmentPattern extends IDynamicPattern
Implementations must provide support for selecting a single assignee from a list of participants (all of the same type) by implementing the method getAssigneeFromParticipantList(java.util.List<java.lang.String>, oracle.bpel.services.workflow.assignment.dynamic.IDynamicAssignmentPattern.AssigneeType, java.lang.String, boolean, oracle.bpel.services.workflow.task.model.Task, java.util.Map<java.lang.String, java.lang.String>)
An implementation does not have to support all assignee types - the interface provides the method getSupportedAssigneeTypes()
to allow the implementation to specify which types of assignee it supports.
Implementations can accept input parameters to specify selection criteria, the Dynamic Assignment Framework validates these input parameters, and the implementation to define its parameters (if any) in the method IDynamicPattern.getPatternParameters()
.
An implementation can also accept initialization parameters, which are set when the implentation is initialized by the framework. The parameter values are defined in the human workflow configuration (either via configMBean, or by Human Workflow Service Engine configuration in Enterprise Manager), where the dynamic assignement pattern is registered.
For convenience, the framework provides the class AbstractDynamicAssignmentPattern
which implments some common functionality. Assignment pattern implementations can extend this abstract class, to save implementing some parameter and localization support.
Modifier and Type | Interface and Description |
---|---|
static class |
IDynamicAssignmentPattern.AssigneeType
The possible types of assignee that can be inputs to an assignment pattern, or selected by the pattern.
|
IDynamicPattern.IDynamicPatternParameter
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAssigneeFromParticipantList(java.util.List<java.lang.String> participants, IDynamicAssignmentPattern.AssigneeType assigneeType, java.lang.String invocationContextId, boolean evaluateUsingOnlyCurrentTaskType, Task currentTask, java.util.Map<java.lang.String,java.lang.String> parameters)
Executes the implemented dynamic assignment pattern to select a single assignee from the list of input participants, for a particular task instance.
|
java.util.Set<IDynamicAssignmentPattern.AssigneeType> |
getSupportedAssigneeTypes()
Returns the list of assignee types that this implementation supports.
|
getDescription, getLabel, getName, getPatternParameters, setInitParams
java.util.Set<IDynamicAssignmentPattern.AssigneeType> getSupportedAssigneeTypes()
IDynamicAssignmentPattern.AssigneeType
java.lang.String getAssigneeFromParticipantList(java.util.List<java.lang.String> participants, IDynamicAssignmentPattern.AssigneeType assigneeType, java.lang.String invocationContextId, boolean evaluateUsingOnlyCurrentTaskType, Task currentTask, java.util.Map<java.lang.String,java.lang.String> parameters) throws DynamicPatternException
The selected assignee must be a member of the specified input list, and the list of participants must all be of the same type (user, group, application role), as specified by the inputParticipantListType parameter. If the input participants are application roles, they will all belong to the application specified in the applicationContext parameter of the current task.
It is up to the implementation on how to handle cases where no applicable assignee is found in the list. Returning null
in such circumstances is acceptable.
A given implementation may choose to support only a subset of the possible assignee types. It must specify which values for inputParticipantListType it will support in the implmentation of method getSupportedAssigneeTypes()
.
The framework will provide the necessary validation to ensure the implemented pattern will only be invoked with the assignee types that it supports.
An implmentation may make use of input parameters, which are passed as a name-value map in the 'parameters' parameter. The framework will validate this map to ensure only valid parameter names are passed, and that any mandatory parameters are present. The implementation may do any further validation as necessary.
The implementation may throw a DynamicAssignmentException
if any error is encountered when executing the dynamic assignment pattern.
The framework will provide an invocationContextId which provides a unique identifier for the context in which the dynamic assignment pattern is being invoked (for example, the task participant, or the assignment rule name & assigneee). This id may be used by the implementation for example, caching context-dependent information.
When invoking an assignment pattern, invoker may dictate whether the scope for the assignment pattern is global, or specific to a particular task-type. The evaluateUsingOnlyCurrentTaskType parameter will be set to true
if the scope is for a specific task-type, false
if it is to be global. (For example, the LEAST_BUSY assignment pattern selects the user with the least total number of assigned tasks if the scope is global, and selects the user with the least number of assigned tasks of the current task's type if the scope is specific to a that task-type).
Implementations of the method can indicate that an error occurred when executing the pattern by throwing a DynamicAssignmentException
.
participants
- List of participants to select assignee fromassigneeType
- IDynamicAssignmentPattern.AssigneeType
type of input participants (USER, GROUP, APPLICATION ROLE) in the list.invocationContextId
- String unique identifier for the context (for example, task participant) which invoked the pattern.evaluateUsingOnlyCurrentTaskType
- if true
the pattern's evaluation should only take into account tasks of the same type as the current task. If false
, the pattern should be evaluated globally, across all task types.currentTask
- the current task instance for which the dynamic assigment pattern is being evaluated.parameters
- Map of parameter values keyed by parameter names. Parameters must be defined by implementation of IDynamicPattern.getPatternParameters()
null
is acceptible if no applicable target assignee could be found.DynamicAssignmentException
DynamicPatternException