Personalization of a standard Magnolia workflow: segment your users!

Magnolia CMS ships with a pre-configured 4-eyes workflow where every content must be approved by the same group of people, so called “Publishers”.
This can cover 90% of projects, where editorial team is not big enough to allow content segmentation or workflow escalation.
But what happens when you are in a big project, you have a big editorial team and you have to segment your content workflow?

The standard approach would be:

  1. Download Magnolia source code
  2. Change the 4-eyes BPML2 diagram (you need Eclipse, jBPML plugin, …!)
  3. Inject your logic
  4. Deploy the new 4-eyes workflow

..but..is it really necessary? Of course, not.

As usual in Magnolia, JCR configurations help us on this task.
We need to store somewhere the mapping (JCR path to workflow group) and one right place can be the publish task in the workflow-jbpm module.

wf-by-path-001

With this mapping, any activation from /demo-project will be authorized by people belonging to the “demo-project-publishers” group and any /demo-features activation by people belonging to the “demo-features-publishers”. Just a note: since multiple group can be added to any activation, we’ve left “publishers” group on purporse, to be compliant to a standard Magnolia installation and to allow superuser to do (almost) everything on our activations.
That configuration is read by a Java class (for simplicity, ExtendedConfiguredPublicationTaskDefinition), that need to be extended in order to handle the mapping settings we just added. Here the Java code:

And here the mapping class, GroupsMapping:

And finally, we can easily handle that with a resolver class, ExtendedPublicationTaskParameterResolver:

Let’s try that. We need to start 2 publications, one for each site tree:

wf-by-path-002

wf-by-path-003

As recommended, superuser can see both of them..

wf-by-path-004

.. but what can see other users? Try to log in with Frank, a new user belonging to demo-features-publishers:

wf-by-path-005

He now only see the relevant publication. The other one does not appear to this user.

wf-by-path-006

If you want to see what happen behind the scenes (aka: into JCR), just create a content app that list all Task repository: everything is there:

wf-by-path-010

Quick. And clean.

Latest articles

Matteo Pelucco Written by:

2 Comments

  1. Carlos
    July 24

    How I can Download Magnolia source code???

  2. September 14

    I like the valuable information you supply to your articles.
    I’ll bookmark your blog and check again right here regularly.
    I’m relatively sure I’ll be informed lots of new stuff proper right here!
    Good luck for the next!

Leave a Reply to weight loss Houston tx

Your email address will not be published. Required fields are marked *


− three = 4