i think it will be useful for admin to optionally provide labels for each transition. this could be done on a new admin page. the labels would be shown as links on a node and they would usually be verbs like 'reject' which describes the review => rework transition. these same links could show up in Views table listings. the destination of those links would be the workflow tab with the right destination state selected in the radio button. then all that is needed is to add a workflow comment and click submit.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jvandyk’s picture

+1 for transition labels. This is a must for workflow-in-core-in-5.0.

moshe weitzman’s picture

jvd or other - any comment beyond what i mentioned about where these labels should be used?

jvandyk’s picture

Most workflow systems use the transition labels as labels for buttons that execute the transition.

In thinking about a very basic default workflow and UI for Drupal, I like the idea of comments not enabled by default, and clicking on the button executes the transition. That's about as simple as it gets.

For advanced workflows we could enable commenting and the workflow tab.

moshe weitzman’s picture

thanks ... consider the 'published' checkbox on the node form in drupal core. if we turn that into a button, then how does that interact with the saving of the whole node form? i'm having some trouble visualizing how that will work. in some ways, the current mechanisms (checkbox in core, radio buttons for states in workflow) fit in better than buttons.

MrTaco’s picture

i've already implemented this if anyone would like the code

jvandyk’s picture

Attaching a patch here would be nifty.

moshe weitzman’s picture

@MrTaco - plase provide patch if possible

ntt’s picture

subscribing

deekayen’s picture

I got MrTaco's code and made a patch, but didn't see this issue and put it at #227038: Add named transition states. Then I apparently made an even bigger mess by making http://drupal.org/project/workflow_named_transitions. There are some bugs in it and I am working through them, but is this something I should be working back into core workflow or is it better off an a separate module?

jvandyk’s picture

I'd like to see it in core workflow, even if it's not required by default (requiring named transitions makes configuration tedious for basic workflows).

myshkin’s picture

If could have a 'next' or 'default' transition that would go to the next node if it hadn't been created, but could be overridden if that transition had been explicitly defined. The caveat being that I would want to be able to force the 'next' transition to return to the same state so that I could put my Error states after the completion states and not worry about a default transition moving into the error state.

Monzer Emam’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Assigned: moshe weitzman » Unassigned
Priority: Normal » Major

Transition labels from POV is important as it should achieve the following :

  1. By defining labels will define also what is possible transitions like "Draft->Reviewed", "Reviewed->Checked" and "Checked->Published" only.So transition like "Draft->Published" if not desirable without defining a label for it should be available.
  2. Also the transition labels will be used in "Workflow Edit" rather than see table with rows and columns cout of workflow stats. As for example if the wok flow has 4 stats then a table with 25 cells ((4+1)^2) will be in edit screen and if workflow has 8 stats then a table with 81 CELLS!!! will be there.

    And more worst in each cell all roles will be there (really Something not desirable).
    But Using labels in workflow with 8 stats (normaly will be in it less than 15 transition) so this will result in table with 2 columns only with 15 rows (Simpler to read and work with).
  3. The project workflow_named_transitions Should be built-in Workflow itself
RdeBoer’s picture

I've released a module that builds on the lovely "Workflow Named Transitions" module (without being dependent on it). It takes the concept one step further to get rid of the radio buttons altogether, replacing them by single action submit buttons.
See Workflow extensions

Bastlynn’s picture

This seems UI related and button related and generally a good idea once other issues are resolved. Saving this one in the queue for now.

Bastlynn’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev

Bumping this up to 7.x to be backported to 6 once finished in 7.

NancyDru’s picture

Status: Active » Closed (duplicate)

I'm in favor of leaving this in Workflow Extensions unless Rik wants to become a maintainer here and merge it.

RdeBoer’s picture

Rik doesn't feel like becoming a maintainer of Workflow -- too much work!
Rik

NancyDru’s picture

Yeah. Please remind me, why did I become one?

RdeBoer’s picture

Because you're doing a great job, Nancy!
Massive efforts, first by Bastlynn and now you.
We're all eagerly awaiting 7.x-1.1 becoming official...
Rik

johnv’s picture

Title: transition labels » Add named, labeled transitions
Version: 7.x-1.x-dev » 7.x-2.x-dev
Priority: Major » Normal
Issue summary: View changes
Status: Closed (duplicate) » Active
Related issues: +#867186: [EXPORTING] Add machine names to workflows and workflow states

Re-opening this:
- Workflow Extensions is not compatible anymore with 7.x-2.x
- Workflow Named Transitions is not compatible anymore with 7.x-2.x
See #867186: [EXPORTING] Add machine names to workflows and workflow states for adding machine names.

  • Commit f9abfd4 on 7.x-2.x by johnv:
    Issue #0073412: Fixed a long-standing issue by adding a machine_name and...
johnv’s picture

Version: 7.x-2.x-dev » 7.x-2.2
Status: Active » Fixed

Wow, a five-digit issue can now be closed.

I've taken the code from workflow_named_transitions, and added it to this module.

It required:
- one extra field in the workflow_transitions table;
- one extra page in workflow_admin_ui;
- few lines in WorkflowState->getOptions;

The patch is rather big, but includes some re-organizing of files.

It does not include token support from workflow_extensions. See #2249211: Add token support for Transition labels.

  • Commit a48afed on 7.x-2.x by johnv:
    Issue #0073412: Removed hardcoded text on action buttons, since they can...
preddy’s picture

Transition label UI form do not display data under 'from' state column except for first row.
Attached patch resolved for me. Could you please check if this is fine.

johnv’s picture

This was done on purpose for better UI. I set first column on change of from-state. Else you have a long list en get lost .
Do you think the data is wrong after this explanation?

preddy’s picture

FileSize
9.91 KB

condition $old_state == $new_state returns false as they are different states and print '' from second row on wards..
Attached screen shot with data issue.

johnv’s picture

Ah, you must save the transitions first. Until now the stayOnThisState was not saved. Now it is but you must resave them .
This needs an update hook or help text.
[EDIT] After our private conversation, it shows that update.php did not run, yet.

preddy’s picture

Agree with comment in #25 and patch in #24 is not required. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

johnv’s picture

Title: Add named, labeled transitions » [EXPORTING] Add named, labeled transitions