Camunda 7 Form Submit Error – Expression Returns Non-Boolean (Root Cause & Fix)
In Camunda 7, form submissions often fail with a confusing runtime error:
❌ Cannot submit task form
Condition expression returns non-Boolean: result has classjava.lang.Stringand notjava.lang.Boolean
This issue is very common when using embedded forms, task forms, gateways, or conditional flows.
This blog explains why it happens, how to identify the root cause, and how to fix it correctly.
1️⃣ What This Error Actually Means
Camunda expects Boolean (true / false) values in:
Sequence flow conditions
Gateway conditions
Conditional events
Form field validations (indirectly)
But instead, the expression is returning:
A String (
"true","false","yes","no")Or a non-Boolean object (e.g.
Integer,Long,null)
➡️ Result: Form submission fails
2️⃣ Most Common Root Causes
🔴 Root Cause 1: Form Field Type Is String (Not Boolean)
In Camunda forms, values are Strings by default.
Example:
This stores:
Later used in BPMN:
❌ Fails because it returns a String
✅ Fix:
🔴 Root Cause 2: Gateway Condition Uses Variable Directly
❌ Incorrect:
If approved is "true" (String), Camunda throws the error.
✅ Correct:
or (String-safe):
🔴 Root Cause 3: FEEL / JUEL Expression Confusion
Camunda 7 uses JUEL, not FEEL.
❌ Invalid (FEEL-style):
✅ Valid (JUEL):
🔴 Root Cause 4: Radio Button / Select Returns String
HTML forms always submit String values.
Example:
Later used as:
❌ Error: String is not Boolean
✅ Fix:
🔴 Root Cause 5: Variable Is Null
If the variable is not set, the expression returns null.
❌:
✅ Null-safe check:
or
3️⃣ How to Identify the Problem Quickly
✔ Step 1: Check Variable Type in Cockpit
Open Cockpit → Variables
Check Type (String / Boolean)
✔ Step 2: Check Form Field Definition
Embedded form
Generated form
External form (Angular / React)
✔ Step 3: Inspect Gateway Condition
Look for:
This is almost always the issue.
4️⃣ Best Practice Patterns (Recommended)
✅ Pattern 1: Always Compare Explicitly
✅ Pattern 2: Convert in Java Delegate
✅ Pattern 3: Use Boolean Form Field
If using Camunda generated forms:
5️⃣ Example: Correct BPMN Gateway Condition
❌ Wrong:
✅ Correct:
or
6️⃣ Production Checklist
✅ Never rely on implicit Boolean evaluation
✅ Always compare String values explicitly
✅ Validate variable types in Cockpit
✅ Avoid FEEL syntax in Camunda 7
✅ Add logging before gateways if needed
7️⃣ When to Ask for Expert Help
If:
The error occurs only in production
Forms are external (Angular / React)
Multiple gateways depend on the same variable
Professional debugging can save hours.
💼 Professional Support Available
If you are facing issues in real production projects related to Camunda forms, task submission errors, gateway conditions, or expression failures, I provide paid consulting, production debugging, project support, and focused trainings.
📧 Contact: ishikhanirankari@gmail.com | info@realtechnologiesindia.com
🌐 Website: IT Trainings | Digital metal podium
Comments
Post a Comment