function workflow_deletewf in Workflow 5
Same name and namespace in other branches
- 5.2 workflow.module \workflow_deletewf()
- 6.2 workflow.module \workflow_deletewf()
- 6 workflow.module \workflow_deletewf()
Delete a workflow from the database. Deletes all states, transitions and node type mappings too. Removes workflow state information from nodes participating in this workflow.
Parameters
$wid: The ID of the workflow.
1 call to workflow_deletewf()
File
- ./
workflow.module, line 1533
Code
function workflow_deletewf($wid) {
$wf = workflow_get_name($wid);
$result = db_query('SELECT sid FROM {workflow_states} WHERE wid = %d', $wid);
while ($data = db_fetch_object($result)) {
// delete the state and any associated transitions and actions
workflow_state_delete($data->sid);
db_query('DELETE FROM {workflow_node} WHERE sid = %d', $data->sid);
}
workflow_types_delete($wid);
db_query('DELETE FROM {workflows} WHERE wid = %d', $wid);
}