Now that https://www.drupal.org/project/workflow module works smoothly with other entities, I think it should also work well with group module. Has anybody tried this combination in Drupal 8? Would be great to have some inputs.

We are trying this out and will share our notes shortly.

Comments

gokulnk created an issue. See original summary.

kristiaanvandeneynde’s picture

Category: Task » Support request
timmillwood’s picture

Issue tags: -Workflow Initiative

Not sure this is a "Workflow Initiative" issue.

pminf’s picture

There is already a feature request for the similar module worbench.

In Drupal 8 it would be more sufficient to integrate with the core initiative "Content moderation" since it will be probably replace Workbench.

https://www.drupal.org/node/2581253#comment-11847842

"Content moderation" might replace the workflow module too, so let's focus on the core initiative.

jlscott’s picture

I believe that the workflow project does a lot more than content moderation, and my experience is that it has the flexibility required to build business applications based on Drupal. I am keen to see this issue progressed.

I have both workflow and group enabled, and have implemented a workflow on a group type. My observations so far:

  1. Workflow works fine with group entities for normal transitions and the rules around roles and permissions demonstrate expected behaviour.
  2. Implemented hook_workflow, switching on $op=='transition_pre', returning "FALSE" for transitions that should not be permitted. The transition happens anyway, although the watchdog log reports that the transition was "vetoed by a module".
  3. Implemented hook_entity_update to take some additional actions for group entities that are permitted to transition, shows that this hook is called BEFORE the hook_workflow with an $op == 'transition_pre' in item 2.

I will try to find time to investigate these issues.

Chris Gillis’s picture

Work is underway to integrate with D8 Core Content Moderation. That should pave the way for this by sorting out some logical issues. #2906085: Content moderation integration: transition permissions and latest version access

jnicola’s picture

https://www.drupal.org/project/group_workflow

Already got a decent start on this. Check it out and let me know if you'd like to get involved.

My project changed direction on me and we're now looking at implementing content moderation, so development on the above is likely at a standstill.

vierlex’s picture

Hi,

I am also pretty interested in this.

@jlscott I activated workflow and content moderation, but the group type doesnt show up while editing a Workflow under
http://net-app.docksal/admin/config/workflow/workflows .. how did you test it with group entities?

margyly’s picture

I'm also interested in this.

jnicola’s picture

As an update to my organizations use, we're currently using Content Moderation.

It overwhelming works, except one bug... when you create a piece of node from a group and relate it, the workflow state is not saved for whatever reason.

The bug may exist in Workflow, or in the way groups carries the original node entity onwards... but as a workaround you capture the workflow state form value on submit, and force it on entity update a singular time.

So other than that hiccup, it's working.

jlscott’s picture

@vierlex I have content entities that can have group membership and have workflow enabled. All content entities of a particular type (eg articles) use the same group type, and the same workflow. The workflow does not apply to group_content entities, and I am not sure of a use case for that?

vierlex’s picture

@jlscott ah alright!

I am currently thinking about how to.. well structure the content and I am not sure how to so I can build views for all of this easily..

The thing is, I have group type "Project" and it has all sorts of custom Entities related to it
(instead of entities with membership, I could have had reference fields at the group type itself.. where is the difference..? whats "better"?)
but Id like to add a workflow to this group entity (not group content entities) to reflect its current state.

jlscott’s picture

@vierlex. I understand now. You are after a workflow on the group entity rather than a content entity. Groups are fieldable entities, so you should be able to add a workflow state field to a group type. My initial tests indicate that this works as expected, and that a group can be transitioned from one state to another as per the workflow configuration.

devkinetic’s picture

I've also been using workflows for business applications via a patched workflows_field module, it is STELLER, but I had to write a custom module that modeled content moderation. I now have dynamic entity operations for transitions, modal dialog integration, the silly widget for changing states. What we need is buried in content moderation and workflows_field. It needs to be pulled out and made functional.

For groups and content moderation, along with permissions, group entity would need publish states and revision support as well.

Not all workflows need revision-able entities, not everything fits into content moderation.

devkinetic’s picture

Another note, Group permissions for transitions. Right now I have a matching system role I dynamically add to users. This only works for one group per user.

oktboy’s picture

We want to create Group permissions for transitions. The user can be in different groups with a different role, so having transition permissions per role at the user level does not work. We want to silo each group where a user can have different roles in different groups.

Has anyone come up with a solution with Workflow or State Machine?

shelane’s picture

Here is the newest module that does this functionality for content moderation:
https://www.drupal.org/project/gcontent_moderation

It does exactly what was asked about in #16