In the following blog post, I have highlighted the matter of embedding Activiti BPMS inside a Liferay Portal. With Activiti Explorer built in Vaadin and Spring, it is fairly easy to use entire components in a totally different environment.
Proof of concept fork with Tasks and Admin portlets is available in
Porting Activiti Explorer to Liferay Portal
Please note, that embedding Activiti in portal is not the same as using it to manage portal assets - for example, as a replacement for Liferay's Kaleo Workflow. The matter discussed here is more focused on using all of Activiti features, including user interface.
Extracting and re-using entire components requires much more work in a classical MVC approach and even may not always be possible. Also, portlet support in Vaadin makes a whole task much more pleasant.
- Portlet descriptors are necessary
- GUI should be divided into separate portlets
- Spring-Vaadin integration is different due to a portal-specific request life-cycle
- Navigation can be provided by portal - including friendly URLs, which makes for a more standard user experience.
- Users and Groups should be managed by Liferay Portal
- Authentication data should be taken from a portlet container
- Mail notifications could possibly use Liferay Mail API
- Distribution and management of Vaadin widgetset and version - we should use Vaadin Control Panel portlet and Liferay to manage Vaadin dependencies. This requires special handling, since Activiti Explorer 5.13 utilizes dCharts Vaadin Add-on.
- Vaadin theme used in portlets - which is also customized by Activiti, but should be coherent with portal's look & feel.
Current state of work
- Activiti Tasks portlet, which works in a user's context as if the user would log in to Activiti Explorer app. The portlet provides full functionality, including operations as starting a new task, fetching it from a task list, displaying task's events, assignment/ownership transfers, file attachments and so on.
- Activiti Admin portlet in Liferay Control Panel - most tabs seem to work fine - except Users and Groups, which should be disabled as we are using Liferay Portal to do that.
- IdentityProvider implementation utilizing Liferay API (need to work on user photos though!)
- Spring-Vaadin bridging for portal (see my previous post).
- Custom portlet applications and main Window class. The interesting detail here is that with Vaadin portlets, you should not set width of components to 100%, as it will result in 0px height. Generally speaking, the height in Vaadin portlet components should be set to undefined - null, or a preset value in pixels.
- More portlets! Reporting and Processes tabs need their respective portlets, but also "start process" portlet might be worth considering since we can manage UI contents in a more flexible way.
- More testing! If anyone is interested in testing Activiti portlets in Liferay, let me know and I will provide prebuilt applications. So far, I've used Liferay 6.1 GA2 CE and H2 in-memory database for Activiti.
- Friendly urls - especially for tasks resolved by id, and for interportlet communication - e.g. when starting a process.