function execute()
 {
     $this->setTaskStartedDate($this->_properties->id);
     $aids = trigger_get_assigned_actions('fire_trigger_task' . $this->_properties->template_data_id);
     $context = array('group' => 'maestro', 'hook' => 'fire_trigger_task' . $this->_properties->template_data_id);
     actions_do(array_keys($aids), (object) $this->_properties, $context);
     $this->completionStatus = MaestroTaskStatusCodes::STATUS_COMPLETE;
     $this->executionStatus = TRUE;
     return $this;
 }
Exemple #2
0
 /**
  * Executes the selected operation on the provided data.
  *
  * @param $data
  *   The data to to operate on. An entity or an array of entities.
  * @param $context
  *   An array of related data (selected views rows, etc).
  */
 public function execute($data, array $context)
 {
     $context['entity_type'] = $this->entityType;
     $context['settings'] = $this->getAdminOption('settings', array());
     $context += $this->formOptions;
     $context += $this->operationInfo['parameters'];
     // Actions provided by the Drupal system module require the entity to be
     // present in $context, keyed by entity type.
     if (is_object($data)) {
         $context[$this->entityType] = $data;
     }
     actions_do($this->operationInfo['callback'], $data, $context);
     // The action might need to have its entities saved after execution.
     if (in_array('changes_property', $this->operationInfo['behavior'])) {
         $data = is_array($data) ? $data : array($data);
         foreach ($data as $entity) {
             entity_save($this->entityType, $entity);
         }
     }
 }
 /**
  * Executes the selected operation on the provided entity.
  *
  * @param $entity
  *   The selected entity, or an array of entities, if aggregation is used.
  * @param $context
  *   An array of related data provided by the caller.
  */
 public function execute($entity, array $context)
 {
     $context['entity_type'] = $this->entityType;
     $context['settings'] = $this->getAdminOption('settings', array());
     $context += $this->formOptions;
     $context += $this->operationInfo['parameters'];
     actions_do($this->operationInfo['callback'], $entity, $context);
     // Actions that specify 'changes_property' need to be explicitly saved.
     if (in_array('changes_property', $this->operationInfo['behavior'])) {
         entity_save($this->entityType, $entity);
     }
 }