code: public static boolean validate(TriggerAction triggerAction, Event event) {
          if (triggerAction == null || event == null) {
              return true;
          }
          if ((isEmpty(triggerAction.getStates()))
                  && triggerAction.getCalendar() == null) {
              return true;
          }
          if (event instanceof Alert
                  && triggerAction.getStates() != null
                  && !triggerAction.getStates().isEmpty()
                  && !triggerAction.getStates().contains( ((Alert)event).getStatus().name()) ) {
              return false;
          }
          if (triggerAction.getCalendar() != null) {
              try {
                  return triggerAction.getCalendar().isSatisfiedBy(event.getCtime());
              } catch (Exception e) {
                  log.debug(e.getMessage(), e);
                  log.errorCannotValidateAction(e.getMessage());
              }
          }
          return true;
      }
docs: Validate if an Event should generate an Action based on the constraints defined on a TriggerAction.
  
  @param triggerAction a TriggerAction where status and time constraints are defined.
  @param event a given Event to validate against a TriggerAction
  @return true if the Event is validated and it should generated an action
  false on the contrary