You are here

function workflow_create in Workflow 5

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_create()
  2. 6.2 workflow.module \workflow_create()
  3. 6 workflow.module \workflow_create()
  4. 7.2 workflow.entity.inc \workflow_create()

Create a workflow and its (creation) state.

Parameters

$name: The name of the workflow.

1 call to workflow_create()
workflow_add_form_submit in ./workflow.module

File

./workflow.module, line 1506

Code

function workflow_create($name) {
  $wid = db_next_id('{workflows}_wid');
  db_query("INSERT INTO {workflows} (wid, name) VALUES (%d, '%s')", $wid, $name);
  workflow_state_save(array(
    'wid' => $wid,
    'state' => t('(creation)'),
    'sysid' => WORKFLOW_CREATION,
    'weight' => WORKFLOW_CREATION_DEFAULT_WEIGHT,
  ));
  return $wid;
}