protected Long evaluateValueProvider ( ParameterValueProvider valueProvider , ExecutionEntity execution , String errorMessageHeading ) { Object value ; try { value = valueProvider . getValue ( execution ) ; } catch ( ProcessEngineException e ) { if ( Context . getProcessEngineConfiguration ( ) . isEnableGracefulDegradationOnContextSwitchFailure ( ) && isSymptomOfContextSwitchFailure ( e , execution ) ) { value = getDefaultPriorityOnResolutionFailure ( ) ; logNotDeterminingPriority ( execution , value , e ) ; } else { throw e ; } } if ( ! ( value instanceof Number ) ) { throw new ProcessEngineException ( errorMessageHeading + ": Priority value is not an Integer" ) ; } else { Number numberValue = ( Number ) value ; if ( isValidLongValue ( numberValue ) ) { return numberValue . longValue ( ) ; } else { throw new ProcessEngineException ( errorMessageHeading + ": Priority value must be either Short, Integer, or Long" ) ; } } }
Evaluates a given value provider with the given execution entity to determine the correct value . The error message heading is used for the error message if the validation fails because the value is no valid priority .