You are here

function computing_action_handle_output in Drupal Computing 7.2

File

./computing.rules.inc, line 98

Code

function computing_action_handle_output($record) {

  // TODO: $record->command might not be found in hook_computing_data() if the real "command" was defined.
  $command_data = computing_fetch_data($record->application, $record->command);

  // load file if necessary.
  if ($command_data && isset($command_data['file']) && is_array($command_data['file'])) {
    call_user_func_array('module_load_include', $command_data['file']);
  }
  if ($command_data && isset($command_data['result callback']) && function_exists($command_data['result callback'])) {

    // if 'result callback' is defined, use it.
    $output = isset($record->output) ? $record->output : NULL;
    return call_user_func($command_data['result callback'], $output, $record);
  }
  return FALSE;
}