function workflow_rules_workflow in Workflow 7
Same name and namespace in other branches
- 7.2 workflow_rules/workflow_rules.workflow.inc \workflow_rules_workflow()
Implements hook_workflow(). Invokes events, as defined in hook_rules_event_info().
Parameters
$op: The current workflow operation: 'transition pre' or 'transition post'.
$old_sid: The state ID of the current state.
$new_sid: The state ID of the new state.
$node: The node whose workflow state is changing.
File
- workflow_rules/
workflow_rules.workflow.inc, line 20 - Provide rules for workflows via hook_workflow.
Code
function workflow_rules_workflow($op, $old_sid, $new_sid, $entity) {
switch ($op) {
case 'transition post':
// Rules are updated only after the transition.
if ($old_sid == $new_sid) {
rules_invoke_event('workflow_comment_added', $entity, $old_sid, $new_sid);
}
else {
rules_invoke_event('workflow_state_changed', $entity);
}
break;
default:
break;
}
}