Interface ActivityMatcher<C extends ActivityContext<?>>

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @API(status=STABLE) public interface ActivityMatcher<C extends ActivityContext<?>>
An activity matcher allows to check if an activity business logic has to be triggered or not.
  • Method Details

    • matches

      boolean matches(C context) throws EventException
      Matches the ActivityContext to decide whether an AbstractActivity can be executed or not.
      Parameters:
      context - Current activity context.
      Returns:
      true if AbstractActivity.onActivity(ActivityContext) can be triggered, false otherwise.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • always

      static <C extends ActivityContext<?>> ActivityMatcher<C> always()
      Returns a matcher that always returns true.
      Type Parameters:
      C - the type of the activity context
      Returns:
      a matcher that always returns true.