Sunday, February 12, 2012

Assigning a Workflow to the Web Form

Alfresco includes two types of workflow out of the box. The Simple Workflow is content-oriented, and the Advanced Workflow is task-oriented. Out of the box, the Simple Workflow has only two steps, one for approval and one for rejection.

Here is one way to assign a Simple Workflow to the Web Form, if it is associated with a Web Project.

Navigate to Company Home -> Web Projects, select the web project and choose Actions -> Edit Web Project Settings in the top right part of the screen. Select "Next" until you get to the "Configure Web Forms" screen. If the web form does not have a workflow associated with it, a small exclamation mark will be displayed.

Workflow not Configured

Select "Configure Workflow". On the "Configure Workflow", use "Search" option to display users. Choose a user which will be reviewing and approving content and select "Add to List".

Add Users to Workflow

Click "OK" on the right to complete the workflow configuration. The exclamation mark should no longer be displayed. Select "Next" to get to "Configure Workflow" screen. There should only be one workflow available, "Web Site Submission". Select "Add to list". Once again, the exclamation mark will be displayed.

Configure Web Project Workflow

Use the "Configure Workflow" in the same way as was done for a web form. Select "Finish" to save changes. Now it is time to create some content and check what the workflow does. On the Web Project screen, select "Create Content" against the web form for which the workflow was just configured. Create some content and on the last screen check the "Submit these X files when wizard finishes". Select "Finish". (I'm not exactly sure if that's the correct way to go - did I have to configure workflow twice, first on the web form and then on the web project? Maybe not. I think, the way to avoid it is to add workflow at the time of creation, both on a project and a form. That would likely be the best practice.)

Submit Items When Wizard Finishes

Now the wizard asks to provide some more details, so fill in the Label and Description for the items being submitted. Select "OK" to submit.

Submit Items

Next, log out from the user who created content and log in as a user who was specified as a Content Manager. "My Alfresco Dashboard" will be displayed, where under "My Tasks To Do" the task to review the submission should appear. Select "Manage Task" to review the submission.

My Tasks To Do

Let's first reject the submission. Provide the user with some helpful comment and select "Reject" on the right.

Review Workflow Task

Now you should be back on the "My Alfresco Dashboard" and you can notice that there are no more entries under "My Tasks To Do". This means that the hard job of the content reviewer is done for now. Log off as this user and log back on as the content creator. Now you'll be on the "My Alfresco Dashboard" and you'll see that you have a task to do, which has a "Rejected" type. Use "Manage Task" to fix this! On the "Manage Task" screen you can see joe's comment, so select "Edit" icon to modify the content. Make the changes and save them. Now on the "Manage Task" screen, select "Resubmit for Review" on the right. Logout as this user and log back on as the content reviewer. There's a task now in the "My Tasks To Do", with a small (2), which tells me how many times the content was submitted. Choose "Manage Task".

My Tasks To Do - 2

Now the content looks better (let's at least assume that) and the reviewer selects "Approve". Again, the task is gone - log out one last time and log back on as the content creator. There are no more tasks too, but navigate to the Company Home -> Web Projects, select the web project and expand "Recent Snapshots". Now there is the content there which can be deployed, as described in a previous post - feel free to deploy if you wish.

Recent Snapshots

by . Also posted on my website

No comments: