/** * Trigger a rule. * * The trigger will check the conditions and if conditions are valid then the actions are executed * * @param CRM_Civirules_Event $event * @param object CRM_Civirules_EventData_EventData $eventData * @return bool true when conditions are valid; false when conditions are not valid * @access public * @static */ public static function triggerRule(CRM_Civirules_Event $event, CRM_Civirules_EventData_EventData $eventData) { $eventData->setEvent($event); $isRuleValid = self::areConditionsValid($eventData); if ($isRuleValid) { self::logRule($eventData); self::executeActions($eventData); return true; } return false; }