T
- the type of the param to determine the prioritypublic abstract class DefaultPriorityProvider<T> extends Object implements PriorityProvider<T>
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_PRIORITY
The default priority.
|
static long |
DEFAULT_PRIORITY_ON_RESOLUTION_FAILURE
The default priority in case of resolution failure.
|
Constructor and Description |
---|
DefaultPriorityProvider() |
Modifier and Type | Method and Description |
---|---|
long |
determinePriority(ExecutionEntity execution,
T param,
String jobDefinitionId) |
protected Long |
evaluateValueProvider(ParameterValueProvider valueProvider,
ExecutionEntity execution,
String errorMessageHeading)
Evaluates a given value provider with the given execution entity to determine
the correct value.
|
long |
getDefaultPriority()
Returns the default priority.
|
long |
getDefaultPriorityOnResolutionFailure()
Returns the default priority in case of resolution failure.
|
protected Long |
getProcessDefinedPriority(ProcessDefinitionImpl processDefinition,
String propertyKey,
ExecutionEntity execution,
String errorMsgHead)
Returns the priority which is defined in the given process definition.
|
protected abstract Long |
getProcessDefinitionPriority(ExecutionEntity execution,
T param)
Returns the priority defined in the process definition.
|
protected abstract Long |
getSpecificPriority(ExecutionEntity execution,
T param,
String jobDefinitionId)
Returns the priority defined in the specific entity.
|
protected boolean |
isSymptomOfContextSwitchFailure(Throwable t,
ExecutionEntity contextExecution) |
protected boolean |
isValidLongValue(Number value)
Checks if the given number is a valid long value.
|
protected abstract void |
logNotDeterminingPriority(ExecutionEntity execution,
Object value,
ProcessEngineException e)
Logs the exception which was thrown if the priority can not be determined.
|
public static long DEFAULT_PRIORITY
public static long DEFAULT_PRIORITY_ON_RESOLUTION_FAILURE
public long getDefaultPriority()
public long getDefaultPriorityOnResolutionFailure()
protected Long evaluateValueProvider(ParameterValueProvider valueProvider, ExecutionEntity execution, String errorMessageHeading)
valueProvider
- the provider which contains the valueexecution
- the execution entityerrorMessageHeading
- the heading which is used for the error messagepublic long determinePriority(ExecutionEntity execution, T param, String jobDefinitionId)
determinePriority
in interface PriorityProvider<T>
execution
- may be null when the job is not created in the context of a
running process instance (e.g. a timer start event)param
- extra parameter to determine priority onjobDefinitionId
- the job definition id if related to a jobprotected abstract Long getSpecificPriority(ExecutionEntity execution, T param, String jobDefinitionId)
execution
- the current executionparam
- the generic paramjobDefinitionId
- the job definition id if related to a jobprotected abstract Long getProcessDefinitionPriority(ExecutionEntity execution, T param)
execution
- the current executionparam
- the generic paramprotected Long getProcessDefinedPriority(ProcessDefinitionImpl processDefinition, String propertyKey, ExecutionEntity execution, String errorMsgHead)
processDefinition
- the process definition that should contains the prioritypropertyKey
- the key which identifies the propertyexecution
- the current executionerrorMsgHead
- the error message header which is used if the evaluation failsprotected abstract void logNotDeterminingPriority(ExecutionEntity execution, Object value, ProcessEngineException e)
execution
- the current execution entityvalue
- the current valuee
- the exception which was catchedprotected boolean isSymptomOfContextSwitchFailure(Throwable t, ExecutionEntity contextExecution)
protected boolean isValidLongValue(Number value)
value
- the number which should be checkedCopyright © 2021. All rights reserved.