'workflow_id' * */ function install_workflow_type_map_create($content_type, $workflow_id) { // Prevent workflow module destroying existing associations. Oh well. $type_map = array(); $result = db_query("SELECT wid, type FROM {workflow_type_map}"); while ($data = db_fetch_object($result)) { $type_map[$data->type] = $data->wid; } $type_map[$content_type] = $workflow_id; workflow_types_save($type_map); } /** * Create a workflow state */ function install_workflow_create_state($wid, $name, $weight = 0, $sysid = 0) { return workflow_state_save(array('wid' => $wid, 'state' => $name, 'sysid' => $sysid, 'weight' => $weight)); } /** * Create a workflow transition */ function install_workflow_add_transition_role($from, $to, $role) { workflow_transition_add_role($from, $to, $role); } /** * Create an configured action. * * @param $function The function name that implements an action, eg. 'action_send_email' * @param $description The description for this instance of an action * @param $params A keyed array of configuration parameters. * * NOTE: Non-configurable actions (eg. 'action_node_publish') do not need to be created. */ function install_action_create_action($function, $description, $params) { // $type is not configurable in the admin, so hide it from the install api and assign dynamically. $actions = actions_list(); $type = $actions[$function]['type']; return actions_save($function, $type, $params, $description); } /** * Register an action to a transition. */ function install_workflow_add_transition_action($transition_id, $action_id) { workflow_actions_save($transition_id, $action_id); }