Integrating Liferay with Camunda

Building a Real Workflow Portal (Production Guide)

Introduction

In most enterprise BPM projects, a common question always comes up:

Where do we build the real business UI for Camunda workflows?

Camunda is excellent at:

  • BPMN execution

  • Process orchestration

  • State management

But it does not provide:

  • Rich business portals

  • Role-based dashboards

  • Enterprise forms

  • Workflow-driven UIs

That’s where Liferay DXP fits perfectly.

In this blog, you will learn:

  • Why Liferay + Camunda is a powerful combination

  • The real production architecture

  • Integration patterns

  • Step-by-step technical approach

  • Common pitfalls

  • Best practices


Why Integrate Liferay with Camunda?

Camunda and Liferay solve different layers of the same enterprise problem.

LayerToolResponsibility
UI / PortalLiferay DXPUser experience, dashboards, forms
ServicesSpring BootBusiness logic
Workflow EngineCamundaBPMN execution
EventsKafka (optional)Async integration

So in real systems:

User Portal (Liferay) ↓ Spring Boot APIs ↓ Camunda BPM Engine ↓ Kafka / DB / External Systems

👉 Liferay becomes the missing UI & experience layer for Camunda.


Real Use Case – Approval Workflow Portal

Business scenario

An enterprise wants to build a:

  • Purchase approval portal

  • Role-based UI (Requester, Manager, Finance)

  • BPMN-driven approval flow

  • Audit-friendly system


Business flow

  1. User submits a request in Liferay

  2. Liferay calls a Spring Boot API

  3. Spring Boot starts a Camunda process

  4. Camunda routes tasks to approvers

  5. Approvers complete tasks via Liferay

  6. Liferay calls Camunda REST

  7. Workflow continues

  8. Process completes


🔷 Architecture – Liferay + Camunda

Liferay Portal ↓ Spring Boot API Layer ↓ Camunda REST API ↓ Camunda BPM Engine ↓ Database / Kafka

Integration Patterns

Pattern 1 – Liferay → Camunda (Start a Process)

Liferay portlet calls Spring Boot.

restTemplate.postForObject( "http://localhost:8080/start-process", payload, Void.class );

Spring Boot starts Camunda process:

runtimeService.startProcessInstanceByKey( "approval-process", variables );

Pattern 2 – Camunda → Liferay (Task Inbox)

Liferay fetches user tasks:

GET /engine-rest/task?assignee=john

Displays them in a portlet.


Pattern 3 – Liferay → Camunda (Complete Task)

POST /engine-rest/task/{id}/complete

Step-by-Step Technical Setup


Step 1 – Expose Camunda REST

Make sure Camunda REST is enabled:

/engine-rest

Test:

http://localhost:8080/engine-rest/engine

Step 2 – Build Spring Boot API Layer

This avoids tight coupling between Liferay and Camunda.

@PostMapping("/start-process") public void startProcess(@RequestBody Map<String, Object> payload) { runtimeService.startProcessInstanceByKey( "approval-process", payload ); }

Step 3 – Build Liferay Portlet

Call Spring Boot API from Liferay:

public void submitRequest(ActionRequest request, ActionResponse response) { Map<String, Object> payload = new HashMap<>(); payload.put("amount", ParamUtil.getInteger(request, "amount")); restTemplate.postForObject( "http://localhost:8080/start-process", payload, Void.class ); }

Step 4 – Display Task Inbox in Liferay

ResponseEntity<Task[]> tasks = restTemplate.getForEntity( "http://localhost:8080/engine-rest/task?assignee=john", Task[].class );

How BPMN Fits In

Your BPMN process might look like:

Start Event ↓ User Task (Manager Approval) ↓ User Task (Finance Approval) ↓ End Event

Liferay provides:

  • Data entry UI

  • Task inbox

  • Approval UI

Camunda provides:

  • Routing

  • State

  • Workflow logic


Security Considerations

✔ Use OAuth2 between Liferay & Spring Boot
✔ Never expose Camunda REST directly to UI
✔ Use service accounts
✔ Map Liferay users to Camunda users
✔ Enforce role-based access


Error Handling Strategy

✔ Retry REST calls
✔ Use boundary events in BPMN
✔ Handle timeouts
✔ Use dead-letter queues (Kafka)
✔ Make UI idempotent


Performance Considerations

✔ Cache task lists
✔ Paginate Camunda REST calls
✔ Avoid polling too frequently
✔ Use async continuations
✔ Externalize long-running logic


Common Production Mistakes 🚨

❌ Calling Camunda REST directly from portlets
❌ No API layer
❌ No authentication
❌ Hard-coded endpoints
❌ No retry logic
❌ Tight coupling UI ↔ BPM


Best Practices (Field-Tested)

✔ Always use a Spring Boot API layer
✔ Treat Camunda as orchestration only
✔ Keep portlets thin (UI only)
✔ Use BPMN for routing
✔ Use Kafka for events
✔ Version REST contracts
✔ Monitor Camunda REST health


Interview Question (Very Common)

Q: How do you integrate Liferay with Camunda safely?
A: Using Liferay as the UI layer, Spring Boot as the API layer, and Camunda REST for workflow orchestration.


Final Takeaway

Camunda + Liferay is a real enterprise-grade BPM portal architecture.
❗ They are not competitors — they are complementary.

If you need:

  • Workflow portals

  • Approval systems

  • Case management UI

  • BPM-driven dashboards

Then Liferay + Camunda is one of the strongest combinations available today.


💼 Professional Support Available

If you are facing issues in real projects related to enterprise backend development or workflow automation, I provide paid consulting, production debugging, project support, and focused trainings.

Technologies covered include Java, Spring Boot, PL/SQL, Azure, CMS and workflow automation (jBPM, Camunda BPM, RHPAM).



Comments

Popular posts from this blog

jBPM Installation Guide: Step by Step Setup

Scopes of Signal in jBPM

OOPs Concepts in Java | English | Object Oriented Programming Explained