I'm looking into how to construct a basic workflow for a site I'm building on Drupal 7 using the Rules module. I'm using a tutorial I found located here:
https://www.drupal.org/node/1027546
The tutorial seems slightly out of date (has at least one todo in it), and I'm confused about how to set things up properly in some areas.

Context: I'm constructing a very basic publishing workflow. Editor role creates content ==> Editor changes content workflow to "Request Review" ==> Email notification sent to publisher ==> Publisher reviews content and is ok with content ==> Publisher switches workflow state to "Publish" ==> Workflow publishes content to site

Here are the questions I have based on the tutorial listed above:

  • How do I prevent the editor role from being able to switch the workflow to "Published?" The tutorial has a section labeled "Enable Form Events" that suggests how to start doing this, but I'm not sure if the instructions are complete. There is a TODO listed here. I found and installed the Rules Form Support module that the tutorial seemed to be pending on, and I think I applied the correct setting, but I don't know how the prevention error message is supposed to be generated to the Editor role.
  • How do I access rule sets? The tutorial mentions sets in the section labeled "Create a rule to set unpublished content..." I besides the rule creation section, I can't seem to find the area that allows you to define rule sets.

I thought I had another question, but it escapes me at the moment. Thanks for your time.

Comments

Chasen’s picture

Just a couple of ideas here you may want to explore:

For the first issue, you could maybe use the content permissions module to make the editor created content published, but not visible to anon users, and then use rules to, on a content by content basis, enable that permission. There's content permission modules that allow you to set both content type, and also individual node permissions so maybe could control it that way?

With Rules, it comes with a predefined set of actions/components or you can create your own - the main thing to remember with rules is, just like Views, the data you have access to is structured and has walls, so for example in Views you if you create a User view, you have access to the User table and related tables, but if you wanted to link to Content data you'd need to import that as a relationship - this is similar with Rules, depending on how you build your rule will give you access to certain pieces of data and working out how best to structure your data access can be time consuming but will ultimately define the scope of your actions (i.e. what happens once your workflow triggers)

Perhaps you could create a new rule on new content creation that equals your content type to set it as unpublished (basically, the editor creates the content as published and the system immediately unpublishes it) and then that triggers an email for review ruleset or something like that. However it will get a bit tricky as you'll need to control the permissions of your editor users as they'll likely have permission to edit (and potentially re-publish) their own content.

IsaacB’s picture

I almost forgot to reply to this thread...

Thank you for your reply! I think I found a general solution using Rules and the Rules Form Support module to suit my needs. Once I became more acquainted with the two modules, I found that I could have a lot of power in controlling the fields and their elements based on the assigned roles of the active user. As such, I was able devise a way to present only the relevant workflow fields to the intended user and hide the irrelevant ones. That method largely addressed everything I was intending to do with this particular task.

Thanks!