Menu

Preparing a FEEL Context: The Type Coercion Problem Nobody Warns You About
πŸ“°
0

Preparing a FEEL Context: The Type Coercion Problem Nobody Warns You About

DEV CommunityΒ·Sam AbaasiΒ·about 1 month ago
#ZDDQtdPK
#case#camunda#null#value#date#context
Reading 0:00
15s threshold

Part 4 of the series: "Extending bpmn-io Form-JS Beyond Its Limits" You write = amount > 100 in your Form-JS binding field. The user fills in 150 . The expression returns null . Not false . Not an error. Just null . Silently wrong. You check the expression syntax β€” it's correct. You check that amount is in your context β€” it is. You add console logs and confirm the value is "150" . Everything looks right and nothing works. The problem is the quotes around 150 . Your form field returned the string "150" , not the number 150 . FEEL is strictly typed. "150" > 100 is not a valid FEEL operation β€” you're comparing a string to a number. FEEL doesn't throw an error for this. It returns null . Silently. With no indication of what went wrong. This is the type coercion problem that nobody warns you about, and it will affect every FEEL expression you evaluate at runtime until you understand it and fix it systematically. The Problem When Form-JS collects user input, everything comes back as strings.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More