How do you pass arguments from an event to an action?

Events happening in the community are now at Drupal community events on www.drupal.org.
sbefort's picture

I'm creating a custom event like so:

/**
* Implementation of hook_rules_event_info().
* @ingroup rules
*/
function encoding_pipe_rules_event_info() {
  return array(
    'encoding_pipe_event_video_ready' => array(
      'label' => t('After a video is uploaded and ready to encode'),
      'arguments' => array(
        'fid' => array('type' => 'number', 'label' => t('File ID')),
        'media_id' => array('type' => 'number', 'label' => t('Media ID')),
      ),
      'module' => 'Encoding pipe',
    ),
  );
}

I call the preceding event with something like this:

rules_invoke_event('encoding_pipe_event_video_ready', 66, 1510987);

As far as I can tell, these variables are not made available to the event's action. How can I pass them to the action? Thanks!

Comments

You have to declare the

fago's picture

You have to declare the arguments the action should get in the action's info.

Some good reading

itangalo's picture

I haven't tried coding events for Rules, but I think the following page can be of guidance:
http://www.sthlmconnection.se/tips-and-tweaks/rules-based-notifications-...

Good luck!
//Johan Falk, NodeOne, Sweden

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: