jBPM Workflow Tutorial: Start → 👤 Human Task → ✅ End (Step-by-Step)

🚀What you’ll build

A minimal jBPM process with three nodes: Start → Human Task → End. You’ll deploy it from Business Central, start an instance, and complete the human task as an assigned user.


⚙️🛠️ Prerequisites

  • 💻 jBPM/Business Central & KIE Server bundle (7.x or 8.x community)

  • ☕ JDK 11+ (JDK 17 is fine)

  • 👨‍💼 User with roles: admin, analyst, developer, manager, kiemgmt

  • 🌐 Browser access to: http://localhost:8080/business-central


📝 Step 1: Create a Project in Business Central

    1. 🔑 Log in → Design → Projects → Add Project

    2. 📂 Name: hr-approval

    3. Add Asset → Business Process → Name: SimpleApproval


🎨 Step 2: Draw the Process (🔵 Start → 👤 Human Task → ✅ End)

  1. ➕ Add a Start node

  2. 👤 Add a User Task (Human Task)

  3. ✅ Add an End node

  4. 🔗 Connect them in sequence

👉 Configure the User Task:

  • 🏷️ Name: Approve Request

  • 📝 Task Name: approve-request

  • 👥 Actors: manager


📊 Step 3: Define Data (optional)

  • Add process variable: approved:Boolean

  • Map Human Task output → process variable


🗂️ Step 4: Generate a Simple Form

  • ⚡ Auto-generate a form for the Human Task

  • 📋 Form contains a checkbox for approved


🔨 Step 5: Validate and Build

  1. 💾 Save the process

  2. 🛠️ Build & Install

  3. 📦 Ensure deployment on KIE Server


▶️ Step 6: Start the Process

  • Go to Menu → Manage → Process Definitions

  • ▶️ Start a new instance of Simple Approval


👨‍💻 Step 7: Claim and Complete the Human Task

  1. 🔍 Check tasks under Manage → Tasks

  2. Claim the task

  3. ▶️ Start it

  4. Complete the task (e.g., approved = true)


🌐 Step 8: (Optional) Use REST API

  • 📡 Start process

Start a process

POST /kie-server/services/rest/server/containers/{containerId}/processes/com.example.simpleapproval/instances Auth: Basic (wbadmin:wbadmin) Content-Type: application/json Body: {}

Example curl

curl -u wbadmin:wbadmin \ -H "Content-Type: application/json" \ -X POST \ http://localhost:8080/kie-server/services/rest/server/containers/hr-approval_1.0.0/processes/com.example.simpleapproval/instances \ -d '{}'

Find tasks for a user

GET /kie-server/services/rest/server/queries/tasks/instances/pot-owners?taskOwner=wbadmin&status=Ready,Reserved,InProgress

📡 Complete task

PUT /kie-server/services/rest/server/containers/{containerId}/tasks/{taskId}/states/completed

Body: {"approved": true}

Claim → Start → Complete a task
PUT /kie-server/services/rest/server/containers/{containerId}/tasks/{taskId}/states/claimed PUT /kie-server/services/rest/server/containers/{containerId}/tasks/{taskId}/states/started PUT /kie-server/services/rest/server/containers/{containerId}/tasks/{taskId}/states/completed Body: {"approved": true}

curl complete

curl -u wbadmin:wbadmin \ -H "Content-Type: application/json" \ -X PUT \ http://localhost:8080/kie-server/services/rest/server/containers/hr-approval_1.0.0/tasks/123/states/completed \ -d '{"approved": true}'

If you get 405 Method Not Allowed, double-check you used PUT (not POST) for state changes,
and that the containerId matches the deployed artifact (groupId:artifactId:version → often
artifactId_version by default).

🛠️ Step 9: Quick Troubleshooting

  • No tasks? Check if user is in manager role

  • ⚠️ Build not deployed? Verify container status on KIE Server

  • 🔄 405 error? Ensure correct HTTP method (PUT/POST)


👉Watch jBPM Workflow Practical in Action better:

Here's a quick video to help you understand jBPM Workflow Automation in Practical in Action better: JBPM Tutorial | Human Task & Hello World Script Flow


🎯 Conclusion

The 👤 Human Task workflow shows how people can actively participate in automated processes by claiming and completing tasks assigned to them. 

This simple 🔵 Start → 👤 Human Task → ✅ End workflow
 is the foundation of real-world approval or review systems.

By completing this tutorial, you learned how to:

👥 Assign tasks to actors or groups

📋 Generate and use task forms

🔄 Claim, start, and complete tasks via UI or REST API

👉 Next, try enhancing this workflow by adding:

🔀 Gateways for conditional branching

⚙️ Service Tasks for integration

💻 Script Tasks for automation

Mastering Human Tasks is essential since almost every business process involves people — and this example sets the stage for building enterprise-grade workflows with jBPM.

💼 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, 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