/**
  * Function to add the form elements
  *
  * @access protected
  */
 protected function createFormElements()
 {
     $this->add('hidden', 'rule_id');
     if ($this->ruleActionId) {
         $this->add('hidden', 'id');
     }
     $actionList = array(' - select - ') + CRM_Civirules_Utils::buildActionList();
     asort($actionList);
     $attributes = array();
     if (empty($this->ruleActionId)) {
         $this->add('select', 'rule_action_select', ts('Select Action'), $actionList, $attributes);
     }
     $delayList = array(' - No Delay - ') + CRM_Civirules_Delay_Factory::getOptionList();
     $this->add('select', 'delay_select', ts('Delay action to'), $delayList);
     foreach (CRM_Civirules_Delay_Factory::getAllDelayClasses() as $delay_class) {
         $delay_class->addElements($this);
     }
     $this->assign('delayClasses', CRM_Civirules_Delay_Factory::getAllDelayClasses());
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
 }