support global workflow states
| Project: | Workflow |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
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.
