Class SpelExpressionGuard<S,E>

java.lang.Object
org.springframework.statemachine.guard.SpelExpressionGuard<S,E>
All Implemented Interfaces:
Guard<S,E>

public class SpelExpressionGuard<S,E> extends Object implements Guard<S,E>
Guard which uses Spring SpEL expression for condition evaluation.
Author:
Janne Valkealahti
  • Constructor Details

    • SpelExpressionGuard

      public SpelExpressionGuard(org.springframework.expression.Expression expression)
      Instantiates a new spel expression guard.
      Parameters:
      expression - the expression
  • Method Details

    • evaluate

      public boolean evaluate(StateContext<S,E> context)
      Description copied from interface: Guard
      Evaluate a guard condition.
      Specified by:
      evaluate in interface Guard<S,E>
      Parameters:
      context - the state context
      Returns:
      true, if guard evaluation is successful, false otherwise.