One of the many great improvements of Liferay 6 is the workflow system, as many of you already know. We have been working hard on it and we have developed lots of new functionallities that we're sure you'll love.
In this blog post I'll implement a use case so that you can see workflow in action, and by the way, I announce that in the wiki we've created a series of articles that describe the workflow portlets and what are they for. You can read them by clicking in this wiki link: http://www.liferay.com/es/community/wiki/-/wiki/Main/Workflow
In this example we will create the following users:
Reader: this is a simple user that is a member of the community "My Use Case Community"
Content Writer: this is the content writer of the community. He's able to create web content
Content Reviewer: this is the person in charge of controling the content that is going to be published. He can decide if the web content is correct or not.
Content Publicator: this is the member of the community that publishes content, add new applications to the community and so on.
Portal Admin: super user that will prepare the environment of this use case
Configure the environment:
With the portal admin, I create "My Use Case Community" and the four users, which I assign to the community as new members.
Assign roles and permissions:
Assign the "Community Content Reviewer" role (which is an autogenerated role from the workflow definition) to the user "Content Reviewer", so that he can review content
Assign the "Community Administrator" role to "Content Publicator" so that he can manage everything in the community
Create a new community role called "Content Writer" and assign it to "Content Writer". This role would have web content's permissions (I don't usually give him "delete" and "permission" permissions, but that's up to you) and access in control panel, so that he can create web content from the control panel (this is not strictly necessary, as he can create web content from the asset publisher, for example)
Important: Enable the workflow for this community's web contents: Go to "Control Panel", "Workflow configuration" and select your workflow definition (by default kaleo provides "Single Approver" definition) in the "Web content" entry.
Now, let's start working!
The workflow system in action:
1.- Creating the content
Login as the "Content Writer", go to the control panel and create a new web content. Notice that the available buttons are "Save as draft" and "Submit for publication", so that the user knows that he can't publish directly (by the way this is a good way to know that the workflow engine is correctly applied to your community). Click "Submit for publication".
In this moment, the workflow engine starts. The user can see that the content's status is "pending" and he can't modify the content till it's reviewed.
From this moment on, the content writer can follow the process in the "My Submissions" portlet. There he can see the internal workflow status and if he realizes (for example) that he wants to modify something in the content, he can withdraw the submission.
2.- Reviewing the content
It's time for the "Content Reviewer" to start working.
The main part of the reviewer work is going to be done in the "My Workflow Tasks" portlet, so let's go there.
In the "Assigned to my roles" view, you'd see the pending tasks and you can assign the task to another user or yourself.
I assign it to myself
In the detail view of the task, you can view and edit the content, read the recent activity of the task, view the status and change its status (in this case approve or reject, but this would depend on the workflow definition)
In this moment, there are two possibilities:
a) The reviewer rejects the content: he writes the reason in a popup and the content goes back to the writer, so that he can edit/fix/improve it
b) The reviewer approves the content: he (maybe after editing the content so that it fits the portal's rules) approve the content and the content's status is updated to "approved".
3.- Publish the content
The user "Content Publicator", that handles the portlets and has publishing rights, now can go to the community pages and add a web content display portlet with the new content in it
4.- Access the content
The user "Reader" (who, remember, has no special permissions, but is a community member) is now able to view the new web content
Remember that, out-of-the-box, liferay 6 provides the hability to enable workflow for these entities:
1. Wiki Page
2. Web Content
3. Document Library Document
4. Blogs Entry
6. Message Boards Message
And you can extend this functionallity to your custom portlets.
We are looking forward to hearing your feedback!
Liferay Core Engineer