You are here

function state_flow_invoke_event_handlers in State Machine 7

Same name and namespace in other branches
  1. 7.2 modules/state_flow/state_flow.module \state_flow_invoke_event_handlers()

Inform external systems about a workflow transition.

1 call to state_flow_invoke_event_handlers()
StateFlow::fire_event in modules/state_flow/plugins/state_flow.inc
Extending fire_event() from state_machine's base.inc to add uid and log arguments.

File

modules/state_flow/state_flow.module, line 287
An implementation of node revision workflow for Drupal based on the State Machine system.

Code

function state_flow_invoke_event_handlers($object, $state) {

  // Load related objects
  $node = node_load($object->nid, $object->vid);
  $author = !empty($node->uid) ? user_load($node->uid) : drupal_anonymous_user();

  // Invoke the Rules state_flow_event_fired event.
  if ($node && module_exists('rules')) {
    rules_invoke_event('state_flow_event_fired', $node, $author, $state);
  }
}