You are here

function workflow_transition_delete in Workflow 6

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_transition_delete()
  2. 5 workflow.module \workflow_transition_delete()
  3. 6.2 workflow.module \workflow_transition_delete()

Delete a transition (and any associated actions).

Parameters

$tid: The ID of the transition.

1 call to workflow_transition_delete()
workflow_state_delete in ./workflow.module
Delete a workflow state from the database, including any transitions the state was involved in and any associations with actions that were made to that transition.

File

./workflow.module, line 940
Support workflows made up of arbitrary states.

Code

function workflow_transition_delete($tid) {

  // TODO - turn this into a hook callback.
  if (function_exists('workflow_actions_get_actions')) {
    $actions = workflow_actions_get_actions($tid);
    foreach ($actions as $aid => $type) {
      workflow_actions_actions_remove($tid, $aid);
    }
  }
  db_query("DELETE FROM {workflow_transitions} WHERE tid = %d", $tid);

  // Notify interested modules.
  module_invoke_all('workflow', 'transition delete', $tid, NULL, NULL);
}