Project:Workflow
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

It is a pretty common case to have multiple workflows containing common states with additional special ones.
When using workflow and performing node mass updates (where different nodetypes contain different workflows) workflow support with actions is pretty limited.

I'd recommend to add a GLOBAL Workflow that provides global states which are reused in specific workflows. Thus on action assignment one might convert a global workflow state to a per-nodetype workflow state. You also need to add a global workflow.

As a first step we tested adding column "gsid" in workflow_states (containing the corresponding global sid for non-global states) and also adding column "global" in workflows to identify the global workflow states. We've then added the relationships by hand.

Finally two changes allowed us to use global (alias) states to be converted to nodetype specific ones:

workflow_execute_transition@503
  // Unglobal the sid
  $wid = workflow_get_workflow_for_type($node->type);  $result = db_query("SELECT sid FROM {workflow_states} WHERE wid = %d AND gsid
= %d", $wid, $sid);
  if($data = db_fetch_object($result)) {
    $sid = $data->sid;
  }

If global token support is what you're looking for we should extend this support into apis and user interfaces / configurability.

Comments

#1

Adding a patch to show how to convert from a global sid to a specific sid.

Note that we've added gsid to the DB and added the relations manually. No UI available for this state grouping.
It is important for global bulk updates/transitions, if a state exists in multiple node types.

AttachmentSize
workflow_614408_global.patch 1.25 KB

#2

Status:active» closed (won't fix)

Since this request is over a year old, I'm going to assume a solution was found or you've moved on. If not, please get updated to the latest versions of all modules and make a patch for it against Drupal 7 and I'll be glad to take a look at it.