Sunday, August 30, 2015

Working with Kaleo Workflow in Liferay

Liferay portal used Kaleo workflow implementation to run their application through workflow management. Out of box Liferay support other workflow implementations which follows the JBPM notation.

Please follow previous post for basic understand about workflow management.


Enable Workflow in Liferay

Liferay by default workflow support to some assets like Web Content, Blogs, Wikis, User and Massage Boards apart from these we can also implement workflow to custom assets.
We will take web content as example for enable Kaleo workflow. We have different levels of workflow for now we will enable single approval workflow.

Step: 1

First we need to check whether Kaleo workflow available in Liferay portal or not. From Liferay 6.2 onwards Liferay Server Portal Bundle already deployed Kaleo-web workflow implementation web application so that we don’t need to deploy again.

If not deployed then download kaleo-web web application from Liferay market place and deploy into your portal server.

We have two types of licenced Liferay i.e.  Liferay CE and Liferay EE based on your portal download Kaleo-web from market place and also make sure your portal version.


Note:

I have written post based on Liferay 6.2 Version before version may have different UI and option to enable and work with workflow.

Checking Kaleo Workflow Available in Portal

Login as portal administrator in the Liferay Portal


Go to Control Panel


Configuration Section you can see workflow Feature. If not then look at what is problem while deploy Kaleo-web.


Details about Single Approval Workflow for Web content.

Asset Type:
Web Content
Workflow Definition
Single Approval Workflow

Kaleo Engine by default have single approval workflow definition so that we can directly use it. If you want new workflow then we need to create workflow definition and upload into Kaleo Workflow Engine so that it can be available. Now we will enable single approval workflow.

Concept in single level approval for web content is there is user i.e. content creator will create content and sent to review the content. Once reviewer review the content then he/she can approve or reject the content. If it approved then only Web content available for use otherwise it will be in draft mode.

Single Approval workflow is working based on roles so that in the definition specified roles will be create by workflow engine if roles not available.

As for single approval workflow we have new roles already available as follows.

Role
Description
Organization Content Reviewer
This role user review the web content published in the organization and   he/she can approve or reject content.
Site Content Reviewer
This role user review the web content published in the site and   he/she can approve or reject content

Behaviour of Web content without Workflow.

If the web content not have workflow then as soon as you create the content and you can publish content directly and it will be available for use.

Behaviour of Web content after enable Workflow

Once we enable workflow to web content then content creator cannot publish directly rather then he/she can send it for content reviewer who having the role of Site Content Reviewer/Organization Content Reviewer.

Step: 2

Now we will create new user for content review and we will assign role of Site Content review.

Site
Liferay/Global
User
Sitecontent_reviewer@liferay.com
Role
Site Content Reviewer
Task
Review the web content.

Go to control panel and click on users and organization link



Click on Add new User




Enter all required details and click on save then user will be created



Once save the use then Right side you can see many option, click on  password section give some password to user let’s say test and you should remember password for next login and save it.


Now assign this user to Liferay/Global Site. Click on sites then it will ask you to select the site from list of sites.



Select Liferay and save it now user is associated to Liferay Site.



Now assign site Roles to user. Click on role link and select site role that is Site Content Reviewer role.



Once you select the role click on save so that Site Content Reviewer Role is assigned to the user.




Step: 3

Enable Single Approval Workflow to Web Content

Login as Portal Admin and go to control panel and click on workflow



You can see 3 tabs Definitions, Default Configuration and Submissions


Definition Tab:

Definition tab will shows you what are the definitions are available in the workflow engine.


We can also upload new definition xml file through upload definition link and it will ask you to browse new xml definition file.


Default Configuration Tab:

Default Configuration tab will shows you the assets which can be configured by workflow. Click on Default Configuration tab you can see all assets.



Now select web content and in the workflow dropdown you can see list of workflow definition there you can select Single Approval Workflow and save it.


Now web content is enabled by singe level workflow and if we submit any web content it should be reviewed.

Submission Tab

Submission tab shows list of tasks the user submitted through workflow process. Here you can see two sub tabs pending and completed

Pending

Till workflow process is completed then it will be under pending state list.

Completed

if task completed entire workflow means task is approved then it will be part of completed list.

Pending Sub Tab:


Completed Sub Tab:

Remind Previous Steps

Step: 1 we have cheeked workflow is available in the portal or not it not then how to download and deploy

Step: 2 we have created user and assigned site and required role which is part of workflow definition.

Step: 3 we have enabled workflow to web content and we also have looked into options available in workflow.

Step: 4

Now we will create web content and sent it for review and here we will use portal administrator to create content.

Login as Portal Admin and In the Site Administrator click on Content so that he/she can navigate to dash board there he/she can create web content.


Click on web content so that it will launch web content creation page.



Click on Add Basic Web content so that you can see CKEditor to design you web content


Provide your desired title and design your content finally click on Submit for Publication so that content will be created and it will be enable by workflow and sent to for approval. If approved then only it will be available for use.


Note:

If workflow not enable then you can see button “publish” so that it’s directly available for use.

After Click on send it for publication web content will be created and it will show the status pending



Now go to workflow option see the submission tab then you see newly created web content is under pending list because still content not approved.

Workflow engine also send notification when content is created that you see in the docbar notification and this notification.



Step: 5

Now we will login as content reviewer we already created new user in the step: 2
Site
Liferay/Global
User
Password
test
Role
Site Content Reviewer
Task
Review the web content.

Login as content reviewer



First login it will ask to accept terms and condition then it will ask to change password. Please do all steps finally it will be login into Liferay site.


When the user in the workflow process he/she will be notified with task notification that you can see in the docbar notification



To see workflow tasks go to user My Account page there you can see My Workflow Tasks Tab


My workflow tasks it will be appeared in the pending task list because still he did not do any action the task



Here we can see two sections

Assigned to Me

When workflow task defection based Users assignment then task will be comes under Assigned to Me List.

Assigned to My Role

When workflow task defection based on roles assignment then task will be comes under Assigned to Me List.

Now our workflow definition is based on roles that is why task comes under Assigned to my Rile list.

When task under Assigned My Role then we need to first assign the task to yourself or we can also assign to other user.

Now click on Action you can see tow actions Assign to Me and Assign to..



For now the user is responsible to review the content so we will use Assigned to Me action. As soon as you clicked on assigned to me then task is moved to Assigned to me section and before it ask some comment dialog and give some comments and click on ok.



Now task moved to Assigned to me section now he/she can review the task based on that he/she can Approve/reject the task


Click on the task so that he/she cans see full details of the task and also see the web content.


Actions:

Approve

After review the content everything fine then user can click on Approve Action so that task will be completed and it will be available udder completed list and content will be published then we can use the web content article where ever we need.


Reject

After review content need to add some more addition things then reject content then content will not publish and it will be under draft mode.


Assign to..

Here if the user want to delegate task to some one else then he can click on Assign to then it will ask you the select user to assign this task.


Update Due Date

Some time each workflow task have certain time to review if you want update due date then we can perform due date action so that we can update date for task.



Note:

For each action it will open popup/dialog will ask you the comments so that it will be used as notification and history for each action.

Assume content is everything is fine now reviewer approved the content. Once approved the content then it will be published and it will be available for use.



Once task is approved no more action will be available



Finally task was moved to completed task list of the user.


Once workflow task action is performed he/she will be notified with massage in the docbar notification about workflow task.


Click on completed task list in My Workflow task in the task details you can see Activity panel there you can see history of workflow task.



Now task was approved by content reviewer and it will be available for use.

Now login as Portal Admin go to site administration then click on content, now you can see the web content list. Before we have pending option for newly created web content but this time it won’t be visible because content already approved.



Now go to control panel and click on workflow now task will be in the completed submission list because task is completed.





Friday, August 28, 2015

Liferay Workflow Management Introduction

Liferay portal have many capabilities and its support many other software integration and one of capability that Liferay support workflow management.

What is workflow?

Work flow is sequence small tasks and each task will be processed by different people at different levels finally all together will complete the big task. Here we will divide big task into small tasks and each task will be dependents on other task completion.

What is advantage of workflow?

To automate the complex work. Workflow management will automate the process so that it will be running step by step and work completion will be easy. Minimal physical work and more accurate.

Workflow Example:

Assume we are applying for Learning Driving Licence.


Step: 1

First application will get physical application form RTA (Road Transport Authority Office). Here some application creator/application issuer will give the form to Applicant.

Task/Job:
Issue Driving Licence Application Form
Task Handled By:
Application Form Creator/Application From issuers
Task Result Possibility:
Forward to Further Level /Reject

Step: 2

Applicant will fill the form and submit it at front desk of RTO office. Now Front desk officer will intake the application form and validate all required documents attached to form or not. Address Proof and Date birth certificate like that.

Task/Job
Validate Required Documents those are attached to the application form
Task Handled By
Application Intake Officer
Task Result Possibility
Forward to Further Level /Reject

Step: 3

Now application will be available at Document  Reviewer officer desk and now he/she will  review and validate the documents and here we have some rules like age rule and submitted documents authentication means original or not.

Task/Job
Validate the documents and other required rules.
Task Handled By
Document Validation Officer
Task Result Possibility
Forward to Further Level /Reject

Step: 4

After completion of step: 3 then Examiner call to take some test which is related to traffic rules exam.

Task/Job
Take Traffic Rules Exam, Provide Exam Paper and Conduct Test then evaluate exam score
Task Handled By
Test Conductor

Job/Task: Task Possibility
If Test passed then forward to Next level, If Test failed then Reject.

Step: 5

Based on Step 4 then Licence Issue Officer will sign and issue the licence. It means Licence approved.

Job/Task:
Based on all steps finally Licence will be issued or rejected by Licence Issue Officer
Task Handled By
Licence Issue Officer
Job/Task: Task Possibility
Approve /Reject Licence

Finally Applicant will collect his/her licence from Licence Issuer Desk.
If it reject then Reject Application will be get it from Licence Issuer Desk and will get document related to why it’s get rejected.

In the above process many people are involved and much paperwork and physical work in present. Assume if all the process automate by some software, so that work will be completed faster and it save lot of time, less paperwork and manpower also will be minimal.
Here process will be changed based on type of work and based on work it need different levels of approvals.

Assume some software which can automate work and that can capable of apply different process with minimal configuration then it would pretty good.

To meet above requirements in the real world there workflow software comes into picture so that we can implement application with workflow management so that we can automate work and we can apply different processes on the fly with minimal configuration rather than re-implement new software for each process.

Now we can say workflow is kind of software which can automate  real world complex work and workflow management will divide complex work into different pieces that is task and each task will be processed at different level  by different people finally all successful tasks together complete the complex work.

How do Workflow Management Implemented?

Workflow management followed specification called JBPM (jBoss Business Process Management). Vendors have implemented workflow management software using JBPM specification so that we can use in our application development.


What are the popular Workflow Management software?


What are the workflow management we can integrate to Liferay?

Liferay supported all above workflow integrations at out of box. Liferay default used Kaleo workflow engine and already deployed in Liferay portal so that we can directly use.

From Liferay 6.2 Kaleo workflow available in Liferay portal server bundle if not then you can download relevant version of kaleo-web from Liferay market place and deploy into Liferay portal

What is Kaleo-web?

Kaleo-web is workflow implementation software/application developed by Liferay and we can use in Liferay to enable workflow to Liferay portal applications.it is web application we can download from Liferay market place and we can deploy into Liferay portal and it is available as web application web archive file(.war) .

As we know Liferay have one of the type of plugin called web plugin and Kaleo-web is Liferay web plugin.

How can I check whether my Liferay portal have Kaleo work flow?

Login to Liferay Portal Administrator go to Liferay control panel there you can find the Workflow section under the Portal heading in the control panel. There are three options under Workflow: Definitions, Default Configuration and Submissions. If these are available then we can say portal enabled by Kaleo workflow.

If you are developer go to Liferay Portal Tomcat server webapps directory there you can see web application context Kaleo-web. This indicate Kaleo-web already deployed.


What are the Liferay Portal Application can have Kaleo workflow support?

Liferay portal by default implemented Kaleo workflow support to Document Library, Web Content, Blogs, Wikis, Comments and Wikis.


Can we implement workflow to our custom applications?

Yes we can implement work flow to our custom application and it’s have specific procedure and we will discuss these in the later post.

What is main artefacts required for Workflow?

The main artefact of workflow is workflow definition is xml file there we will define all workflow process as xml tags. We have XML DTD there we can find all definition for each tag and how to use it.

What is use of Workflow definition XML file?

Workflow definition XML is used by workflow engine based on this it will enable workflow process for each application or entity.

How to prepare workflow definition xml file?

Manually we can prepare with editor by follow the workflow definition DTD. Liferay have implemented Kaleo Workflow designer to EE version so that people who are using Liferay EE they can download it from market place

What is Kaleo Workflow Designer?

Kaleo workflow designer is Liferay plugin application provide Graphical User Interface to Design workflow definition so that we can define XML file very easy.
This application only available for Liferay EE and Liferay CE manually prepare the workflow definition xml file.


Author

Recent Posts

Recent Posts Widget

Popular Posts