The workflow services allows a user to define through the workflow portlet any number of simple to complex business processes/workflows, deploy them, and manage them through a portal interface. The power of this portlet is that it allows users to create forms-based data entry applications that have knowledge of users, groups, and roles without writing a single line of code – it only requires creation of a single XML document. The portlet relies on Apache ServiceMix to function as an Enterprise Service Bus that acts as a broker between the portal and a workflow engine. Essentially, the portal provides a generic interface through which workflow services are requested via normal HTTP calls. The requests are routed through ServiceMix which in turn calls a workflow engine implementation that the user has defined in the ServiceMix configuration. By default, Liferay provides an implementation of JBoss’ jBPM workflow engine (version 3.1.2).
The next section provides detailed installation instructions for setting up the environment for using the Workflow portlet. The instructions are for Tomcat, but can be easily adapted for any application server. After installing, refer to the user guides for more information on how to use the workflow portlet to create custom business processes.
Because the default implementation of the workflow portlet depends on both ServiceMix and jBPM, the installation requires more than just the normal portal bundle. The following provides detailed instructions for deploying the workflow portlet and testing it with a simple process.
It is assumed that Liferay Portal has already been installed following one of the procedures explained earlier. If it's currently running stop it.
Download the latest version of liferay-portal-servicemix-4.3.x.war and liferay-portal-jbpm-4.3.x.war (substituting the 'x' with the highest number available) from Liferay's download page. Rename them to “servicemix-web.war” and “jbpm-web.war” respectively.
Move the wars from step 2 to the
$TOMCAT_HOME/webapps
directory.
Delete the C:\home\liferay directory if it exists.
Go to the $TOMCAT_HOME/bin
directory
and run startup.bat
.
To test the installation we are going to use the Workflow portlet to create a simple definition and add and instance of it:
Login to the portal. The default user is [email protected] with password test.
Add "Workflow" portlet to a page.
Click on the Definitions tab.
Click on the Add button.
Copy and paste the contents of
jbpm-web.war/WEB-INF/definitions/datatypes_definition.xml
into the text area and click the Save New
Version button.
Click on the Add Instance icon.
From the Instances tab, click on the Manage icon next to Enter data.
Fill out the form and click the Save button; alternatively, you can test the various error checking capabilities by inputting incorrect values and clicking the Save button.
Eventually, enter correct values and click the Save button.
From the Instances tab, click on the Manage icon next to View Data.
Confirm that all the data was entered correctly and click the Finished button.
Confirm that the instance is now in the End state.
The default implementation of jBPM uses an HSQL database found in jbpm-web.war/WEB-INF/sql/jbpm.*. To change the location of the HSQL database, change the value of the hibernate.connection.url property in jbpm-web.war/WEB-INF/classes/hibernate.cfg.xml. The location is addressed to where the start up script for your server is located.
To use a database other than HSQL, first create the database schema using one of the SQL create scripts supplied in the jbpm-web.war/WEB-INF/sql directory. Then uncomment the corresponding hibernate connection properties block in jbpm-web.war/WEB-INF/classes/hibernate.cfg.xml.